From 45be409a8474ecda4f47e185185990ababa64a54 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 15 Apr 2019 12:08:39 +0300 Subject: [PATCH] (84bcafc68) Added "text picker menu" to ItemMsgs, replace """ with a quotation mark in texts --- .../Source/Items/Components/ItemComponent.cs | 2 +- .../BarotraumaShared/Source/Map/Hull.cs | 19 +++++++++++++++++++ .../BarotraumaShared/Source/TextPack.cs | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/ItemComponent.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/ItemComponent.cs index 7a0027a89..50d9d7ce1 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/ItemComponent.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/ItemComponent.cs @@ -190,7 +190,7 @@ namespace Barotrauma.Items.Components get { return name; } } - [Editable, Serialize("", true)] + [Editable, Serialize("", true, translationTextTag: "ItemMsg")] public string Msg { get; diff --git a/Barotrauma/BarotraumaShared/Source/Map/Hull.cs b/Barotrauma/BarotraumaShared/Source/Map/Hull.cs index abece731b..c459963d8 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Hull.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Hull.cs @@ -204,6 +204,25 @@ namespace Barotrauma } } + public string DisplayName + { + get; + private set; + } + + private string roomName; + [Editable, Serialize("", true, translationTextTag: "RoomName.")] + public string RoomName + { + get { return roomName; } + set + { + if (roomName == value) { return; } + roomName = value; + DisplayName = TextManager.Get(roomName, returnNull: true) ?? roomName; + } + } + public override Rectangle Rect { get diff --git a/Barotrauma/BarotraumaShared/Source/TextPack.cs b/Barotrauma/BarotraumaShared/Source/TextPack.cs index e36bff60c..f1c2c3a76 100644 --- a/Barotrauma/BarotraumaShared/Source/TextPack.cs +++ b/Barotrauma/BarotraumaShared/Source/TextPack.cs @@ -37,6 +37,7 @@ namespace Barotrauma text = text.Replace("&", "&"); text = text.Replace("<", "<"); text = text.Replace(">", ">"); + text = text.Replace(""", "\""); infoList.Add(text); } }