mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix dialog text not trimmed in translation table key
This commit is contained in:
parent
9e646753f8
commit
e450a2b459
@ -211,7 +211,8 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
XmlNode pageData = (XmlNode)Page;
|
XmlNode pageData = (XmlNode)Page;
|
||||||
var text = pageData.InnerText;
|
var text = pageData.InnerText;
|
||||||
TranslationHandler.AddDialogue(text, name);
|
// The text is trimmed in CharacterDialogueTree.LoadXml, so we also need to trim it for the key
|
||||||
|
TranslationHandler.AddDialogue(text, true, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlText = xmlNode2.SelectNodes("DialogueOptionsList/DialogueOption/Text");
|
xmlText = xmlNode2.SelectNodes("DialogueOptionsList/DialogueOption/Text");
|
||||||
@ -219,7 +220,8 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
XmlNode pageData = (XmlNode)Page;
|
XmlNode pageData = (XmlNode)Page;
|
||||||
var text = pageData.InnerText;
|
var text = pageData.InnerText;
|
||||||
TranslationHandler.AddDialogue(text, characterName, name);
|
// The text is trimmed in DialogueText constructor (_listTextBlocks), so we also need to trim it for the key
|
||||||
|
TranslationHandler.AddDialogue(text, true, characterName, name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,9 +100,9 @@ namespace NewHorizons.Handlers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddDialogue(string rawText, params string[] rawPreText)
|
public static void AddDialogue(string rawText, bool trimRawTextForKey = false, params string[] rawPreText)
|
||||||
{
|
{
|
||||||
var key = string.Join(string.Empty, rawPreText) + rawText;
|
var key = string.Join(string.Empty, rawPreText) + (trimRawTextForKey? rawText.Trim() : rawText);
|
||||||
|
|
||||||
var text = GetTranslation(rawText, TextType.DIALOGUE);
|
var text = GetTranslation(rawText, TextType.DIALOGUE);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user