(457e4ebe5) Fixed: Submarine navigation labels being translated when loading a sub in editor
This commit is contained in:
@@ -443,12 +443,22 @@ namespace Barotrauma
|
||||
|
||||
identifier = element.GetAttributeString("identifier", "");
|
||||
|
||||
name = TextManager.Get("EntityName." + identifier, true) ?? element.GetAttributeString("name", "");
|
||||
if (name == "") DebugConsole.ThrowError("Unnamed item in " + filePath + "!");
|
||||
|
||||
//nameidentifier can be used to make multiple items use the same names and descriptions
|
||||
string nameIdentifier = element.GetAttributeString("nameidentifier", "");
|
||||
|
||||
if (string.IsNullOrEmpty(nameIdentifier))
|
||||
{
|
||||
name = TextManager.Get("EntityName." + identifier, true) ?? element.GetAttributeString("name", "");
|
||||
}
|
||||
else
|
||||
{
|
||||
name = TextManager.Get("EntityName." + nameIdentifier, true) ?? element.GetAttributeString("name", "");
|
||||
}
|
||||
|
||||
if (name == "") { DebugConsole.ThrowError("Unnamed item in " + filePath + "!"); }
|
||||
|
||||
DebugConsole.Log(" " + name);
|
||||
|
||||
Aliases = element.GetAttributeStringArray("aliases", new string[0], convertToLowerInvariant: true);
|
||||
|
||||
if (!Enum.TryParse(element.GetAttributeString("category", "Misc"), true, out MapEntityCategory category))
|
||||
@@ -481,7 +491,15 @@ namespace Barotrauma
|
||||
|
||||
SerializableProperty.DeserializeProperties(this, element);
|
||||
|
||||
string translatedDescription = TextManager.Get("EntityDescription." + identifier, true);
|
||||
string translatedDescription = "";
|
||||
if (string.IsNullOrEmpty(nameIdentifier))
|
||||
{
|
||||
translatedDescription = TextManager.Get("EntityDescription." + identifier, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
translatedDescription = TextManager.Get("EntityDescription." + nameIdentifier, true);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(translatedDescription)) Description = translatedDescription;
|
||||
|
||||
foreach (XElement subElement in element.Elements())
|
||||
|
||||
Reference in New Issue
Block a user