Merge pull request #4240 from Mailaender/select-all-hotkey

Added the Select All units on screen hotkey
This commit is contained in:
Paul Chote
2013-12-06 02:33:57 -08:00
4 changed files with 17 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ NEW:
Re-added move flashes.
Added a setting to always display unit status bars (can also be toggled by hotkey).
Added a setting for team health bar colors.
Added a new hotkey to select all units on screen (default: CTRL + A).
Asset Browser:
Fixed crashes when trying to load invalid filenames or sprites with just 1 frame.
Added support for all sprite types.

View File

@@ -148,21 +148,23 @@ namespace OpenRA.GameRules
public Hotkey CycleBaseKey = new Hotkey(Keycode.BACKSPACE, Modifiers.None);
public Hotkey ToLastEventKey = new Hotkey(Keycode.SPACE, Modifiers.None);
public Hotkey ToSelectionKey = new Hotkey(Keycode.HOME, Modifiers.None);
public Hotkey ToggleStatusBarsKey = new Hotkey(Keycode.INSERT, Modifiers.None);
public Hotkey SelectAllUnitsKey = new Hotkey(Keycode.A, Modifiers.Ctrl);
public Hotkey PauseKey = new Hotkey(Keycode.F9, Modifiers.None);
public Hotkey SellKey = new Hotkey(Keycode.F10, Modifiers.None);
public Hotkey PowerDownKey = new Hotkey(Keycode.F11, Modifiers.None);
public Hotkey RepairKey = new Hotkey(Keycode.F12, Modifiers.None);
public Hotkey CycleTabsKey = new Hotkey(Keycode.TAB, Modifiers.None);
public Hotkey ToggleStatusBarsKey = new Hotkey(Keycode.INSERT, Modifiers.None);
public Hotkey AttackMoveKey = new Hotkey(Keycode.A, Modifiers.None);
public Hotkey StopKey = new Hotkey(Keycode.S, Modifiers.None);
public Hotkey ScatterKey = new Hotkey(Keycode.X, Modifiers.None);
public Hotkey DeployKey = new Hotkey(Keycode.F, Modifiers.None);
public Hotkey StanceCycleKey = new Hotkey(Keycode.Z, Modifiers.None);
public Hotkey GuardKey = new Hotkey(Keycode.D, Modifiers.None);
public Hotkey CycleTabsKey = new Hotkey(Keycode.TAB, Modifiers.None);
}
public class IrcSettings

View File

@@ -202,6 +202,12 @@ namespace OpenRA.Widgets
}
else if (Hotkey.FromKeyInput(e) == Game.Settings.Keys.PauseKey && World.LocalPlayer != null) // Disable pausing for spectators
World.SetPauseState(!World.Paused);
else if (Hotkey.FromKeyInput(e) == Game.Settings.Keys.SelectAllUnitsKey)
{
var ownUnitsOnScreen = SelectActorsInBox(World, worldRenderer.Viewport.TopLeft, worldRenderer.Viewport.BottomRight,
a => a.Owner == World.RenderPlayer);
World.Selection.Combine(World, ownUnitsOnScreen, false, false);
}
}
return false;

View File

@@ -239,14 +239,18 @@ namespace OpenRA.Mods.RA.Widgets.Logic
// TODO: Extract these to a yaml file
var specialHotkeys = new Dictionary<string, string>()
{
{ "PauseKey", "Pause / Unpause" },
{ "CycleBaseKey", "Jump to base" },
{ "ToLastEventKey", "Jump to last radar event" },
{ "ToSelectionKey", "Jump to selection" },
{ "SelectAllUnitsKey", "Select all units on screen" },
{ "PauseKey", "Pause / Unpause" },
{ "SellKey", "Sell mode" },
{ "PowerDownKey", "Power-down mode" },
{ "RepairKey", "Repair mode" },
{ "CycleTabsKey", "Cycle production tabs" },
{ "ToggleStatusBarsKey", "Toggle status bars" }
};