diff --git a/OpenRA.Game/Orders/IOrderGenerator.cs b/OpenRA.Game/Orders/IOrderGenerator.cs index 9fad38b603..a92fe9d20e 100644 --- a/OpenRA.Game/Orders/IOrderGenerator.cs +++ b/OpenRA.Game/Orders/IOrderGenerator.cs @@ -22,5 +22,6 @@ namespace OpenRA IEnumerable RenderAboveShroud(WorldRenderer wr, World world); string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi); void Deactivate(); + bool HandleKeyPress(KeyInput e); } } diff --git a/OpenRA.Game/Orders/UnitOrderGenerator.cs b/OpenRA.Game/Orders/UnitOrderGenerator.cs index f141f47c40..9e11f0802c 100644 --- a/OpenRA.Game/Orders/UnitOrderGenerator.cs +++ b/OpenRA.Game/Orders/UnitOrderGenerator.cs @@ -86,6 +86,8 @@ namespace OpenRA.Orders public void Deactivate() { } + bool IOrderGenerator.HandleKeyPress(KeyInput e) { return false; } + // Used for classic mouse orders, determines whether or not action at xy is move or select public virtual bool InputOverridesSelection(WorldRenderer wr, World world, int2 xy, MouseInput mi) { diff --git a/OpenRA.Mods.Common/Orders/OrderGenerator.cs b/OpenRA.Mods.Common/Orders/OrderGenerator.cs index af90a40b2a..aab5e7b617 100644 --- a/OpenRA.Mods.Common/Orders/OrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/OrderGenerator.cs @@ -30,6 +30,7 @@ namespace OpenRA.Mods.Common.Orders IEnumerable IOrderGenerator.RenderAboveShroud(WorldRenderer wr, World world) { return RenderAboveShroud(wr, world); } string IOrderGenerator.GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) { return GetCursor(world, cell, worldPixel, mi); } void IOrderGenerator.Deactivate() { } + bool IOrderGenerator.HandleKeyPress(KeyInput e) { return false; } protected abstract void Tick(World world); protected abstract IEnumerable Render(WorldRenderer wr, World world); diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/SelectDirectionalTarget.cs b/OpenRA.Mods.Common/Traits/SupportPowers/SelectDirectionalTarget.cs index 59b3ef98b8..556876eba8 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/SelectDirectionalTarget.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/SelectDirectionalTarget.cs @@ -144,6 +144,8 @@ namespace OpenRA.Mods.Common.Traits string IOrderGenerator.GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) { return cursor; } + bool IOrderGenerator.HandleKeyPress(KeyInput e) { return false; } + void IOrderGenerator.Deactivate() { if (activated) diff --git a/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs b/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs index e70021c884..fbd4c05405 100644 --- a/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs @@ -495,7 +495,7 @@ namespace OpenRA.Mods.Common.Widgets } } - return false; + return world.OrderGenerator.HandleKeyPress(e); } ScrollDirection CheckForDirections()