Restore MODIFIER_OVERRIDES handling of unmodified attack move hotkey.

This commit is contained in:
Paul Chote
2020-01-03 21:52:13 +00:00
committed by abcdefg30
parent 8c2a2d2cb8
commit 524e8875d0

View File

@@ -209,9 +209,6 @@ namespace OpenRA.Mods.Common.Widgets
var noShiftButtons = new[] { guardButton, deployButton, attackMoveButton };
keyOverrides.AddHandler(e =>
{
if (e.Event != KeyInputEvent.Down)
return false;
// HACK: allow command buttons to be triggered if the shift (queue order modifier) key is held
if (e.Modifiers.HasModifier(Modifiers.Shift))
{
@@ -228,18 +225,15 @@ namespace OpenRA.Mods.Common.Widgets
}
}
// HACK: allow attack move to be triggered if the ctrl (assault move modifier)
// or shift (queue order modifier) keys are pressed
if (e.Modifiers.HasModifier(Modifiers.Ctrl))
{
var eNoMods = e;
eNoMods.Modifiers &= ~(Modifiers.Ctrl | Modifiers.Shift);
// HACK: Attack move can be triggered if the ctrl (assault move modifier)
// or shift (queue order modifier) keys are pressed, on both key down and key up
var eNoMods = e;
eNoMods.Modifiers &= ~(Modifiers.Ctrl | Modifiers.Shift);
if (attackMoveButton != null && !attackMoveDisabled && attackMoveButton.Key.IsActivatedBy(eNoMods))
{
attackMoveButton.OnKeyPress(e);
return true;
}
if (attackMoveButton != null && !attackMoveDisabled && attackMoveButton.Key.IsActivatedBy(eNoMods))
{
attackMoveButton.OnKeyPress(e);
return true;
}
return false;