Add additional metadata to lobby options.

This commit is contained in:
Paul Chote
2017-12-09 20:17:39 +00:00
committed by reaperrr
parent b71b2ad523
commit 97cdce7448
19 changed files with 171 additions and 18 deletions

View File

@@ -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<string, string>(startingCash), DefaultCash.ToString(), DefaultCashLocked);
yield return new LobbyOption("startingcash", "Starting Cash", "Change the amount of cash that players start with",
DefaultCashVisible, DefaultCashDisplayOrder,
new ReadOnlyDictionary<string, string>(startingCash),
DefaultCash.ToString(), DefaultCashLocked);
}
public object Create(ActorInitializer init) { return new PlayerResources(init.Self, this); }

View File

@@ -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<LobbyOption> 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); }