(edb24c37f) Fixed ItemComponents overwriting the Msg-tags ("ItemMsgPressSelect" etc) with the text fetched from the text xml, preventing the texts from being translated after the sub has been saved.

This commit is contained in:
Joonas Rikkonen
2019-03-28 12:36:11 +02:00
parent d7526934e6
commit a8222e429f
4 changed files with 31 additions and 17 deletions
@@ -158,7 +158,7 @@ namespace Barotrauma.Items.Components
if (attachable)
{
prevMsg = Msg;
prevMsg = DisplayMsg;
prevPickKey = PickKey;
prevRequiredItems = new Dictionary<RelatedItem.RelationType, List<RelatedItem>>(requiredItems);
@@ -191,7 +191,7 @@ namespace Barotrauma.Items.Components
base.Load(componentElement);
if (attachable)
{
prevMsg = Msg;
prevMsg = DisplayMsg;
prevPickKey = PickKey;
prevRequiredItems = new Dictionary<RelatedItem.RelationType, List<RelatedItem>>(requiredItems);
}
@@ -404,8 +404,8 @@ namespace Barotrauma.Items.Components
body.Enabled = false;
item.body = null;
Msg = prevMsg;
DisplayMsg = prevMsg;
PickKey = prevPickKey;
requiredItems = new Dictionary<RelatedItem.RelationType, List<RelatedItem>>(prevRequiredItems);
@@ -420,7 +420,7 @@ namespace Barotrauma.Items.Components
//make the item pickable with the default pick key and with no specific tools/items when it's deattached
requiredItems.Clear();
Msg = "";
DisplayMsg = "";
PickKey = InputType.Select;
}