Fix uses of LabelWidget.Text and ButtonWidget.Text to use GetText instead.

The Text element of these widgets was changed from display text to a translation key as part of adding translation support. Functions interested in the display text need to invoke GetText instead. Lots of functions have not been updated, resulting in symptoms such as measuring the font size of the translation key rather than the display text and resizing a widget to the wrong size.

Update all callers to use GetText when getting or setting display text. This ensure their existing functionality that was intended to work in terms of the display text and not the translation key works as expected.
This commit is contained in:
RoosterDragon
2024-01-13 13:23:27 +00:00
committed by Gustas
parent ead78bc3a3
commit 2fde98a0d1
27 changed files with 115 additions and 84 deletions

View File

@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
statusLabel.GetText = () => status.Update(getStatusText());
var text = TranslationProvider.GetString(Downloading, Translation.Arguments("title", download.Title));
panel.Get<LabelWidget>("TITLE").Text = text;
panel.Get<LabelWidget>("TITLE").GetText = () => text;
ShowDownloadDialog();
}