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