Move hardcoded production tab keys into yaml.

This commit is contained in:
Paul Chote
2017-07-23 22:32:33 +00:00
committed by reaperrr
parent f5e38a4e2c
commit 1180c5ddaa
2 changed files with 14 additions and 8 deletions

View File

@@ -68,7 +68,11 @@ namespace OpenRA.Mods.Common.Widgets
public readonly int TabWidth = 30;
public readonly int ArrowWidth = 20;
public Dictionary<string, ProductionTabGroup> Groups;
public readonly NamedHotkey PreviousProductionTabKey = new NamedHotkey();
public readonly NamedHotkey NextProductionTabKey = new NamedHotkey();
public readonly Dictionary<string, ProductionTabGroup> Groups;
int contentWidth = 0;
float listOffset = 0;
@@ -284,18 +288,18 @@ namespace OpenRA.Mods.Common.Widgets
return false;
var hotkey = Hotkey.FromKeyInput(e);
if (hotkey == Game.Settings.Keys.NextProductionTabKey)
{
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", "ClickSound", null);
return SelectNextTab(false);
}
else if (hotkey == Game.Settings.Keys.PreviousProductionTabKey)
if (hotkey == PreviousProductionTabKey.GetValue())
{
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", "ClickSound", null);
return SelectNextTab(true);
}
if (hotkey == NextProductionTabKey.GetValue())
{
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", "ClickSound", null);
return SelectNextTab(false);
}
return false;
}
}