Fix map level lobby options not being translated
This commit is contained in:
committed by
Matthias Mailänder
parent
efe135e38b
commit
a065e6a47c
@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
|
||||
{
|
||||
yield return new LobbyBooleanOption("cheats", CheckboxLabel, CheckboxDescription, CheckboxVisible, CheckboxDisplayOrder, CheckboxEnabled, CheckboxLocked);
|
||||
yield return new LobbyBooleanOption(map, "cheats", CheckboxLabel, CheckboxDescription, CheckboxVisible, CheckboxDisplayOrder, CheckboxEnabled, CheckboxLocked);
|
||||
}
|
||||
|
||||
public override object Create(ActorInitializer init) { return new DeveloperMode(this); }
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
|
||||
{
|
||||
yield return new LobbyBooleanOption(ID, Label, Description,
|
||||
yield return new LobbyBooleanOption(map, ID, Label, Description,
|
||||
Visible, DisplayOrder, Enabled, Locked);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var startingCash = SelectableCash.ToDictionary(c => c.ToString(), c => "$" + c.ToString());
|
||||
|
||||
if (startingCash.Count > 0)
|
||||
yield return new LobbyOption("startingcash", DefaultCashDropdownLabel, DefaultCashDropdownDescription, DefaultCashDropdownVisible, DefaultCashDropdownDisplayOrder,
|
||||
yield return new LobbyOption(map, "startingcash", DefaultCashDropdownLabel, DefaultCashDropdownDescription, DefaultCashDropdownVisible, DefaultCashDropdownDisplayOrder,
|
||||
startingCash, DefaultCash.ToString(), DefaultCashDropdownLocked);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
|
||||
{
|
||||
yield return new LobbyBooleanOption("crates", CheckboxLabel, CheckboxDescription, CheckboxVisible, CheckboxDisplayOrder, CheckboxEnabled, CheckboxLocked);
|
||||
yield return new LobbyBooleanOption(map, "crates", CheckboxLabel, CheckboxDescription, CheckboxVisible, CheckboxDisplayOrder, CheckboxEnabled, CheckboxLocked);
|
||||
}
|
||||
|
||||
public override object Create(ActorInitializer init) { return new CrateSpawner(init.Self, this); }
|
||||
|
||||
@@ -60,10 +60,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
|
||||
{
|
||||
yield return new LobbyBooleanOption("allybuild", AllyBuildRadiusCheckboxLabel, AllyBuildRadiusCheckboxDescription,
|
||||
yield return new LobbyBooleanOption(map, "allybuild", AllyBuildRadiusCheckboxLabel, AllyBuildRadiusCheckboxDescription,
|
||||
AllyBuildRadiusCheckboxVisible, AllyBuildRadiusCheckboxDisplayOrder, AllyBuildRadiusCheckboxEnabled, AllyBuildRadiusCheckboxLocked);
|
||||
|
||||
yield return new LobbyBooleanOption("buildradius", BuildRadiusCheckboxLabel, BuildRadiusCheckboxDescription,
|
||||
yield return new LobbyBooleanOption(map, "buildradius", BuildRadiusCheckboxLabel, BuildRadiusCheckboxDescription,
|
||||
BuildRadiusCheckboxVisible, BuildRadiusCheckboxDisplayOrder, BuildRadiusCheckboxEnabled, BuildRadiusCheckboxLocked);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
|
||||
{
|
||||
yield return new LobbyBooleanOption("creeps", CheckboxLabel, CheckboxDescription, CheckboxVisible, CheckboxDisplayOrder, CheckboxEnabled, CheckboxLocked);
|
||||
yield return new LobbyBooleanOption(map, "creeps", CheckboxLabel, CheckboxDescription, CheckboxVisible, CheckboxDisplayOrder, CheckboxEnabled, CheckboxLocked);
|
||||
}
|
||||
|
||||
public override object Create(ActorInitializer init) { return new MapCreeps(this); }
|
||||
|
||||
@@ -81,22 +81,24 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
|
||||
{
|
||||
yield return new LobbyBooleanOption("shortgame", ShortGameCheckboxLabel, ShortGameCheckboxDescription,
|
||||
yield return new LobbyBooleanOption(map, "shortgame", ShortGameCheckboxLabel, ShortGameCheckboxDescription,
|
||||
ShortGameCheckboxVisible, ShortGameCheckboxDisplayOrder, ShortGameCheckboxEnabled, ShortGameCheckboxLocked);
|
||||
|
||||
var techLevels = map.PlayerActorInfo.TraitInfos<ProvidesTechPrerequisiteInfo>()
|
||||
.ToDictionary(t => t.Id, t => Game.ModData.Translation.GetString(t.Name));
|
||||
.ToDictionary(t => t.Id, t => map.GetLocalisedString(t.Name));
|
||||
|
||||
if (techLevels.Count > 0)
|
||||
yield return new LobbyOption("techlevel", TechLevelDropdownLabel, TechLevelDropdownDescription, TechLevelDropdownVisible, TechLevelDropdownDisplayOrder,
|
||||
yield return new LobbyOption(map, "techlevel", TechLevelDropdownLabel, TechLevelDropdownDescription, TechLevelDropdownVisible, TechLevelDropdownDisplayOrder,
|
||||
techLevels, TechLevel, TechLevelDropdownLocked);
|
||||
|
||||
var gameSpeeds = Game.ModData.Manifest.Get<GameSpeeds>();
|
||||
var speeds = gameSpeeds.Speeds.ToDictionary(s => s.Key, s => Game.ModData.Translation.GetString(s.Value.Name));
|
||||
|
||||
// NOTE: This is just exposing the UI, the backend logic for this option is hardcoded in World
|
||||
yield return new LobbyOption("gamespeed", GameSpeedDropdownLabel, GameSpeedDropdownDescription, GameSpeedDropdownVisible, GameSpeedDropdownDisplayOrder,
|
||||
speeds, GameSpeed ?? gameSpeeds.DefaultSpeed, GameSpeedDropdownLocked);
|
||||
// NOTE: This is just exposing the UI, the backend logic for this option is hardcoded in World.
|
||||
yield return new LobbyOption(map, "gamespeed",
|
||||
GameSpeedDropdownLabel, GameSpeedDropdownDescription,
|
||||
GameSpeedDropdownVisible, GameSpeedDropdownDisplayOrder, speeds,
|
||||
GameSpeed ?? gameSpeeds.DefaultSpeed, GameSpeedDropdownLocked);
|
||||
}
|
||||
|
||||
void IRulesetLoaded<ActorInfo>.RulesetLoaded(Ruleset rules, ActorInfo info)
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
|
||||
{
|
||||
yield return new LobbyBooleanOption(
|
||||
map,
|
||||
"separateteamspawns",
|
||||
SeparateTeamSpawnsCheckboxLabel,
|
||||
SeparateTeamSpawnsCheckboxDescription,
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
|
||||
{
|
||||
yield return new LobbyOption(ID, Label, Description, Visible, DisplayOrder,
|
||||
yield return new LobbyOption(map, ID, Label, Description, Visible, DisplayOrder,
|
||||
Values, Default, Locked);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,10 +47,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
// Duplicate classes are defined for different race variants
|
||||
foreach (var t in map.WorldActorInfo.TraitInfos<StartingUnitsInfo>())
|
||||
startingUnits[t.Class] = Game.ModData.Translation.GetString(t.ClassName);
|
||||
startingUnits[t.Class] = map.GetLocalisedString(t.ClassName);
|
||||
|
||||
if (startingUnits.Count > 0)
|
||||
yield return new LobbyOption("startingunits", DropdownLabel, DropdownDescription, DropdownVisible, DropdownDisplayOrder,
|
||||
yield return new LobbyOption(map, "startingunits", DropdownLabel, DropdownDescription, DropdownVisible, DropdownDisplayOrder,
|
||||
startingUnits, StartingUnitsClass, DropdownLocked);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return Game.ModData.Translation.GetString(TimeLimitOption, Translation.Arguments("minutes", m));
|
||||
});
|
||||
|
||||
yield return new LobbyOption("timelimit", TimeLimitLabel, TimeLimitDescription, TimeLimitDropdownVisible, TimeLimitDisplayOrder,
|
||||
yield return new LobbyOption(map, "timelimit", TimeLimitLabel, TimeLimitDescription, TimeLimitDropdownVisible, TimeLimitDisplayOrder,
|
||||
timelimits, TimeLimitDefault.ToString(), TimeLimitLocked);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user