Expose default UI labels and tooltips to yaml.

This commit is contained in:
Paul Chote
2017-11-19 17:32:05 +00:00
committed by reaperrr
parent 99908c4d80
commit ea32c758eb
10 changed files with 123 additions and 43 deletions

View File

@@ -22,10 +22,12 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Internal id for this option.")]
public readonly string ID = null;
[Translate]
[FieldLoader.Require]
[Desc("Descriptive label for this option.")]
public readonly string Label = null;
[Translate]
[Desc("Tooltip description for this option.")]
public readonly string Description = null;
@@ -48,10 +50,8 @@ namespace OpenRA.Mods.Common.Traits
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(Ruleset rules)
{
yield return new LobbyOption(ID, Label, Description,
Visible, DisplayOrder,
new ReadOnlyDictionary<string, string>(Values),
Default, Locked);
yield return new LobbyOption(ID, Label, Description, Visible, DisplayOrder,
new ReadOnlyDictionary<string, string>(Values), Default, Locked);
}
public object Create(ActorInitializer init) { return new ScriptLobbyDropdown(this); }