Implement new production hotkeys. Fixes #3915, #4142, #4181.

This commit is contained in:
Paul Chote
2014-08-01 20:52:26 +12:00
parent 61b7e63e77
commit 43bd8a361e
7 changed files with 122 additions and 20 deletions

View File

@@ -305,6 +305,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var hotkeyHeader = hotkeyList.Get<ScrollItemWidget>("HEADER");
var globalTemplate = hotkeyList.Get("GLOBAL_TEMPLATE");
var unitTemplate = hotkeyList.Get("UNIT_TEMPLATE");
var productionTemplate = hotkeyList.Get("PRODUCTION_TEMPLATE");
hotkeyList.RemoveChildren();
// Game
@@ -376,6 +377,20 @@ namespace OpenRA.Mods.RA.Widgets.Logic
BindHotkeyPref(kv, ks, unitTemplate, hotkeyList);
}
// Production
{
var hotkeys = new Dictionary<string, string>();
for (var i = 1; i <= 24; i++)
hotkeys.Add("Production{0:D2}Key".F(i), "Slot {0}".F(i));
var header = ScrollItemWidget.Setup(hotkeyHeader, () => true, () => {});
header.Get<LabelWidget>("LABEL").GetText = () => "Production Commands";
hotkeyList.AddChild(header);
foreach (var kv in hotkeys)
BindHotkeyPref(kv, ks, productionTemplate, hotkeyList);
}
// Developer
{
var hotkeys = new Dictionary<string, string>()