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:
committed by
Paul Chote
parent
c47ebfbb52
commit
f8eefe310c
@@ -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<Actor> selected)
|
||||
public override void SelectionChanged(World world, IEnumerable<Actor> 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<IRenderable> Render(WorldRenderer wr, World world) { yield break; }
|
||||
public override IEnumerable<IRenderable> Render(WorldRenderer wr, World world) { yield break; }
|
||||
|
||||
protected override IEnumerable<IRenderable> RenderAboveShroud(WorldRenderer wr, World world) { yield break; }
|
||||
public override IEnumerable<IRenderable> RenderAboveShroud(WorldRenderer wr, World world) { yield break; }
|
||||
|
||||
protected override IEnumerable<IRenderable> RenderAnnotations(WorldRenderer wr, World world)
|
||||
public override IEnumerable<IRenderable> 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))
|
||||
|
||||
Reference in New Issue
Block a user