diff --git a/OpenRA.Game/Traits/Player/PlayerResources.cs b/OpenRA.Game/Traits/Player/PlayerResources.cs index 112fa719b4..c4be846b04 100644 --- a/OpenRA.Game/Traits/Player/PlayerResources.cs +++ b/OpenRA.Game/Traits/Player/PlayerResources.cs @@ -26,6 +26,12 @@ namespace OpenRA.Traits [Desc("Force the DefaultCash option by disabling changes in the lobby.")] public readonly bool DefaultCashLocked = false; + [Desc("Whether to display the DefaultCash option in the lobby.")] + public readonly bool DefaultCashVisible = true; + + [Desc("Display order for the DefaultCash option.")] + public readonly int DefaultCashDisplayOrder = 0; + [Desc("Speech notification to play when the player does not have any funds.")] public readonly string InsufficientFundsNotification = null; @@ -37,7 +43,10 @@ namespace OpenRA.Traits var startingCash = SelectableCash.ToDictionary(c => c.ToString(), c => "$" + c.ToString()); if (startingCash.Any()) - yield return new LobbyOption("startingcash", "Starting Cash", new ReadOnlyDictionary(startingCash), DefaultCash.ToString(), DefaultCashLocked); + yield return new LobbyOption("startingcash", "Starting Cash", "Change the amount of cash that players start with", + DefaultCashVisible, DefaultCashDisplayOrder, + new ReadOnlyDictionary(startingCash), + DefaultCash.ToString(), DefaultCashLocked); } public object Create(ActorInitializer init) { return new PlayerResources(init.Self, this); } diff --git a/OpenRA.Game/Traits/Player/Shroud.cs b/OpenRA.Game/Traits/Player/Shroud.cs index 6f6ce09b51..db49c54372 100644 --- a/OpenRA.Game/Traits/Player/Shroud.cs +++ b/OpenRA.Game/Traits/Player/Shroud.cs @@ -23,16 +23,32 @@ namespace OpenRA.Traits [Desc("Prevent the fog enabled state from being changed in the lobby.")] public bool FogLocked = false; + [Desc("Whether to display the fog checkbox in the lobby.")] + public bool FogVisible = true; + + [Desc("Display order for the fog checkbox in the lobby.")] + public int FogDisplayOrder = 0; + [Desc("Default value of the explore map checkbox in the lobby.")] public bool ExploredMapEnabled = false; [Desc("Prevent the explore map enabled state from being changed in the lobby.")] public bool ExploredMapLocked = false; + [Desc("Whether to display the explore map checkbox in the lobby.")] + public bool ExploredMapVisible = true; + + [Desc("Display order for the explore map checkbox in the lobby.")] + public int ExploredMapDisplayOrder = 0; + IEnumerable ILobbyOptions.LobbyOptions(Ruleset rules) { - yield return new LobbyBooleanOption("explored", "Explored Map", ExploredMapEnabled, ExploredMapLocked); - yield return new LobbyBooleanOption("fog", "Fog of War", FogEnabled, FogLocked); + yield return new LobbyBooleanOption("explored", "Explored Map", "Initial map shroud is revealed", + ExploredMapVisible, ExploredMapDisplayOrder, + ExploredMapEnabled, ExploredMapLocked); + yield return new LobbyBooleanOption("fog", "Fog of War", "Line of sight is required to view enemy forces", + FogVisible, FogDisplayOrder, + FogEnabled, FogLocked); } public object Create(ActorInitializer init) { return new Shroud(init.Self, this); } diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index aa56c7e91f..83f034593d 100644 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -389,14 +389,21 @@ namespace OpenRA.Traits { public readonly string Id; public readonly string Name; + public readonly string Description; public readonly IReadOnlyDictionary Values; public readonly string DefaultValue; public readonly bool Locked; + public readonly bool Visible; + public readonly int DisplayOrder; - public LobbyOption(string id, string name, IReadOnlyDictionary values, string defaultValue, bool locked) + public LobbyOption(string id, string name, string description, bool visible, int displayorder, + IReadOnlyDictionary values, string defaultValue, bool locked) { Id = id; Name = name; + Description = description; + Visible = visible; + DisplayOrder = displayorder; Values = values; DefaultValue = defaultValue; Locked = locked; @@ -416,8 +423,8 @@ namespace OpenRA.Traits { false.ToString(), "disabled" } }; - public LobbyBooleanOption(string id, string name, bool defaultValue, bool locked) - : base(id, name, new ReadOnlyDictionary(BoolValues), defaultValue.ToString(), locked) { } + public LobbyBooleanOption(string id, string name, string description, bool visible, int displayorder, bool defaultValue, bool locked) + : base(id, name, description, visible, displayorder, new ReadOnlyDictionary(BoolValues), defaultValue.ToString(), locked) { } public override string ValueChangedMessage(string playerName, string newValue) { diff --git a/OpenRA.Mods.Common/Traits/Player/DeveloperMode.cs b/OpenRA.Mods.Common/Traits/Player/DeveloperMode.cs index bf444a31b0..28cbe4d086 100644 --- a/OpenRA.Mods.Common/Traits/Player/DeveloperMode.cs +++ b/OpenRA.Mods.Common/Traits/Player/DeveloperMode.cs @@ -24,6 +24,12 @@ namespace OpenRA.Mods.Common.Traits [Desc("Prevent the developer mode state from being changed in the lobby.")] public bool Locked = false; + [Desc("Whether to display the developer mode checkbox in the lobby.")] + public bool Visible = true; + + [Desc("Display order for the developer mode checkbox in the lobby.")] + public int DisplayOrder = 0; + [Desc("Default cash bonus granted by the give cash cheat.")] public int Cash = 20000; @@ -50,7 +56,9 @@ namespace OpenRA.Mods.Common.Traits IEnumerable ILobbyOptions.LobbyOptions(Ruleset rules) { - yield return new LobbyBooleanOption("cheats", "Debug Menu", Enabled, Locked); + yield return new LobbyBooleanOption("cheats", "Debug Menu", + "Enables cheats and developer commands", + Visible, DisplayOrder, Enabled, Locked); } public object Create(ActorInitializer init) { return new DeveloperMode(this); } diff --git a/OpenRA.Mods.Common/Traits/World/CrateSpawner.cs b/OpenRA.Mods.Common/Traits/World/CrateSpawner.cs index 6ee91c1894..86ce878e75 100644 --- a/OpenRA.Mods.Common/Traits/World/CrateSpawner.cs +++ b/OpenRA.Mods.Common/Traits/World/CrateSpawner.cs @@ -27,6 +27,12 @@ namespace OpenRA.Mods.Common.Traits [Desc("Prevent the crates state from being changed in the lobby.")] public readonly bool Locked = false; + [Desc("Whether to display the crates checkbox in the lobby.")] + public readonly bool Visible = true; + + [Desc("Display order for the crates checkbox in the lobby.")] + public readonly int DisplayOrder = 0; + [Desc("Minimum number of crates.")] public readonly int Minimum = 1; @@ -67,7 +73,9 @@ namespace OpenRA.Mods.Common.Traits IEnumerable ILobbyOptions.LobbyOptions(Ruleset rules) { - yield return new LobbyBooleanOption("crates", "Crates", Enabled, Locked); + yield return new LobbyBooleanOption("crates", "Crates", + "Collect crates with units to recieve random bonuses or penalties", + Visible, DisplayOrder, Enabled, Locked); } public object Create(ActorInitializer init) { return new CrateSpawner(init.Self, this); } diff --git a/OpenRA.Mods.Common/Traits/World/MapBuildRadius.cs b/OpenRA.Mods.Common/Traits/World/MapBuildRadius.cs index b70b1cf917..0609d96673 100644 --- a/OpenRA.Mods.Common/Traits/World/MapBuildRadius.cs +++ b/OpenRA.Mods.Common/Traits/World/MapBuildRadius.cs @@ -23,17 +23,33 @@ namespace OpenRA.Mods.Common.Traits [Desc("Prevent the ally build radius state from being changed in the lobby.")] public readonly bool AllyBuildRadiusLocked = false; + [Desc("Whether to display the ally build radius checkbox in the lobby.")] + public readonly bool AllyBuildRadiusVisible = true; + + [Desc("Display order for the ally build radius checkbox in the lobby.")] + public readonly int AllyBuildRadiusDisplayOrder = 0; + [Desc("Default value of the build radius checkbox in the lobby.")] public readonly bool BuildRadiusEnabled = true; [Desc("Prevent the build radius state from being changed in the lobby.")] public readonly bool BuildRadiusLocked = false; + [Desc("Display the build radius checkbox in the lobby.")] + public readonly bool BuildRadiusVisible = true; + + [Desc("Display order for the build radius checkbox in the lobby.")] + public readonly int BuildRadiusDisplayOrder = 0; + IEnumerable ILobbyOptions.LobbyOptions(Ruleset rules) { - yield return new LobbyBooleanOption("allybuild", "Build off Allies' ConYards", AllyBuildRadiusEnabled, AllyBuildRadiusLocked); + yield return new LobbyBooleanOption("allybuild", "Build off Allies", "Allow allies to place structures inside your build area", + AllyBuildRadiusVisible, AllyBuildRadiusDisplayOrder, + AllyBuildRadiusEnabled, AllyBuildRadiusLocked); - yield return new LobbyBooleanOption("buildradius", "Limit ConYard Area", BuildRadiusEnabled, BuildRadiusLocked); + yield return new LobbyBooleanOption("buildradius", "Limit Build Area", "Limits structure placement to areas around Construction Yards", + BuildRadiusVisible, BuildRadiusDisplayOrder, + BuildRadiusEnabled, BuildRadiusLocked); } public object Create(ActorInitializer init) { return new MapBuildRadius(this); } diff --git a/OpenRA.Mods.Common/Traits/World/MapCreeps.cs b/OpenRA.Mods.Common/Traits/World/MapCreeps.cs index 2293c678d4..2107c15eb9 100644 --- a/OpenRA.Mods.Common/Traits/World/MapCreeps.cs +++ b/OpenRA.Mods.Common/Traits/World/MapCreeps.cs @@ -23,9 +23,16 @@ namespace OpenRA.Mods.Common.Traits [Desc("Prevent the creeps state from being changed in the lobby.")] public readonly bool Locked = false; + [Desc("Whether to display the creeps checkbox in the lobby.")] + public readonly bool Visible = true; + + [Desc("Display order for the creeps checkbox in the lobby.")] + public readonly int DisplayOrder = 0; + IEnumerable ILobbyOptions.LobbyOptions(Ruleset rules) { - yield return new LobbyBooleanOption("creeps", "Worms", Enabled, Locked); + yield return new LobbyBooleanOption("creeps", "Worms", "Worms roam the map and devour unprepared forces", + Visible, DisplayOrder, Enabled, Locked); } public object Create(ActorInitializer init) { return new MapCreeps(this); } diff --git a/OpenRA.Mods.Common/Traits/World/MapOptions.cs b/OpenRA.Mods.Common/Traits/World/MapOptions.cs index d17234199b..35e0585894 100644 --- a/OpenRA.Mods.Common/Traits/World/MapOptions.cs +++ b/OpenRA.Mods.Common/Traits/World/MapOptions.cs @@ -24,27 +24,48 @@ namespace OpenRA.Mods.Common.Traits [Desc("Prevent the short game enabled state from being changed in the lobby.")] public readonly bool ShortGameLocked = false; + [Desc("Whether to display the short game checkbox in the lobby.")] + public readonly bool ShortGameVisible = true; + + [Desc("Display order for the short game checkbox in the lobby.")] + public readonly int ShortGameDisplayOrder = 0; + [Desc("Default tech level.")] public readonly string TechLevel = "unrestricted"; [Desc("Prevent the tech level from being changed in the lobby.")] public readonly bool TechLevelLocked = false; + [Desc("Display the tech level option in the lobby.")] + public readonly bool TechLevelVisible = true; + + [Desc("Display order for the tech level option in the lobby.")] + public readonly int TechLevelDisplayOrder = 0; + [Desc("Default game speed.")] public readonly string GameSpeed = "default"; [Desc("Prevent the game speed from being changed in the lobby.")] public readonly bool GameSpeedLocked = false; + [Desc("Display the game speed option in the lobby.")] + public readonly bool GameSpeedVisible = true; + + [Desc("Display order for the game speed option in the lobby.")] + public readonly int GameSpeedDisplayOrder = 0; + IEnumerable ILobbyOptions.LobbyOptions(Ruleset rules) { - yield return new LobbyBooleanOption("shortgame", "Short Game", ShortGameEnabled, ShortGameLocked); + yield return new LobbyBooleanOption("shortgame", "Short Game", "Players are defeated when their bases are destroyed", + ShortGameVisible, ShortGameDisplayOrder, + ShortGameEnabled, ShortGameLocked); var techLevels = rules.Actors["player"].TraitInfos() .ToDictionary(t => t.Id, t => t.Name); if (techLevels.Any()) - yield return new LobbyOption("techlevel", "Tech Level", + yield return new LobbyOption("techlevel", "Tech Level", "Change the units and abilities at your disposal", + TechLevelVisible, TechLevelDisplayOrder, new ReadOnlyDictionary(techLevels), TechLevel, TechLevelLocked); @@ -52,7 +73,8 @@ namespace OpenRA.Mods.Common.Traits .ToDictionary(s => s.Key, s => s.Value.Name); // NOTE: The server hardcodes special-case logic for this option id - yield return new LobbyOption("gamespeed", "Game Speed", + yield return new LobbyOption("gamespeed", "Game Speed", "Change the rate at which time passes", + GameSpeedVisible, GameSpeedDisplayOrder, new ReadOnlyDictionary(gameSpeeds), GameSpeed, GameSpeedLocked); } diff --git a/OpenRA.Mods.Common/Traits/World/ScriptLobbyDropdown.cs b/OpenRA.Mods.Common/Traits/World/ScriptLobbyDropdown.cs index 18e5c758b0..16e56562d6 100644 --- a/OpenRA.Mods.Common/Traits/World/ScriptLobbyDropdown.cs +++ b/OpenRA.Mods.Common/Traits/World/ScriptLobbyDropdown.cs @@ -23,9 +23,12 @@ namespace OpenRA.Mods.Common.Traits public readonly string ID = null; [FieldLoader.Require] - [Desc("Display name for this option.")] + [Desc("Descriptive label for this option.")] public readonly string Label = null; + [Desc("Tooltip description for this option.")] + public readonly string Description = null; + [FieldLoader.Require] [Desc("Default option key in the `Values` list.")] public readonly string Default = null; @@ -37,11 +40,18 @@ namespace OpenRA.Mods.Common.Traits [Desc("Prevent the option from being changed from its default value.")] public readonly bool Locked = false; + [Desc("Whether to display the option in the lobby.")] + public readonly bool Visible = true; + + [Desc("Display order for the option in the lobby.")] + public readonly int DisplayOrder = 0; + IEnumerable ILobbyOptions.LobbyOptions(Ruleset rules) { - yield return new LobbyOption(ID, Label, + yield return new LobbyOption(ID, Label, Description, + Visible, DisplayOrder, new ReadOnlyDictionary(Values), - Default, Locked); + Default, Locked); } public object Create(ActorInitializer init) { return new ScriptLobbyDropdown(this); } diff --git a/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs b/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs index 8b47b08f36..edfa6d34d8 100644 --- a/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs +++ b/OpenRA.Mods.Common/Traits/World/SpawnMPUnits.cs @@ -26,6 +26,12 @@ namespace OpenRA.Mods.Common.Traits [Desc("Prevent the starting units option from being changed in the lobby.")] public bool Locked = false; + [Desc("Whether to display the starting units option in the lobby.")] + public bool Visible = true; + + [Desc("Display order for the starting units option in the lobby.")] + public int DisplayOrder = 0; + IEnumerable ILobbyOptions.LobbyOptions(Ruleset rules) { var startingUnits = new Dictionary(); @@ -35,7 +41,10 @@ namespace OpenRA.Mods.Common.Traits startingUnits[t.Class] = t.ClassName; if (startingUnits.Any()) - yield return new LobbyOption("startingunits", "Starting Units", new ReadOnlyDictionary(startingUnits), StartingUnitsClass, Locked); + yield return new LobbyOption("startingunits", "Starting Units", "Change the units that you start the game with", + Visible, DisplayOrder, + new ReadOnlyDictionary(startingUnits), + StartingUnitsClass, Locked); } public object Create(ActorInitializer init) { return new SpawnMPUnits(this); } diff --git a/mods/cnc/rules/player.yaml b/mods/cnc/rules/player.yaml index 29639a1ae3..4897861255 100644 --- a/mods/cnc/rules/player.yaml +++ b/mods/cnc/rules/player.yaml @@ -10,8 +10,10 @@ Player: AllyRepair: PlayerResources: DeveloperMode: + DisplayOrder: 6 BaseAttackNotifier: Shroud: + FogDisplayOrder: 3 PlayerStatistics: FrozenActorLayer: PlaceBeacon: diff --git a/mods/cnc/rules/world.yaml b/mods/cnc/rules/world.yaml index 83636effdf..0d82fdae8e 100644 --- a/mods/cnc/rules/world.yaml +++ b/mods/cnc/rules/world.yaml @@ -77,9 +77,15 @@ World: WarheadDebugOverlay: CustomTerrainDebugOverlay: MapCreeps: + Visible: False SpawnMapActors: MapBuildRadius: + AllyBuildRadiusDisplayOrder: 4 + BuildRadiusDisplayOrder: 5 MapOptions: + ShortGameDisplayOrder: 2 + TechLevelDisplayOrder: 2 + GameSpeedDisplayOrder: 3 MPStartLocations: CreateMPPlayers: MPStartUnits@mcvonly: @@ -125,12 +131,14 @@ World: SupportActors: e1,e1,e1,e1,e1,e2,e2,e2,e3,e3,apc,mtnk SpawnMPUnits: StartingUnitsClass: light + DisplayOrder: 0 CrateSpawner: Minimum: 1 Maximum: 6 SpawnInterval: 3000 WaterChance: 0 InitialSpawnDelay: 1500 + DisplayOrder: 1 PathFinder: ValidateOrder: DebugPauseState: diff --git a/mods/d2k/rules/player.yaml b/mods/d2k/rules/player.yaml index 3b847d703e..423d9cc7dc 100644 --- a/mods/d2k/rules/player.yaml +++ b/mods/d2k/rules/player.yaml @@ -63,8 +63,10 @@ Player: SelectableCash: 2500, 5000, 7000, 10000, 20000 InsufficientFundsNotification: InsufficientFunds DeveloperMode: + DisplayOrder: 6 BaseAttackNotifier: Shroud: + FogDisplayOrder: 3 FrozenActorLayer: HarvesterAttackNotifier: PlayerStatistics: diff --git a/mods/d2k/rules/world.yaml b/mods/d2k/rules/world.yaml index b36427df27..4114c8583d 100644 --- a/mods/d2k/rules/world.yaml +++ b/mods/d2k/rules/world.yaml @@ -80,6 +80,7 @@ World: WaterChance: 0 ValidGround: Sand, Rock, Transition, Spice, SpiceSand, Dune, Concrete InitialSpawnDelay: 1500 + DisplayOrder: 1 DomainIndex: WarheadDebugOverlay: BuildableTerrainLayer: @@ -95,9 +96,15 @@ World: Sequence: sandcraters SmokePercentage: 0 MapCreeps: + DisplayOrder: 5 SpawnMapActors: MapBuildRadius: + AllyBuildRadiusDisplayOrder: 4 + BuildRadiusVisible: False MapOptions: + ShortGameDisplayOrder: 2 + TechLevelDisplayOrder: 2 + GameSpeedDisplayOrder: 3 CreateMPPlayers: MPStartLocations: MPStartUnits@mcv: @@ -154,6 +161,7 @@ World: InnerSupportRadius: 3 OuterSupportRadius: 5 SpawnMPUnits: + DisplayOrder: 1 PathFinder: ValidateOrder: DebugPauseState: diff --git a/mods/ra/maps/fort-lonestar/rules.yaml b/mods/ra/maps/fort-lonestar/rules.yaml index c3917b4d08..58fb280040 100644 --- a/mods/ra/maps/fort-lonestar/rules.yaml +++ b/mods/ra/maps/fort-lonestar/rules.yaml @@ -43,6 +43,7 @@ World: ScriptLobbyDropdown@difficulty: ID: difficulty Label: Difficulty + Description: Change the difficulty of the mission Values: hard: Hard (4P) normal: Normal (3P) @@ -51,6 +52,7 @@ World: tough: Real tough guy endless: Endless mode Default: hard + DisplayOrder: 5 FORTCRATE: Inherits: ^Crate diff --git a/mods/ra/rules/player.yaml b/mods/ra/rules/player.yaml index 215fbf3541..6089a1aa44 100644 --- a/mods/ra/rules/player.yaml +++ b/mods/ra/rules/player.yaml @@ -43,8 +43,10 @@ Player: PlayerResources: InsufficientFundsNotification: InsufficientFunds DeveloperMode: + DisplayOrder: 6 GpsWatcher: Shroud: + FogDisplayOrder: 3 FrozenActorLayer: BaseAttackNotifier: PlayerStatistics: diff --git a/mods/ra/rules/world.yaml b/mods/ra/rules/world.yaml index 94a068115f..b0188dcb3c 100644 --- a/mods/ra/rules/world.yaml +++ b/mods/ra/rules/world.yaml @@ -112,6 +112,7 @@ World: SpawnInterval: 3000 WaterChance: 20 InitialSpawnDelay: 1500 + DisplayOrder: 1 DomainIndex: SmudgeLayer@SCORCH: Type: Scorch @@ -125,7 +126,12 @@ World: WarheadDebugOverlay: SpawnMapActors: MapBuildRadius: + AllyBuildRadiusDisplayOrder: 4 + BuildRadiusDisplayOrder: 5 MapOptions: + ShortGameDisplayOrder: 2 + TechLevelDisplayOrder: 2 + GameSpeedDisplayOrder: 3 CreateMPPlayers: MPStartUnits@mcvonly: Class: none @@ -166,6 +172,7 @@ World: OuterSupportRadius: 5 MPStartLocations: SpawnMPUnits: + DisplayOrder: 1 PathFinder: ValidateOrder: DebugPauseState: diff --git a/mods/ts/rules/player.yaml b/mods/ts/rules/player.yaml index 75d30071d9..01a97350c4 100644 --- a/mods/ts/rules/player.yaml +++ b/mods/ts/rules/player.yaml @@ -44,7 +44,9 @@ Player: InsufficientFundsNotification: InsufficientFunds DeveloperMode: Enabled: true + DisplayOrder: 6 Shroud: + FogDisplayOrder: 3 FrozenActorLayer: BaseAttackNotifier: AllyNotification: OurAllyIsUnderAttack diff --git a/mods/ts/rules/world.yaml b/mods/ts/rules/world.yaml index c79654fb10..a110abd7b7 100644 --- a/mods/ts/rules/world.yaml +++ b/mods/ts/rules/world.yaml @@ -111,9 +111,15 @@ World: ResourceClaimLayer: WarheadDebugOverlay: MapCreeps: + Visible: False SpawnMapActors: MapBuildRadius: + AllyBuildRadiusDisplayOrder: 4 + BuildRadiusDisplayOrder: 5 MapOptions: + ShortGameDisplayOrder: 2 + TechLevelDisplayOrder: 2 + GameSpeedDisplayOrder: 3 CreateMPPlayers: MPStartUnits@MCV: Class: none @@ -170,6 +176,7 @@ World: OuterSupportRadius: 5 MPStartLocations: SpawnMPUnits: + DisplayOrder: 1 CrateSpawner: Minimum: 1 Maximum: 6 @@ -177,6 +184,7 @@ World: WaterChance: 0 ValidGround: Clear, Rough, Road, DirtRoad, Tiberium, BlueTiberium InitialSpawnDelay: 1500 + DisplayOrder: 1 PathFinder: ValidateOrder: DebugPauseState: