Expose game speeds to localisation.
This commit is contained in:
committed by
abcdefg30
parent
425c678cd9
commit
efe65701e4
@@ -314,12 +314,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var speeds = modData.Manifest.Get<GameSpeeds>().Speeds;
|
||||
gameSpeed = "default";
|
||||
|
||||
gameSpeedButton.GetText = () => speeds[gameSpeed].Name;
|
||||
var speedText = new CachedTransform<string, string>(s => modData.Translation.GetString(speeds[s].Name));
|
||||
gameSpeedButton.GetText = () => speedText.Update(gameSpeed);
|
||||
gameSpeedButton.OnMouseDown = _ =>
|
||||
{
|
||||
var options = speeds.Select(s => new DropDownOption
|
||||
{
|
||||
Title = s.Value.Name,
|
||||
Title = modData.Translation.GetString(s.Value.Name),
|
||||
IsSelected = () => gameSpeed == s.Key,
|
||||
OnClick = () => gameSpeed = s.Key
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user