move pixel doubling and health bar hotkeys to shared widget

closes #5572
This commit is contained in:
Matthias Mailänder
2014-06-07 12:26:58 +02:00
parent f06cbfa5fe
commit 3a1c41c8ce
2 changed files with 25 additions and 23 deletions

View File

@@ -62,11 +62,6 @@ namespace OpenRA.Mods.RA.Widgets
if (key == ks.ToSelectionKey)
return ToSelection();
if (key == ks.ToggleStatusBarsKey)
return ToggleStatusBars();
if (key == ks.TogglePixelDoubleKey)
return TogglePixelDouble();
// Put all functions that aren't unit-specific before this line!
if (!world.Selection.Actors.Any())
@@ -135,7 +130,7 @@ namespace OpenRA.Mods.RA.Widgets
bool PerformDeploy()
{
/* hack: multiple orders here */
// HACK: multiple orders here
PerformKeyboardOrderOnSelection(a => new Order("ReturnToBase", a, false));
PerformKeyboardOrderOnSelection(a => new Order("DeployTransform", a, false));
PerformKeyboardOrderOnSelection(a => new Order("Unload", a, false));
@@ -250,18 +245,5 @@ namespace OpenRA.Mods.RA.Widgets
worldRenderer.Viewport.Center(world.Selection.Actors);
return true;
}
static bool ToggleStatusBars()
{
Game.Settings.Game.AlwaysShowStatusBars ^= true;
return true;
}
bool TogglePixelDouble()
{
Game.Settings.Graphics.PixelDouble ^= true;
worldRenderer.Viewport.Zoom = Game.Settings.Graphics.PixelDouble ? 2 : 1;
return true;
}
}
}