From 1083f8cf553235fe9ac9e51a337afda3bb0483fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 2 Mar 2013 15:51:35 +0100 Subject: [PATCH] double-tap 0-9: select and center the control group --- OpenRA.Game/Selection.cs | 4 ++-- OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Game/Selection.cs b/OpenRA.Game/Selection.cs index 34ffd57939..72c12ae85e 100644 --- a/OpenRA.Game/Selection.cs +++ b/OpenRA.Game/Selection.cs @@ -64,7 +64,7 @@ namespace OpenRA Cache> controlGroups = new Cache>(_ => new List()); - public void DoControlGroup(World world, int group, Modifiers mods) + public void DoControlGroup(World world, int group, Modifiers mods, int MultiTapCount) { var addModifier = Platform.CurrentPlatform == PlatformType.OSX ? Modifiers.Meta : Modifiers.Ctrl; if (mods.HasModifier(addModifier)) @@ -82,7 +82,7 @@ namespace OpenRA return; } - if (mods.HasModifier(Modifiers.Alt)) + if (mods.HasModifier(Modifiers.Alt) || MultiTapCount >= 2) { Game.viewport.Center(controlGroups[group]); return; diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index de7dc03c7b..fa3d6a95fc 100644 --- a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs @@ -171,7 +171,7 @@ namespace OpenRA.Widgets { if (e.KeyName.Length == 1 && char.IsDigit(e.KeyName[0])) { - world.Selection.DoControlGroup(world, e.KeyName[0] - '0', e.Modifiers); + world.Selection.DoControlGroup(world, e.KeyName[0] - '0', e.Modifiers, e.MultiTapCount); return true; } else if (e.KeyName == "pause" || e.KeyName == "f3")