I couldn't find a nice way to make them work along.
I tried overriding the class, but the method wasn't being called. The trouble was, that if LocalizedUI doesn't find the field in the table, it just won't call GetLocalizedText method. (I think it's because I'm using an old version of Dialogue System)
I really hate to touch source code, but I gave it a shot and got it working.
New LocalizedUIExtended:
Code: Select all
protected override string GetLocalizedText(string fieldName) {
var localizedText = fieldName;
foreach (var field in textTable.GetFieldNames()) {
if (localizedText.Contains(field)) {
localizedText = localizedText.Replace(field, textTable.GetFieldText(field));
}
}
return localizedText;
}
The next trouble, is that Reiconed uses the "Update" hook in order to update the icons, so the localized text would be overriden by it. Alright, so I extended reiconed and make it invoke an event when the icon changed, so the new Localize UI can translate again the text.
That didn't work neither, because LocalizeUI then would override the icon (I'm not completly sure why, I think it's related to the way reiconed parses the string in order to choose the correct sprite. Anyway, it just blink for a second and then the icon disapears). Also after that, reiconed loses reference to the {action} text (that uses to setup the icon).
It just become a little messy, so, the cleaner the better. I will just use two text components

, one will display the button and the other will display the localized text
Unless there is a better way to make it work, I think I can live with that
