diff --git a/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs index 81f7ec099f..b94453f502 100644 --- a/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs @@ -22,6 +22,9 @@ namespace OpenRA.Mods.Common.Widgets { public class WorldInteractionControllerWidget : Widget { + public readonly NamedHotkey SelectAllKey = new NamedHotkey(); + public readonly NamedHotkey SelectSameTypeKey = new NamedHotkey(); + protected readonly World World; readonly WorldRenderer worldRenderer; int2 dragStart, mousePos; @@ -242,7 +245,7 @@ namespace OpenRA.Mods.Common.Widgets { var key = Hotkey.FromKeyInput(e); - if (key == Game.Settings.Keys.SelectAllUnitsKey && !World.IsGameOver) + if (key == SelectAllKey.GetValue() && !World.IsGameOver) { // Select actors on the screen which belong to the current player var ownUnitsOnScreen = SelectActorsOnScreen(World, worldRenderer, null, player).SubsetWithHighestSelectionPriority().ToList(); @@ -259,7 +262,7 @@ namespace OpenRA.Mods.Common.Widgets World.Selection.Combine(World, ownUnitsOnScreen, false, false); } - else if (key == Game.Settings.Keys.SelectUnitsByTypeKey && !World.IsGameOver) + else if (key == SelectSameTypeKey.GetValue() && !World.IsGameOver) { if (!World.Selection.Actors.Any()) return false; diff --git a/mods/cnc/chrome/ingame.yaml b/mods/cnc/chrome/ingame.yaml index a33e6950df..b090acdfda 100644 --- a/mods/cnc/chrome/ingame.yaml +++ b/mods/cnc/chrome/ingame.yaml @@ -39,6 +39,8 @@ Container@INGAME_ROOT: WorldInteractionController@INTERACTION_CONTROLLER: Width: WINDOW_RIGHT Height: WINDOW_BOTTOM + SelectAllKey: SelectAllUnits + SelectSameTypeKey: SelectUnitsByType ViewportController: Width: WINDOW_RIGHT Height: WINDOW_BOTTOM diff --git a/mods/common/chrome/ingame.yaml b/mods/common/chrome/ingame.yaml index f4a7a1a73c..ba7ba30dc2 100644 --- a/mods/common/chrome/ingame.yaml +++ b/mods/common/chrome/ingame.yaml @@ -35,6 +35,8 @@ Container@INGAME_ROOT: WorldInteractionController@INTERACTION_CONTROLLER: Width: WINDOW_RIGHT Height: WINDOW_BOTTOM + SelectAllKey: SelectAllUnits + SelectSameTypeKey: SelectUnitsByType ViewportController: Width: WINDOW_RIGHT Height: WINDOW_BOTTOM