Hi Nathan,
What kind of UI text are you thinking of? The LocalizeUI component is for design-time text, such as the word "QUIT" on uSurvival's Quit button. This pulls translations from a text table.
If you're talking about, say, the interaction text that appears when you mouse over an item or a door, uSurvival produces that at runtime. Fortunately, it's pretty easy to add localization. I'll explain how to localize the door interaction text, but the same process applies to items.
Make a copy of Door.cs. Rename is something like Door2.cs or DoorLocalized.cs. Edit it and rename the class accordingly. Change the GetInteractionText() method from this:
Code: Select all
public string GetInteractionText()
{
return (open ? "Close" : "Open") + " door";
}
to something like this:
Code: Select all
public string GetInteractionText()
{
return PixelCrushers.DialogueSystem.GetLocalizedText((open ? "Close" : "Open") + " door");
}
Then add two entries to your text table:
Or, if you want to process [var=
varName] tags instead of using a text table, set GetInteractionText() to this:
Code: Select all
public string GetInteractionText()
{
return PixelCrushers.DialogueSystem.FormattedText.ParseCode((open ? "Close" : "Open") + " [var=door]");
}
You'll need to use this script in place of Door in your project. You could always directly edit Door.cs, but then you'll need to remember to re-add those edits if you ever update uSurvival.