Add input style to match other, non-C&C, RTS games

Uses left-click for targeted orders (attack move, guard, selecting movement types from the command bar, etc.) and right-click for contextual ones. Works like basically all non-C&C games

Removed GameSettings.UseClassicMouseStyle, as it is replaced by MouseControlStyle


Changed Minelayer and Chronotank teleport to UnitOrderGenerator

Fixes bug with Modern controls issuing a move order cancelling a mine field order

Better organizes all unit orders into a single order generator base class, rather than having their logic spread across multiple base classes, which required some hacks to get the control logic to match
This commit is contained in:
Dominic Renaud
2025-11-10 22:12:48 -08:00
committed by Paul Chote
parent c47ebfbb52
commit f8eefe310c
22 changed files with 530 additions and 157 deletions

View File

@@ -20,6 +20,7 @@ using OpenRA.Primitives;
namespace OpenRA
{
public enum MouseControlStyle { Classic, Modern, OtherRTS }
public enum MouseScrollType { Disabled, Standard, Inverted, Joystick }
public enum StatusBarsType { Standard, DamageShow, AlwaysShow }
public enum TargetLinesType { Disabled, Manual, Automatic }
@@ -319,6 +320,7 @@ namespace OpenRA
public int ViewportEdgeScrollMargin = 5;
public bool LockMouseWindow = false;
public MouseControlStyle MouseControlStyle = MouseControlStyle.Modern;
public MouseScrollType MouseScroll = MouseScrollType.Joystick;
public float ViewportEdgeScrollStep = 30f;
public float UIScrollSpeed = 50f;
@@ -326,7 +328,6 @@ namespace OpenRA
public int SelectionDeadzone = 24;
public int MouseScrollDeadzone = 8;
public bool UseClassicMouseStyle = false;
public bool UseAlternateScrollButton = false;
public bool HideReplayChat = false;
@@ -361,8 +362,9 @@ namespace OpenRA
switch (actionType)
{
case MouseActionType.ConfirmOrder:
return MouseControlStyle == MouseControlStyle.Modern ? MouseButton.Right : MouseButton.Left;
case MouseActionType.Contextual:
return UseClassicMouseStyle ? MouseButton.Left : MouseButton.Right;
return MouseControlStyle == MouseControlStyle.Classic ? MouseButton.Left : MouseButton.Right;
default: return MouseButton.Left;
}
}