new hotkey to center your view on the current selection

This commit is contained in:
Matthias Mailänder
2013-03-02 11:53:45 +01:00
parent 336076c248
commit c0a702a386
3 changed files with 21 additions and 7 deletions

View File

@@ -47,8 +47,11 @@ namespace OpenRA.Mods.RA.Widgets
if (e.KeyName == Game.Settings.Keys.CycleBaseKey)
return CycleBases();
if (e.KeyName == Game.Settings.Keys.GotoLastEventKey)
return GotoLastEvent();
if (e.KeyName == Game.Settings.Keys.ToLastEventKey)
return ToLastEvent();
if (e.KeyName == Game.Settings.Keys.ToSelectionKey)
return ToSelection();
if (e.KeyName == Game.Settings.Keys.SellKey)
return PerformSwitchToSellMode();
@@ -168,11 +171,11 @@ namespace OpenRA.Mods.RA.Widgets
next = bases.Select(b => b.Actor).First();
World.Selection.Combine(World, new Actor[] { next }, false, true);
Game.viewport.Center(World.Selection.Actors);
return true;
return ToSelection();
}
bool GotoLastEvent()
bool ToLastEvent()
{
if (World.LocalPlayer == null)
return true;
@@ -188,6 +191,12 @@ namespace OpenRA.Mods.RA.Widgets
return true;
}
bool ToSelection()
{
Game.viewport.Center(World.Selection.Actors);
return true;
}
bool PerformSwitchToSellMode()
{
World.ToggleInputMode<SellOrderGenerator>();