double-tap 0-9: select and center the control group

This commit is contained in:
Matthias Mailänder
2013-03-02 15:51:35 +01:00
parent c0a702a386
commit 1083f8cf55
2 changed files with 3 additions and 3 deletions

View File

@@ -64,7 +64,7 @@ namespace OpenRA
Cache<int, List<Actor>> controlGroups = new Cache<int, List<Actor>>(_ => new List<Actor>());
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;

View File

@@ -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")