Add HotkeyReference.IsActivatedBy method.

This commit is contained in:
Paul Chote
2017-11-05 20:03:27 +00:00
committed by abcdefg30
parent c4237d6a1a
commit 811427adc4
14 changed files with 33 additions and 41 deletions

View File

@@ -287,14 +287,13 @@ namespace OpenRA.Mods.Common.Widgets
if (e.Event != KeyInputEvent.Down)
return false;
var hotkey = Hotkey.FromKeyInput(e);
if (hotkey == PreviousProductionTabKey.GetValue())
if (PreviousProductionTabKey.IsActivatedBy(e))
{
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", "ClickSound", null);
return SelectNextTab(true);
}
if (hotkey == NextProductionTabKey.GetValue())
if (NextProductionTabKey.IsActivatedBy(e))
{
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", "ClickSound", null);
return SelectNextTab(false);