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:
@@ -21,6 +21,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[VoiceReference]
|
||||
public readonly string Voice = "Action";
|
||||
|
||||
[Desc("Color to use for the target line.")]
|
||||
public readonly Color TargetLineColor = Color.OrangeRed;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new Guard(this); }
|
||||
}
|
||||
|
||||
@@ -51,7 +54,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
var range = target.Actor.Info.TraitInfo<GuardableInfo>().Range;
|
||||
self.QueueActivity(queued, new AttackMoveActivity(self, () => move.MoveFollow(self, target, WDist.Zero, range, targetLineColor: Color.OrangeRed)));
|
||||
self.QueueActivity(queued, new AttackMoveActivity(self, () => move.MoveFollow(self, target, WDist.Zero, range, targetLineColor: info.TargetLineColor)));
|
||||
self.ShowTargetLines();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user