From f8eefe310c8a2f96d05494a0ff38a8085f8a9ebe Mon Sep 17 00:00:00 2001 From: Dominic Renaud Date: Mon, 10 Nov 2025 22:12:48 -0800 Subject: [PATCH] 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 --- OpenRA.Game/Settings.cs | 6 +- OpenRA.Mods.Cnc/Traits/PortableChrono.cs | 18 +-- .../Orders/ForceModifiersOrderGenerator.cs | 6 +- .../Orders/GuardOrderGenerator.cs | 8 +- OpenRA.Mods.Common/Orders/OrderGenerator.cs | 4 +- .../Orders/PlaceBuildingOrderGenerator.cs | 2 +- .../Orders/UnitOrderGenerator.cs | 15 ++- OpenRA.Mods.Common/Traits/AttackMove.cs | 8 +- OpenRA.Mods.Common/Traits/Minelayer.cs | 16 +-- OpenRA.Mods.Common/Traits/World/Selection.cs | 1 - .../Widgets/Logic/IntroductionPromptLogic.cs | 43 +++++-- .../Logic/Settings/InputSettingsLogic.cs | 54 ++++---- OpenRA.Mods.Common/Widgets/RadarWidget.cs | 18 ++- .../Widgets/ViewportControllerWidget.cs | 2 +- .../WorldInteractionControllerWidget.cs | 19 +-- mods/cnc/chrome/mainmenu-prompts.yaml | 108 +++++++++++++--- mods/cnc/chrome/settings-input.yaml | 119 ++++++++++++++---- mods/cnc/fluent/chrome.ftl | 12 ++ mods/common/chrome/mainmenu-prompts.yaml | 108 +++++++++++++--- mods/common/chrome/settings-input.yaml | 107 +++++++++++++--- mods/common/fluent/chrome.ftl | 12 ++ mods/common/fluent/common.ftl | 1 + 22 files changed, 530 insertions(+), 157 deletions(-) diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index 332983e5d9..144ebe346e 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -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; } } diff --git a/OpenRA.Mods.Cnc/Traits/PortableChrono.cs b/OpenRA.Mods.Cnc/Traits/PortableChrono.cs index e2f67dd796..226a750078 100644 --- a/OpenRA.Mods.Cnc/Traits/PortableChrono.cs +++ b/OpenRA.Mods.Cnc/Traits/PortableChrono.cs @@ -210,7 +210,7 @@ namespace OpenRA.Mods.Cnc.Traits } } - sealed class PortableChronoOrderGenerator : OrderGenerator + sealed class PortableChronoOrderGenerator : UnitOrderGenerator { readonly Actor self; readonly PortableChrono portableChrono; @@ -218,8 +218,10 @@ namespace OpenRA.Mods.Cnc.Traits protected override MouseActionType ActionType => MouseActionType.ConfirmOrder; + public override bool ClearSelectionOnLeftClick => false; + public PortableChronoOrderGenerator(Actor self, PortableChrono portableChrono) - : base(self.World, false) + : base(self.World) { this.self = self; this.portableChrono = portableChrono; @@ -236,13 +238,13 @@ namespace OpenRA.Mods.Cnc.Traits } } - protected override void SelectionChanged(World world, IEnumerable selected) + public override void SelectionChanged(World world, IEnumerable selected) { if (!selected.Contains(self)) world.CancelInputMode(); } - protected override void Tick(World world) + public override void Tick(World world) { if (portableChrono.IsTraitDisabled || portableChrono.IsTraitPaused) { @@ -250,11 +252,11 @@ namespace OpenRA.Mods.Cnc.Traits } } - protected override IEnumerable Render(WorldRenderer wr, World world) { yield break; } + public override IEnumerable Render(WorldRenderer wr, World world) { yield break; } - protected override IEnumerable RenderAboveShroud(WorldRenderer wr, World world) { yield break; } + public override IEnumerable RenderAboveShroud(WorldRenderer wr, World world) { yield break; } - protected override IEnumerable RenderAnnotations(WorldRenderer wr, World world) + public override IEnumerable RenderAnnotations(WorldRenderer wr, World world) { if (!self.IsInWorld || self.Owner != self.World.LocalPlayer) yield break; @@ -272,7 +274,7 @@ namespace OpenRA.Mods.Cnc.Traits info.CircleBorderWidth); } - protected override string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) + public override string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) { if (self.IsInWorld && self.Location != cell && portableChrono.CanTeleport && self.Owner.Shroud.IsExplored(cell)) diff --git a/OpenRA.Mods.Common/Orders/ForceModifiersOrderGenerator.cs b/OpenRA.Mods.Common/Orders/ForceModifiersOrderGenerator.cs index f86b6bf2aa..1e51faf68c 100644 --- a/OpenRA.Mods.Common/Orders/ForceModifiersOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/ForceModifiersOrderGenerator.cs @@ -26,15 +26,17 @@ namespace OpenRA.Mods.Common.Orders this.cancelOnFirstUse = cancelOnFirstUse; } - public override IEnumerable Order(World world, CPos cell, int2 worldPixel, MouseInput mi) + protected override IEnumerable OrderInner(World world, CPos cell, int2 worldPixel, MouseInput mi) { mi.Modifiers |= Modifiers; if ((cancelOnFirstUse && !mi.Modifiers.HasModifier(Modifiers.Shift)) || mi.Button == CancelButton) world.CancelInputMode(); - return base.Order(world, cell, worldPixel, mi); + return base.OrderInner(world, cell, worldPixel, mi); } + public override bool ClearSelectionOnLeftClick => false; + public override string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) { mi.Modifiers |= Modifiers; diff --git a/OpenRA.Mods.Common/Orders/GuardOrderGenerator.cs b/OpenRA.Mods.Common/Orders/GuardOrderGenerator.cs index af16ade443..85ecdda315 100644 --- a/OpenRA.Mods.Common/Orders/GuardOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/GuardOrderGenerator.cs @@ -31,14 +31,8 @@ namespace OpenRA.Mods.Common.Orders this.subjects = subjects; } - public override IEnumerable Order(World world, CPos cell, int2 worldPixel, MouseInput mi) + protected override IEnumerable OrderInner(World world, CPos cell, int2 worldPixel, MouseInput mi) { - if (mi.Button != ActionButton) - { - world.CancelInputMode(); - yield break; - } - var target = FriendlyGuardableUnits(world, mi).FirstOrDefault(); if (target == null) yield break; diff --git a/OpenRA.Mods.Common/Orders/OrderGenerator.cs b/OpenRA.Mods.Common/Orders/OrderGenerator.cs index 9265a3bb63..a849e3dc45 100644 --- a/OpenRA.Mods.Common/Orders/OrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/OrderGenerator.cs @@ -20,10 +20,10 @@ namespace OpenRA.Mods.Common.Orders protected abstract MouseActionType ActionType { get; } readonly GameSettings gameSettings; - protected OrderGenerator(World world, bool classicClearSelection = true) + protected OrderGenerator(World world) { gameSettings = Game.Settings.Game; - if (classicClearSelection && gameSettings.UseClassicMouseStyle) + if (gameSettings.MouseControlStyle == MouseControlStyle.Classic) world.Selection.Clear(); } diff --git a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs index 7ebba10871..c45aa37e8e 100644 --- a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs @@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.Orders viewport = worldRenderer.Viewport; gameSettings = Game.Settings.Game; - if (gameSettings.UseClassicMouseStyle) + if (gameSettings.MouseControlStyle == MouseControlStyle.Classic) world.Selection.Clear(); var variants = new List() diff --git a/OpenRA.Mods.Common/Orders/UnitOrderGenerator.cs b/OpenRA.Mods.Common/Orders/UnitOrderGenerator.cs index 0a216a80b0..ad0a6e626d 100644 --- a/OpenRA.Mods.Common/Orders/UnitOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/UnitOrderGenerator.cs @@ -53,6 +53,16 @@ namespace OpenRA.Mods.Common.Orders } public virtual IEnumerable Order(World world, CPos cell, int2 worldPixel, MouseInput mi) + { + if (mi.Button == ActionButton) + return OrderInner(world, cell, worldPixel, mi); + if (mi.Button == CancelButton) + world.CancelInputMode(); + + return []; + } + + protected virtual IEnumerable OrderInner(World world, CPos cell, int2 worldPixel, MouseInput mi) { var target = TargetForInput(world, cell, worldPixel, mi); var orders = world.Selection.Actors @@ -82,7 +92,7 @@ namespace OpenRA.Mods.Common.Orders var target = TargetForInput(world, cell, worldPixel, mi); bool useSelect; - if (gameSettings.UseClassicMouseStyle && !InputOverridesSelection(world, worldPixel, mi)) + if (gameSettings.MouseControlStyle == MouseControlStyle.Classic && !InputOverridesSelection(world, worldPixel, mi)) useSelect = target.Type == TargetType.Actor && target.Actor.Info.HasTraitInfo(); else { @@ -149,9 +159,6 @@ namespace OpenRA.Mods.Common.Orders /// protected UnitOrderResult OrderForUnit(Actor self, Target target, CPos xy, MouseInput mi) { - if (mi.Button != ActionButton) - return null; - if (self.Owner != self.World.LocalPlayer) return null; diff --git a/OpenRA.Mods.Common/Traits/AttackMove.cs b/OpenRA.Mods.Common/Traits/AttackMove.cs index b06e1e72eb..8c31a62b8f 100644 --- a/OpenRA.Mods.Common/Traits/AttackMove.cs +++ b/OpenRA.Mods.Common/Traits/AttackMove.cs @@ -115,14 +115,8 @@ namespace OpenRA.Mods.Common.Traits .ToArray(); } - public override IEnumerable Order(World world, CPos cell, int2 worldPixel, MouseInput mi) + protected override IEnumerable OrderInner(World world, CPos cell, int2 worldPixel, MouseInput mi) { - if (mi.Button != ActionButton) - { - world.CancelInputMode(); - yield break; - } - var queued = mi.Modifiers.HasModifier(Modifiers.Shift); if (!queued) world.CancelInputMode(); diff --git a/OpenRA.Mods.Common/Traits/Minelayer.cs b/OpenRA.Mods.Common/Traits/Minelayer.cs index 1df72ecb01..18f7732e71 100644 --- a/OpenRA.Mods.Common/Traits/Minelayer.cs +++ b/OpenRA.Mods.Common/Traits/Minelayer.cs @@ -218,9 +218,10 @@ namespace OpenRA.Mods.Common.Traits return Info.TerrainTypes.Contains(terrainType); } - sealed class MinefieldOrderGenerator : OrderGenerator + sealed class MinefieldOrderGenerator : UnitOrderGenerator { protected override MouseActionType ActionType => MouseActionType.ConfirmOrder; + public override bool ClearSelectionOnLeftClick => false; readonly List minelayers; readonly Minelayer minelayer; @@ -231,7 +232,7 @@ namespace OpenRA.Mods.Common.Traits readonly string cursor; public MinefieldOrderGenerator(Actor a, CPos xy, bool queued) - : base(a.World, false) + : base(a.World) { minelayers = [a]; minefieldStart = xy; @@ -290,11 +291,12 @@ namespace OpenRA.Mods.Common.Traits protected override IEnumerable OrderInner(World world, CPos cell, int2 worldPixel, MouseInput mi) { world.CancelInputMode(); + foreach (var minelayer in minelayers) yield return new Order("PlaceMinefield", minelayer, Target.FromCell(world, cell), queued) { ExtraLocation = minefieldStart }; } - protected override void SelectionChanged(World world, IEnumerable selected) + public override void SelectionChanged(World world, IEnumerable selected) { minelayers.Clear(); minelayers.AddRange(selected.Where(s => !s.IsDead && s.Info.HasTraitInfo())); @@ -302,8 +304,8 @@ namespace OpenRA.Mods.Common.Traits world.CancelInputMode(); } - protected override IEnumerable Render(WorldRenderer wr, World world) { yield break; } - protected override IEnumerable RenderAboveShroud(WorldRenderer wr, World world) + public override IEnumerable Render(WorldRenderer wr, World world) { yield break; } + public override IEnumerable RenderAboveShroud(WorldRenderer wr, World world) { var minelayer = minelayers.FirstOrDefault(m => m.IsInWorld && !m.IsDead); if (minelayer == null) @@ -347,9 +349,9 @@ namespace OpenRA.Mods.Common.Traits } } - protected override IEnumerable RenderAnnotations(WorldRenderer wr, World world) { yield break; } + public override IEnumerable RenderAnnotations(WorldRenderer wr, World world) { yield break; } - protected override string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) + public override string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) { return cursor; } diff --git a/OpenRA.Mods.Common/Traits/World/Selection.cs b/OpenRA.Mods.Common/Traits/World/Selection.cs index fd50229e0a..0740d586ba 100644 --- a/OpenRA.Mods.Common/Traits/World/Selection.cs +++ b/OpenRA.Mods.Common/Traits/World/Selection.cs @@ -130,7 +130,6 @@ namespace OpenRA.Mods.Common.Traits return; // Play the selection voice from one of the selected actors - // TODO: This probably should only be considering the newly selected actors foreach (var actor in actors) { if (actor.Owner != world.LocalPlayer || !actor.IsInWorld) diff --git a/OpenRA.Mods.Common/Widgets/Logic/IntroductionPromptLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/IntroductionPromptLogic.cs index c797d59a73..7f6cb08922 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/IntroductionPromptLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/IntroductionPromptLogic.cs @@ -10,6 +10,7 @@ #endregion using System; +using System.Collections.Generic; using OpenRA.Graphics; using OpenRA.Mods.Common.Traits; using OpenRA.Primitives; @@ -20,7 +21,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class IntroductionPromptLogic : ChromeLogic { // Increment the version number when adding new stats - const int IntroductionVersion = 1; + const int IntroductionVersion = 2; [FluentReference] const string Classic = "options-control-scheme.classic"; @@ -28,8 +29,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic [FluentReference] const string Modern = "options-control-scheme.modern"; - readonly string classic; - readonly string modern; + [FluentReference] + const string OtherRTS = "options-control-scheme.otherrts"; public static bool ShouldShowPrompt() { @@ -43,8 +44,23 @@ namespace OpenRA.Mods.Common.Widgets.Logic var graphicSettings = modData.GetSettings(); var gameSettings = modData.GetSettings(); - classic = FluentProvider.GetMessage(Classic); - modern = FluentProvider.GetMessage(Modern); + var controlTypes = new Dictionary + { + { MouseControlStyle.Classic, FluentProvider.GetMessage(Classic) }, + { MouseControlStyle.Modern, FluentProvider.GetMessage(Modern) }, + { MouseControlStyle.OtherRTS, FluentProvider.GetMessage(OtherRTS) }, + }; + + if (gameSettings.IntroductionPromptVersion < 2) + { + // UseClassicMouseStyle boolean was replaced by MouseControlStyle enum to support additional control styles + var classicMouseStyleNode = gameSettings.Yaml.NodeWithKeyOrDefault("UseClassicMouseStyle"); + if (classicMouseStyleNode != null) + { + var useClassicMouseStyle = FieldLoader.GetValue("UseClassicMouseStyle", classicMouseStyleNode.Value.Value); + gameSettings.MouseControlStyle = useClassicMouseStyle ? MouseControlStyle.Classic : MouseControlStyle.Modern; + } + } var escPressed = false; var nameTextfield = widget.Get("PLAYERNAME"); @@ -82,22 +98,25 @@ namespace OpenRA.Mods.Common.Widgets.Logic }; var mouseControlDescClassic = widget.Get("MOUSE_CONTROL_DESC_CLASSIC"); - mouseControlDescClassic.IsVisible = () => gameSettings.UseClassicMouseStyle; + mouseControlDescClassic.IsVisible = () => gameSettings.MouseControlStyle == MouseControlStyle.Classic; var mouseControlDescModern = widget.Get("MOUSE_CONTROL_DESC_MODERN"); - mouseControlDescModern.IsVisible = () => !gameSettings.UseClassicMouseStyle; + mouseControlDescModern.IsVisible = () => gameSettings.MouseControlStyle == MouseControlStyle.Modern; + + var mouseControlDescOtherRTS = widget.Get("MOUSE_CONTROL_DESC_OTHERRTS"); + mouseControlDescOtherRTS.IsVisible = () => gameSettings.MouseControlStyle == MouseControlStyle.OtherRTS; var mouseControlDropdown = widget.Get("MOUSE_CONTROL_DROPDOWN"); - mouseControlDropdown.OnMouseDown = _ => InputSettingsLogic.ShowMouseControlDropdown(mouseControlDropdown, gameSettings); - mouseControlDropdown.GetText = () => gameSettings.UseClassicMouseStyle ? classic : modern; + mouseControlDropdown.OnMouseDown = _ => InputSettingsLogic.ShowMouseControlDropdown(mouseControlDropdown, controlTypes, gameSettings); + mouseControlDropdown.GetText = () => controlTypes[gameSettings.MouseControlStyle]; - foreach (var container in new[] { mouseControlDescClassic, mouseControlDescModern }) + foreach (var container in new[] { mouseControlDescClassic, mouseControlDescModern, mouseControlDescOtherRTS }) { var classicScrollRight = container.Get("DESC_SCROLL_RIGHT"); - classicScrollRight.IsVisible = () => gameSettings.UseClassicMouseStyle ^ gameSettings.UseAlternateScrollButton; + classicScrollRight.IsVisible = () => (gameSettings.MouseControlStyle == MouseControlStyle.Classic) ^ gameSettings.UseAlternateScrollButton; var classicScrollMiddle = container.Get("DESC_SCROLL_MIDDLE"); - classicScrollMiddle.IsVisible = () => !gameSettings.UseClassicMouseStyle ^ gameSettings.UseAlternateScrollButton; + classicScrollMiddle.IsVisible = () => (gameSettings.MouseControlStyle != MouseControlStyle.Classic) ^ gameSettings.UseAlternateScrollButton; var zoomDesc = container.Get("DESC_ZOOM"); zoomDesc.IsVisible = () => gameSettings.ZoomModifier == Modifiers.None; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Settings/InputSettingsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Settings/InputSettingsLogic.cs index 13eebc1fbc..94857bfefc 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Settings/InputSettingsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Settings/InputSettingsLogic.cs @@ -24,6 +24,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic [FluentReference] const string Modern = "options-control-scheme.modern"; + [FluentReference] + const string OtherRTS = "options-control-scheme.otherrts"; + [FluentReference] const string Disabled = "options-mouse-scroll-type.disabled"; @@ -36,15 +39,19 @@ namespace OpenRA.Mods.Common.Widgets.Logic [FluentReference] const string Joystick = "options-mouse-scroll-type.joystick"; - readonly string classic; - readonly string modern; readonly GameSettings gameSettings; + readonly Dictionary controlTypes; + [ObjectCreator.UseCtor] public InputSettingsLogic(ModData modData, SettingsLogic settingsLogic, string panelID, string label) { - classic = FluentProvider.GetMessage(Classic); - modern = FluentProvider.GetMessage(Modern); + controlTypes = new Dictionary + { + { MouseControlStyle.Classic, FluentProvider.GetMessage(Classic) }, + { MouseControlStyle.Modern, FluentProvider.GetMessage(Modern) }, + { MouseControlStyle.OtherRTS, FluentProvider.GetMessage(OtherRTS) }, + }; gameSettings = modData.GetSettings(); settingsLogic.RegisterSettingsPanel(panelID, label, InitPanel, ResetPanel); @@ -62,8 +69,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic SettingsUtils.BindSliderPref(panel, "UI_SCROLLSPEED_SLIDER", gameSettings, "UIScrollSpeed"); var mouseControlDropdown = panel.Get("MOUSE_CONTROL_DROPDOWN"); - mouseControlDropdown.OnMouseDown = _ => ShowMouseControlDropdown(mouseControlDropdown, gameSettings); - mouseControlDropdown.GetText = () => gameSettings.UseClassicMouseStyle ? classic : modern; + mouseControlDropdown.OnMouseDown = _ => ShowMouseControlDropdown(mouseControlDropdown, controlTypes, gameSettings); + mouseControlDropdown.GetText = () => controlTypes[gameSettings.MouseControlStyle]; var mouseScrollDropdown = panel.Get("MOUSE_SCROLL_TYPE_DROPDOWN"); mouseScrollDropdown.OnMouseDown = _ => ShowMouseScrollDropdown(mouseScrollDropdown, gameSettings); @@ -74,18 +81,21 @@ namespace OpenRA.Mods.Common.Widgets.Logic #pragma warning restore IDE0200 var mouseControlDescClassic = panel.Get("MOUSE_CONTROL_DESC_CLASSIC"); - mouseControlDescClassic.IsVisible = () => gameSettings.UseClassicMouseStyle; + mouseControlDescClassic.IsVisible = () => gameSettings.MouseControlStyle == MouseControlStyle.Classic; var mouseControlDescModern = panel.Get("MOUSE_CONTROL_DESC_MODERN"); - mouseControlDescModern.IsVisible = () => !gameSettings.UseClassicMouseStyle; + mouseControlDescModern.IsVisible = () => gameSettings.MouseControlStyle == MouseControlStyle.Modern; - foreach (var container in new[] { mouseControlDescClassic, mouseControlDescModern }) + var mouseControlDescOtherRTS = panel.Get("MOUSE_CONTROL_DESC_OTHERRTS"); + mouseControlDescOtherRTS.IsVisible = () => gameSettings.MouseControlStyle == MouseControlStyle.OtherRTS; + + foreach (var container in new[] { mouseControlDescClassic, mouseControlDescModern, mouseControlDescOtherRTS }) { var classicScrollRight = container.Get("DESC_SCROLL_RIGHT"); - classicScrollRight.IsVisible = () => gameSettings.UseClassicMouseStyle ^ gameSettings.UseAlternateScrollButton; + classicScrollRight.IsVisible = () => (gameSettings.MouseControlStyle == MouseControlStyle.Classic) ^ gameSettings.UseAlternateScrollButton; var classicScrollMiddle = container.Get("DESC_SCROLL_MIDDLE"); - classicScrollMiddle.IsVisible = () => !gameSettings.UseClassicMouseStyle ^ gameSettings.UseAlternateScrollButton; + classicScrollMiddle.IsVisible = () => (gameSettings.MouseControlStyle != MouseControlStyle.Classic) ^ gameSettings.UseAlternateScrollButton; var zoomDesc = container.Get("DESC_ZOOM"); zoomDesc.IsVisible = () => gameSettings.ZoomModifier == Modifiers.None; @@ -133,7 +143,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic return () => { - gameSettings.UseClassicMouseStyle = defaultGameSettings.UseClassicMouseStyle; + gameSettings.MouseControlStyle = defaultGameSettings.MouseControlStyle; gameSettings.MouseScroll = defaultGameSettings.MouseScroll; gameSettings.UseAlternateScrollButton = defaultGameSettings.UseAlternateScrollButton; gameSettings.LockMouseWindow = defaultGameSettings.LockMouseWindow; @@ -150,24 +160,20 @@ namespace OpenRA.Mods.Common.Widgets.Logic }; } - public static void ShowMouseControlDropdown(DropDownButtonWidget dropdown, GameSettings gameSettings) + public static void ShowMouseControlDropdown(DropDownButtonWidget dropdown, Dictionary controlTypes, GameSettings gameSettings) { - var options = new Dictionary() - { - { FluentProvider.GetMessage(Classic), true }, - { FluentProvider.GetMessage(Modern), false }, - }; - - ScrollItemWidget SetupItem(string o, ScrollItemWidget itemTemplate) + ScrollItemWidget SetupItem(MouseControlStyle o, ScrollItemWidget itemTemplate) { var item = ScrollItemWidget.Setup(itemTemplate, - () => gameSettings.UseClassicMouseStyle == options[o], - () => gameSettings.UseClassicMouseStyle = options[o]); - item.Get("LABEL").GetText = () => o; + () => gameSettings.MouseControlStyle == o, + () => gameSettings.MouseControlStyle = o); + + var label = controlTypes[o]; + item.Get("LABEL").GetText = () => label; return item; } - dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 500, options.Keys, SetupItem); + dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 500, controlTypes.Keys, SetupItem); } static void ShowMouseScrollDropdown(DropDownButtonWidget dropdown, GameSettings gameSettings) diff --git a/OpenRA.Mods.Common/Widgets/RadarWidget.cs b/OpenRA.Mods.Common/Widgets/RadarWidget.cs index 9758056249..547bc8195c 100644 --- a/OpenRA.Mods.Common/Widgets/RadarWidget.cs +++ b/OpenRA.Mods.Common/Widgets/RadarWidget.cs @@ -45,6 +45,7 @@ namespace OpenRA.Mods.Common.Widgets readonly int cellWidth; readonly int previewWidth; readonly int previewHeight; + readonly string worldSelectCursor = ChromeMetrics.Get("WorldSelectCursor"); readonly string worldDefaultCursor = ChromeMetrics.Get("WorldDefaultCursor"); readonly GameSettings gameSettings; @@ -52,6 +53,8 @@ namespace OpenRA.Mods.Common.Widgets int frame; bool hasRadar; bool cachedEnabled; + bool isMinimapMoving; + MouseButton minimapMoveButton; float previewScale = 0; int2 previewOrigin = int2.Zero; @@ -303,6 +306,7 @@ namespace OpenRA.Mods.Common.Widgets }; var cursor = world.OrderGenerator.GetCursor(world, cell, worldPixel, mi); + if (cursor == null) return worldDefaultCursor; @@ -318,13 +322,14 @@ namespace OpenRA.Mods.Common.Widgets return true; var worldCoords = MinimapPixelToWorldCoords(mi.Location); - if ((mi.Event == MouseInputEvent.Down || mi.Event == MouseInputEvent.Move) - && mi.Button == gameSettings.ResolveCancelButton(MouseActionType.Contextual)) + if ((mi.Event == MouseInputEvent.Down && mi.Button != world.OrderGenerator.ActionButton) || + (mi.Event == MouseInputEvent.Move && isMinimapMoving && mi.Button == minimapMoveButton)) { worldRenderer.Viewport.Center(worldCoords); + isMinimapMoving = true; + minimapMoveButton = mi.Button; } - - if (mi.Event == MouseInputEvent.Down && mi.Button == gameSettings.ResolveActionButton(MouseActionType.Contextual) && WorldInteractionController != null) + else if (mi.Event == MouseInputEvent.Down && WorldInteractionController != null) { var worldPos = worldCoords.ToInt2(); var wpos = new WPos(worldPos.X, worldPos.Y, 0); @@ -344,6 +349,11 @@ namespace OpenRA.Mods.Common.Widgets fakemi.Event = MouseInputEvent.Up; controller.HandleMouseInput(fakemi); } + else if (mi.Event == MouseInputEvent.Up && mi.Button == minimapMoveButton) + { + isMinimapMoving = false; + minimapMoveButton = MouseButton.None; + } return true; } diff --git a/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs b/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs index 748b771174..b9eba13812 100644 --- a/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs @@ -319,7 +319,7 @@ namespace OpenRA.Mods.Common.Widgets } var gs = Game.Settings.Game; - var scrollButton = gs.UseClassicMouseStyle ^ gs.UseAlternateScrollButton ? MouseButton.Right : MouseButton.Middle; + var scrollButton = gs.MouseControlStyle == MouseControlStyle.Classic ^ gs.UseAlternateScrollButton ? MouseButton.Right : MouseButton.Middle; var scrollType = mi.Button.HasFlag(scrollButton) ? gs.MouseScroll : MouseScrollType.Disabled; if (scrollType == MouseScrollType.Disabled) diff --git a/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs index 9c87778c0b..f3d38c8149 100644 --- a/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs @@ -86,7 +86,9 @@ namespace OpenRA.Mods.Common.Widgets { mousePos = worldRenderer.Viewport.ViewToWorldPx(mi.Location); - var useClassicMouseStyle = gameSettings.UseClassicMouseStyle; + var useClassicMouseStyle = gameSettings.MouseControlStyle == MouseControlStyle.Classic; + var actionButton = World.OrderGenerator.ActionButton; + var multiClick = mi.MultiTapCount >= 2; if (World.OrderGenerator is not UnitOrderGenerator uog) @@ -102,15 +104,18 @@ namespace OpenRA.Mods.Common.Widgets if (!TakeMouseFocus(mi)) return false; - dragStart = mousePos; - isDragging = true; + if (useClassicMouseStyle || actionButton != MouseButton.Left) + { + dragStart = mousePos; + isDragging = true; + } } if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Up) { - if (useClassicMouseStyle && HasMouseFocus && - !IsValidDragbox && World.Selection.Actors.Count != 0 && - !multiClick && uog.InputOverridesSelection(World, mousePos, mi)) + if (((useClassicMouseStyle && !multiClick) || (!useClassicMouseStyle && actionButton == MouseButton.Left)) + && HasMouseFocus && !IsValidDragbox && World.Selection.Actors.Count != 0 + && uog.InputOverridesSelection(World, mousePos, mi)) { // Order units instead of selecting ApplyOrders(World, mi); @@ -167,7 +172,7 @@ namespace OpenRA.Mods.Common.Widgets // Don't do anything while selecting if (!IsValidDragbox) { - if (useClassicMouseStyle) + if (useClassicMouseStyle && uog.ClearSelectionOnLeftClick) World.Selection.Clear(); ApplyOrders(World, mi); diff --git a/mods/cnc/chrome/mainmenu-prompts.yaml b/mods/cnc/chrome/mainmenu-prompts.yaml index 70acfcb0da..edd7da5c3e 100644 --- a/mods/cnc/chrome/mainmenu-prompts.yaml +++ b/mods/cnc/chrome/mainmenu-prompts.yaml @@ -3,7 +3,7 @@ Container@MAINMENU_INTRODUCTION_PROMPT: X: (WINDOW_WIDTH - WIDTH) / 2 Y: (WINDOW_HEIGHT - HEIGHT) / 2 Width: 700 - Height: 445 + Height: 461 Children: Label@PROMPT_TITLE: Width: PARENT_WIDTH @@ -140,49 +140,119 @@ Container@MAINMENU_INTRODUCTION_PROMPT: Height: 16 Font: Small Text: label-mouse-control-desc-classic-commands - LabelWithHighlight@DESC_BUILDINGS: + LabelWithHighlight@DESC_ORDERS: Y: 34 Width: PARENT_WIDTH Height: 16 Font: Small + Text: label-mouse-control-desc-classic-orders + LabelWithHighlight@DESC_BUILDINGS: + Y: 51 + Width: PARENT_WIDTH + Height: 16 + Font: Small Text: label-mouse-control-desc-classic-buildings LabelWithHighlight@DESC_SUPPORT: - Y: 51 + Y: 68 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-support LabelWithHighlight@DESC_ZOOM: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-zoom LabelWithHighlight@DESC_ZOOM_MODIFIER: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-zoom-modifier LabelWithHighlight@DESC_SCROLL_RIGHT: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-scroll-right LabelWithHighlight@DESC_SCROLL_MIDDLE: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-scroll-middle Label@DESC_EDGESCROLL: X: 9 - Y: 102 + Y: 118 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-edgescroll + Container@MOUSE_CONTROL_DESC_OTHERRTS: + X: PARENT_WIDTH / 2 + 10 + Width: PARENT_WIDTH / 2 - 20 + Children: + LabelWithHighlight@DESC_SELECTION: + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-selection + LabelWithHighlight@DESC_COMMANDS: + Y: 17 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-commands + LabelWithHighlight@DESC_ORDERS: + Y: 34 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-orders + LabelWithHighlight@DESC_BUILDINGS: + Y: 51 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-buildings + LabelWithHighlight@DESC_SUPPORT: + Y: 68 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-support + LabelWithHighlight@DESC_ZOOM: + Y: 85 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-zoom + LabelWithHighlight@DESC_ZOOM_MODIFIER: + Y: 85 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-zoom-modifier + LabelWithHighlight@DESC_SCROLL_RIGHT: + Y: 102 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-scroll-right + LabelWithHighlight@DESC_SCROLL_MIDDLE: + Y: 102 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-scroll-middle + Label@DESC_EDGESCROLL: + X: 9 + Y: 118 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-edgescroll Container@MOUSE_CONTROL_DESC_MODERN: X: PARENT_WIDTH / 2 + 10 Width: PARENT_WIDTH / 2 - 20 @@ -198,45 +268,51 @@ Container@MAINMENU_INTRODUCTION_PROMPT: Height: 16 Font: Small Text: label-mouse-control-desc-modern-commands - LabelWithHighlight@DESC_BUILDINGS: + LabelWithHighlight@DESC_ORDERS: Y: 34 Width: PARENT_WIDTH Height: 16 Font: Small + Text: label-mouse-control-desc-modern-orders + LabelWithHighlight@DESC_BUILDINGS: + Y: 51 + Width: PARENT_WIDTH + Height: 16 + Font: Small Text: label-mouse-control-desc-modern-buildings LabelWithHighlight@DESC_SUPPORT: - Y: 51 + Y: 68 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-support LabelWithHighlight@DESC_ZOOM: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-zoom LabelWithHighlight@DESC_ZOOM_MODIFIER: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-zoom-modifier LabelWithHighlight@DESC_SCROLL_RIGHT: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-scroll-right LabelWithHighlight@DESC_SCROLL_MIDDLE: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-scroll-middle Label@DESC_EDGESCROLL: X: 9 - Y: 102 + Y: 118 Width: PARENT_WIDTH Height: 16 Font: Small @@ -255,7 +331,7 @@ Container@MAINMENU_INTRODUCTION_PROMPT: Font: Regular Text: checkbox-edgescroll-container Container@SPACER: - Height: 30 + Height: 46 Background@DISPLAY_SECTION_HEADER: X: 5 Width: PARENT_WIDTH - 10 diff --git a/mods/cnc/chrome/settings-input.yaml b/mods/cnc/chrome/settings-input.yaml index 77bd0f0d5a..6bac25a6d8 100644 --- a/mods/cnc/chrome/settings-input.yaml +++ b/mods/cnc/chrome/settings-input.yaml @@ -71,49 +71,120 @@ Container@INPUT_PANEL: Height: 16 Font: Small Text: label-mouse-control-desc-classic-commands - LabelWithHighlight@DESC_BUILDINGS: + LabelWithHighlight@DESC_ORDERS: Y: 34 Width: PARENT_WIDTH Height: 16 Font: Small + Text: label-mouse-control-desc-classic-orders + LabelWithHighlight@DESC_BUILDINGS: + Y: 51 + Width: PARENT_WIDTH + Height: 16 + Font: Small Text: label-mouse-control-desc-classic-buildings LabelWithHighlight@DESC_SUPPORT: - Y: 51 + Y: 68 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-support LabelWithHighlight@DESC_ZOOM: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-zoom LabelWithHighlight@DESC_ZOOM_MODIFIER: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-zoom-modifier LabelWithHighlight@DESC_SCROLL_RIGHT: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-scroll-right LabelWithHighlight@DESC_SCROLL_MIDDLE: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-scroll-middle Label@DESC_EDGESCROLL: X: 9 - Y: 102 + Y: 118 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-edgescroll + Container@MOUSE_CONTROL_DESC_OTHERRTS: + X: 10 + Y: 55 + Width: PARENT_WIDTH / 2 - 20 + Children: + LabelWithHighlight@DESC_SELECTION: + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-selection + LabelWithHighlight@DESC_COMMANDS: + Y: 17 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-commands + LabelWithHighlight@DESC_ORDERS: + Y: 34 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-orders + LabelWithHighlight@DESC_BUILDINGS: + Y: 51 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-buildings + LabelWithHighlight@DESC_SUPPORT: + Y: 68 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-support + LabelWithHighlight@DESC_ZOOM: + Y: 85 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-zoom + LabelWithHighlight@DESC_ZOOM_MODIFIER: + Y: 85 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-zoom-modifier + LabelWithHighlight@DESC_SCROLL_RIGHT: + Y: 102 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-scroll-right + LabelWithHighlight@DESC_SCROLL_MIDDLE: + Y: 102 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-scroll-middle + Label@DESC_EDGESCROLL: + X: 9 + Y: 118 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-edgescroll Container@MOUSE_CONTROL_DESC_MODERN: X: 10 Y: 55 @@ -130,45 +201,51 @@ Container@INPUT_PANEL: Height: 16 Font: Small Text: label-mouse-control-desc-modern-commands - LabelWithHighlight@DESC_BUILDINGS: + LabelWithHighlight@DESC_ORDERS: Y: 34 Width: PARENT_WIDTH Height: 16 Font: Small + Text: label-mouse-control-desc-modern-orders + LabelWithHighlight@DESC_BUILDINGS: + Y: 51 + Width: PARENT_WIDTH + Height: 16 + Font: Small Text: label-mouse-control-desc-modern-buildings LabelWithHighlight@DESC_SUPPORT: - Y: 51 + Y: 68 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-support LabelWithHighlight@DESC_ZOOM: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-zoom LabelWithHighlight@DESC_ZOOM_MODIFIER: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-zoom-modifier LabelWithHighlight@DESC_SCROLL_RIGHT: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-scroll-right LabelWithHighlight@DESC_SCROLL_MIDDLE: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-scroll-middle Label@DESC_EDGESCROLL: X: 9 - Y: 102 + Y: 118 Width: PARENT_WIDTH Height: 16 Font: Small @@ -213,10 +290,10 @@ Container@INPUT_PANEL: Font: Regular Text: checkbox-lockmouse-container Container@SPACER: - Height: 30 + Height: 46 Container@ROW: Width: PARENT_WIDTH - 24 - Height: 50 + Height: 45 Children: Container@MOUSE_SCROLL_TYPE_CONTAINER: X: 10 @@ -241,7 +318,7 @@ Container@INPUT_PANEL: Height: 20 Text: label-scrollspeed-slider-container-scroll-speed Slider@SCROLLSPEED_SLIDER: - Y: 25 + Y: 20 Width: PARENT_WIDTH Height: 20 Ticks: 7 @@ -249,7 +326,7 @@ Container@INPUT_PANEL: MaximumValue: 50 Container@ROW: Width: PARENT_WIDTH - 24 - Height: 50 + Height: 45 Children: Container@ZOOMSPEED_SLIDER_CONTAINER: X: PARENT_WIDTH / 2 + 10 @@ -260,7 +337,7 @@ Container@INPUT_PANEL: Height: 20 Text: label-zoomspeed-slider-container-zoom-speed ExponentialSlider@ZOOMSPEED_SLIDER: - Y: 25 + Y: 20 Width: PARENT_WIDTH Height: 20 Ticks: 7 @@ -268,7 +345,7 @@ Container@INPUT_PANEL: MaximumValue: 0.4 Container@ROW: Width: PARENT_WIDTH - 24 - Height: 50 + Height: 45 Children: Container@UI_SCROLLSPEED_SLIDER_CONTAINER: X: PARENT_WIDTH / 2 + 10 @@ -279,7 +356,7 @@ Container@INPUT_PANEL: Height: 20 Text: label-ui-scrollspeed-slider-container-scroll-speed Slider@UI_SCROLLSPEED_SLIDER: - Y: 25 + Y: 20 Width: PARENT_WIDTH Height: 20 Ticks: 7 diff --git a/mods/cnc/fluent/chrome.ftl b/mods/cnc/fluent/chrome.ftl index cad3765583..31c40ac2f6 100644 --- a/mods/cnc/fluent/chrome.ftl +++ b/mods/cnc/fluent/chrome.ftl @@ -480,6 +480,7 @@ label-input-section-header = Input label-mouse-control-container = Control Scheme: label-mouse-control-desc-classic-selection = - Select units using the mouse button label-mouse-control-desc-classic-commands = - Command units using the mouse button +label-mouse-control-desc-classic-orders = - Confirm orders using the mouse button label-mouse-control-desc-classic-buildings = - Place structures using the mouse button label-mouse-control-desc-classic-support = - Target support powers using the mouse button label-mouse-control-desc-classic-zoom = - Zoom the battlefield using the @@ -487,8 +488,19 @@ label-mouse-control-desc-classic-zoom-modifier = - Zoom the battlefield using mouse button label-mouse-control-desc-classic-scroll-middle = - Pan the battlefield using the mouse button label-mouse-control-desc-classic-edgescroll = or by moving the cursor to the edge of the screen +label-mouse-control-desc-otherrts-selection = - Select units using the mouse button +label-mouse-control-desc-otherrts-commands = - Command units using the mouse button +label-mouse-control-desc-otherrts-orders = - Confirm orders using the mouse button +label-mouse-control-desc-otherrts-buildings = - Place structures using the mouse button +label-mouse-control-desc-otherrts-support = - Target support powers using the mouse button +label-mouse-control-desc-otherrts-zoom = - Zoom the battlefield using the +label-mouse-control-desc-otherrts-zoom-modifier = - Zoom the battlefield using +label-mouse-control-desc-otherrts-scroll-right = - Pan the battlefield using the mouse button +label-mouse-control-desc-otherrts-scroll-middle = - Pan the battlefield using the mouse button +label-mouse-control-desc-otherrts-edgescroll = or by moving the cursor to the edge of the screen label-mouse-control-desc-modern-selection = - Select units using the mouse button label-mouse-control-desc-modern-commands = - Command units using the mouse button +label-mouse-control-desc-modern-orders = - Confirm orders using the mouse button label-mouse-control-desc-modern-buildings = - Place structures using the mouse button label-mouse-control-desc-modern-support = - Target support powers using the mouse button label-mouse-control-desc-modern-zoom = - Zoom the battlefield using the diff --git a/mods/common/chrome/mainmenu-prompts.yaml b/mods/common/chrome/mainmenu-prompts.yaml index 37df690ede..b1aa7c9b8e 100644 --- a/mods/common/chrome/mainmenu-prompts.yaml +++ b/mods/common/chrome/mainmenu-prompts.yaml @@ -3,7 +3,7 @@ Background@MAINMENU_INTRODUCTION_PROMPT: X: (WINDOW_WIDTH - WIDTH) / 2 Y: (WINDOW_HEIGHT - HEIGHT) / 2 Width: 700 - Height: 525 + Height: 541 Children: Label@PROMPT_TITLE: Width: PARENT_WIDTH @@ -134,49 +134,119 @@ Background@MAINMENU_INTRODUCTION_PROMPT: Height: 16 Font: Small Text: label-mouse-control-desc-classic-commands - LabelWithHighlight@DESC_BUILDINGS: + LabelWithHighlight@DESC_ORDERS: Y: 34 Width: PARENT_WIDTH Height: 16 Font: Small + Text: label-mouse-control-desc-classic-orders + LabelWithHighlight@DESC_BUILDINGS: + Y: 51 + Width: PARENT_WIDTH + Height: 16 + Font: Small Text: label-mouse-control-desc-classic-buildings LabelWithHighlight@DESC_SUPPORT: - Y: 51 + Y: 68 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-support LabelWithHighlight@DESC_ZOOM: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-zoom LabelWithHighlight@DESC_ZOOM_MODIFIER: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-zoom-modifier LabelWithHighlight@DESC_SCROLL_RIGHT: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-scroll-right LabelWithHighlight@DESC_SCROLL_MIDDLE: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-scroll-middle Label@DESC_EDGESCROLL: X: 9 - Y: 102 + Y: 118 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-edgescroll + Container@MOUSE_CONTROL_DESC_OTHERRTS: + X: PARENT_WIDTH / 2 + 10 + Width: PARENT_WIDTH / 2 - 20 + Children: + LabelWithHighlight@DESC_SELECTION: + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-selection + LabelWithHighlight@DESC_COMMANDS: + Y: 17 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-commands + LabelWithHighlight@DESC_ORDERS: + Y: 34 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-orders + LabelWithHighlight@DESC_BUILDINGS: + Y: 51 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-buildings + LabelWithHighlight@DESC_SUPPORT: + Y: 68 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-support + LabelWithHighlight@DESC_ZOOM: + Y: 85 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-zoom + LabelWithHighlight@DESC_ZOOM_MODIFIER: + Y: 85 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-zoom-modifier + LabelWithHighlight@DESC_SCROLL_RIGHT: + Y: 102 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-scroll-right + LabelWithHighlight@DESC_SCROLL_MIDDLE: + Y: 102 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-scroll-middle + Label@DESC_EDGESCROLL: + X: 9 + Y: 118 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-edgescroll Container@MOUSE_CONTROL_DESC_MODERN: X: PARENT_WIDTH / 2 + 10 Width: PARENT_WIDTH / 2 - 20 @@ -192,45 +262,51 @@ Background@MAINMENU_INTRODUCTION_PROMPT: Height: 16 Font: Small Text: label-mouse-control-desc-modern-commands - LabelWithHighlight@DESC_BUILDINGS: + LabelWithHighlight@DESC_ORDERS: Y: 34 Width: PARENT_WIDTH Height: 16 Font: Small + Text: label-mouse-control-desc-modern-orders + LabelWithHighlight@DESC_BUILDINGS: + Y: 51 + Width: PARENT_WIDTH + Height: 16 + Font: Small Text: label-mouse-control-desc-modern-buildings LabelWithHighlight@DESC_SUPPORT: - Y: 51 + Y: 68 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-support LabelWithHighlight@DESC_ZOOM: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-zoom LabelWithHighlight@DESC_ZOOM_MODIFIER: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-zoom-modifier LabelWithHighlight@DESC_SCROLL_RIGHT: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-scroll-right LabelWithHighlight@DESC_SCROLL_MIDDLE: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-scroll-middle Label@DESC_EDGESCROLL: X: 9 - Y: 102 + Y: 118 Width: PARENT_WIDTH Height: 16 Font: Small @@ -249,7 +325,7 @@ Background@MAINMENU_INTRODUCTION_PROMPT: Font: Regular Text: checkbox-edgescroll-container Container@SPACER: - Height: 30 + Height: 46 Background@DISPLAY_SECTION_HEADER: X: 5 Width: PARENT_WIDTH - 10 diff --git a/mods/common/chrome/settings-input.yaml b/mods/common/chrome/settings-input.yaml index 77bd0f0d5a..3e374cbea0 100644 --- a/mods/common/chrome/settings-input.yaml +++ b/mods/common/chrome/settings-input.yaml @@ -71,49 +71,120 @@ Container@INPUT_PANEL: Height: 16 Font: Small Text: label-mouse-control-desc-classic-commands - LabelWithHighlight@DESC_BUILDINGS: + LabelWithHighlight@DESC_ORDERS: Y: 34 Width: PARENT_WIDTH Height: 16 Font: Small + Text: label-mouse-control-desc-classic-orders + LabelWithHighlight@DESC_BUILDINGS: + Y: 51 + Width: PARENT_WIDTH + Height: 16 + Font: Small Text: label-mouse-control-desc-classic-buildings LabelWithHighlight@DESC_SUPPORT: - Y: 51 + Y: 68 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-support LabelWithHighlight@DESC_ZOOM: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-zoom LabelWithHighlight@DESC_ZOOM_MODIFIER: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-zoom-modifier LabelWithHighlight@DESC_SCROLL_RIGHT: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-scroll-right LabelWithHighlight@DESC_SCROLL_MIDDLE: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-scroll-middle Label@DESC_EDGESCROLL: X: 9 - Y: 102 + Y: 118 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-classic-edgescroll + Container@MOUSE_CONTROL_DESC_OTHERRTS: + X: 10 + Y: 55 + Width: PARENT_WIDTH / 2 - 20 + Children: + LabelWithHighlight@DESC_SELECTION: + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-selection + LabelWithHighlight@DESC_COMMANDS: + Y: 17 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-commands + LabelWithHighlight@DESC_ORDERS: + Y: 34 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-orders + LabelWithHighlight@DESC_BUILDINGS: + Y: 51 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-buildings + LabelWithHighlight@DESC_SUPPORT: + Y: 68 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-support + LabelWithHighlight@DESC_ZOOM: + Y: 85 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-zoom + LabelWithHighlight@DESC_ZOOM_MODIFIER: + Y: 85 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-zoom-modifier + LabelWithHighlight@DESC_SCROLL_RIGHT: + Y: 102 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-scroll-right + LabelWithHighlight@DESC_SCROLL_MIDDLE: + Y: 102 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-scroll-middle + Label@DESC_EDGESCROLL: + X: 9 + Y: 118 + Width: PARENT_WIDTH + Height: 16 + Font: Small + Text: label-mouse-control-desc-otherrts-edgescroll Container@MOUSE_CONTROL_DESC_MODERN: X: 10 Y: 55 @@ -130,45 +201,51 @@ Container@INPUT_PANEL: Height: 16 Font: Small Text: label-mouse-control-desc-modern-commands - LabelWithHighlight@DESC_BUILDINGS: + LabelWithHighlight@DESC_ORDERS: Y: 34 Width: PARENT_WIDTH Height: 16 Font: Small + Text: label-mouse-control-desc-modern-orders + LabelWithHighlight@DESC_BUILDINGS: + Y: 51 + Width: PARENT_WIDTH + Height: 16 + Font: Small Text: label-mouse-control-desc-modern-buildings LabelWithHighlight@DESC_SUPPORT: - Y: 51 + Y: 68 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-support LabelWithHighlight@DESC_ZOOM: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-zoom LabelWithHighlight@DESC_ZOOM_MODIFIER: - Y: 68 + Y: 85 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-zoom-modifier LabelWithHighlight@DESC_SCROLL_RIGHT: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-scroll-right LabelWithHighlight@DESC_SCROLL_MIDDLE: - Y: 85 + Y: 102 Width: PARENT_WIDTH Height: 16 Font: Small Text: label-mouse-control-desc-modern-scroll-middle Label@DESC_EDGESCROLL: X: 9 - Y: 102 + Y: 118 Width: PARENT_WIDTH Height: 16 Font: Small @@ -213,7 +290,7 @@ Container@INPUT_PANEL: Font: Regular Text: checkbox-lockmouse-container Container@SPACER: - Height: 30 + Height: 46 Container@ROW: Width: PARENT_WIDTH - 24 Height: 50 diff --git a/mods/common/fluent/chrome.ftl b/mods/common/fluent/chrome.ftl index e4b61c7736..9cb8d25f3c 100644 --- a/mods/common/fluent/chrome.ftl +++ b/mods/common/fluent/chrome.ftl @@ -300,6 +300,7 @@ label-input-section-header = Input label-mouse-control-container = Control Scheme: label-mouse-control-desc-classic-selection = - Select units using the mouse button label-mouse-control-desc-classic-commands = - Command units using the mouse button +label-mouse-control-desc-classic-orders = - Confirm orders using the mouse button label-mouse-control-desc-classic-buildings = - Place structures using the mouse button label-mouse-control-desc-classic-support = - Target support powers using the mouse button label-mouse-control-desc-classic-zoom = - Zoom the battlefield using the @@ -307,8 +308,19 @@ label-mouse-control-desc-classic-zoom-modifier = - Zoom the battlefield using mouse button label-mouse-control-desc-classic-scroll-middle = - Pan the battlefield using the mouse button label-mouse-control-desc-classic-edgescroll = or by moving the cursor to the edge of the screen +label-mouse-control-desc-otherrts-selection = - Select units using the mouse button +label-mouse-control-desc-otherrts-commands = - Command units using the mouse button +label-mouse-control-desc-otherrts-orders = - Confirm orders using the mouse button +label-mouse-control-desc-otherrts-buildings = - Place structures using the mouse button +label-mouse-control-desc-otherrts-support = - Target support powers using the mouse button +label-mouse-control-desc-otherrts-zoom = - Zoom the battlefield using the +label-mouse-control-desc-otherrts-zoom-modifier = - Zoom the battlefield using +label-mouse-control-desc-otherrts-scroll-right = - Pan the battlefield using the mouse button +label-mouse-control-desc-otherrts-scroll-middle = - Pan the battlefield using the mouse button +label-mouse-control-desc-otherrts-edgescroll = or by moving the cursor to the edge of the screen label-mouse-control-desc-modern-selection = - Select units using the mouse button label-mouse-control-desc-modern-commands = - Command units using the mouse button +label-mouse-control-desc-modern-orders = - Confirm orders using the mouse button label-mouse-control-desc-modern-buildings = - Place structures using the mouse button label-mouse-control-desc-modern-support = - Target support powers using the mouse button label-mouse-control-desc-modern-zoom = - Zoom the battlefield using the diff --git a/mods/common/fluent/common.ftl b/mods/common/fluent/common.ftl index 9493b93ca5..3143942469 100644 --- a/mods/common/fluent/common.ftl +++ b/mods/common/fluent/common.ftl @@ -401,6 +401,7 @@ options-mouse-scroll-type = options-control-scheme = .classic = Classic .modern = Modern + .otherrts = Other RTS ## SettingsLogic dialog-settings-save =