Expose targetline colors to yaml.

All targetlines can now be set to a custom color in yaml or set to be invisible.
All automated behaviours including scripted activities now have no visible target lines.
This commit is contained in:
tovl
2020-08-02 22:22:39 +02:00
committed by Paul Chote
parent ea3c7a3c34
commit 84eb3c54ef
41 changed files with 139 additions and 58 deletions

View File

@@ -49,6 +49,9 @@ namespace OpenRA.Mods.Common.Traits
[VoiceReference]
public readonly string Voice = "Action";
[Desc("Color to use for the target line for regular move orders.")]
public readonly Color TargetLineColor = Color.Green;
[Desc("Facing to use for actor previews (map editor, color picker, etc)")]
public readonly WAngle PreviewFacing = new WAngle(384);
@@ -68,6 +71,8 @@ namespace OpenRA.Mods.Common.Traits
yield return new FacingInit(PreviewFacing);
}
public Color GetTargetLineColor() { return TargetLineColor; }
public override object Create(ActorInitializer init) { return new Mobile(init, this); }
public LocomotorInfo LocomotorInfo { get; private set; }
@@ -923,7 +928,7 @@ namespace OpenRA.Mods.Common.Traits
if (!Info.LocomotorInfo.MoveIntoShroud && !self.Owner.Shroud.IsExplored(cell))
return;
self.QueueActivity(order.Queued, WrapMove(new Move(self, cell, WDist.FromCells(8), null, true, Color.Green)));
self.QueueActivity(order.Queued, WrapMove(new Move(self, cell, WDist.FromCells(8), null, true, Info.TargetLineColor)));
self.ShowTargetLines();
}