Replace MouseButtonPreference with MouseActionType.

This commit is contained in:
Paul Chote
2025-12-15 20:30:26 +00:00
committed by Gustas Kažukauskas
parent c588c3ef8d
commit 962e7e911d
27 changed files with 212 additions and 246 deletions

View File

@@ -282,28 +282,24 @@ namespace OpenRA.Mods.Common.Traits
public class SelectGenericPowerTarget : OrderGenerator
{
protected override MouseActionType ActionType => MouseActionType.SupportPower;
readonly SupportPowerManager manager;
readonly SupportPowerInfo info;
readonly MouseButton expectedButton;
public string OrderKey { get; }
public SelectGenericPowerTarget(string order, SupportPowerManager manager, SupportPowerInfo info, MouseButton button)
public SelectGenericPowerTarget(string order, SupportPowerManager manager, SupportPowerInfo info)
: base(manager.Self.World)
{
// Clear selection if using Left-Click Orders
if (Game.Settings.Game.UseClassicMouseStyle)
manager.Self.World.Selection.Clear();
this.manager = manager;
OrderKey = order;
this.info = info;
expectedButton = button;
}
protected override IEnumerable<Order> OrderInner(World world, CPos cell, int2 worldPixel, MouseInput mi)
{
world.CancelInputMode();
if (mi.Button == expectedButton && world.Map.Contains(cell))
if (world.Map.Contains(cell))
yield return new Order(OrderKey, manager.Self, Target.FromCell(world, cell), false) { SuppressVisualFeedback = true };
}