Fixes the bug that selection voices are played twice when selecting groups
via 0-9 hotkeys. Problem was that the voice was played for both KeyUp and KeyDown events. Closes #8121.
This commit is contained in:
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var keyhandler = widget.Get<LogicKeyListenerWidget>("CONTROLGROUP_KEYHANDLER");
|
var keyhandler = widget.Get<LogicKeyListenerWidget>("CONTROLGROUP_KEYHANDLER");
|
||||||
keyhandler.OnKeyPress = e =>
|
keyhandler.OnKeyPress = e =>
|
||||||
{
|
{
|
||||||
if (e.Key >= Keycode.NUMBER_0 && e.Key <= Keycode.NUMBER_9)
|
if (e.Event == KeyInputEvent.Down && e.Key >= Keycode.NUMBER_0 && e.Key <= Keycode.NUMBER_9)
|
||||||
{
|
{
|
||||||
var group = (int)e.Key - (int)Keycode.NUMBER_0;
|
var group = (int)e.Key - (int)Keycode.NUMBER_0;
|
||||||
world.Selection.DoControlGroup(world, worldRenderer, group, e.Modifiers, e.MultiTapCount);
|
world.Selection.DoControlGroup(world, worldRenderer, group, e.Modifiers, e.MultiTapCount);
|
||||||
|
|||||||
Reference in New Issue
Block a user