Hi,
You could write a C# function GetTextField(string fieldName):
Code: Select all
public void GetTextField(string fieldName) { return DialogueManager.GetLocalizedText(fieldName); }
Then
register it with Lua and use the markup tag [lua(GetTextField("your-field"))].
Alternatively, you could add a script with an
OnConversationLine method to the Dialogue Manager, such as:
Code: Select all
public void OnConversationLine(Subtitle subtitle)
{
// Replace all strings of the format {{field-name}} with the localized Text Table value of field-name:
subtitle.formattedText.text = Regex.Replace(subtitle.formattedText.text, @"{{.+?(?=}})}}", m => DialogueManager.GetLocalizedText(m.Value.Substring(2, m.Value.Length - 4)));
}
That's a bit of a convoluted regex, but the idea is that it replaces any substrings of the form {{
field-name}} with the localized value of
field-name in the text table.