Add TranslationProvider

This commit is contained in:
Matthias Mailänder
2023-04-13 17:14:01 +03:00
committed by Matthias Mailänder
parent a065e6a47c
commit 68eec52cef
66 changed files with 384 additions and 333 deletions

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
readonly ContainerWidget template;
[ObjectCreator.UseCtor]
public GameInfoObjectivesLogic(Widget widget, World world, ModData modData)
public GameInfoObjectivesLogic(Widget widget, World world)
{
var player = world.RenderPlayer ?? world.LocalPlayer;
@@ -51,9 +51,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
var missionStatus = widget.Get<LabelWidget>("MISSION_STATUS");
var inProgress = modData.Translation.GetString(InProgress);
var accomplished = modData.Translation.GetString(Accomplished);
var failed = modData.Translation.GetString(Failed);
var inProgress = TranslationProvider.GetString(InProgress);
var accomplished = TranslationProvider.GetString(Accomplished);
var failed = TranslationProvider.GetString(Failed);
missionStatus.GetText = () => player.WinState == WinState.Undefined ? inProgress :
player.WinState == WinState.Won ? accomplished : failed;
missionStatus.GetColor = () => player.WinState == WinState.Undefined ? Color.White :