Overhaul target line rendering:

- Targets are now defined by the activities
- Queued activities are shown
- Support custom attack colors
This commit is contained in:
Turupawn
2019-07-24 20:54:27 +00:00
committed by Paul Chote
parent bc4dea406d
commit 3240b1e9eb
71 changed files with 433 additions and 269 deletions

View File

@@ -9,7 +9,7 @@
*/
#endregion
using System;
using System.Collections.Generic;
using OpenRA.Activities;
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.Common.Traits.Render;
@@ -149,16 +149,24 @@ namespace OpenRA.Mods.Common.Activities
{
readonly string orderString;
readonly Target target;
readonly Color? targetLineColor;
public IssueOrderAfterTransform(string orderString, Target target)
public IssueOrderAfterTransform(string orderString, Target target, Color? targetLineColor = null)
{
this.orderString = orderString;
this.target = target;
this.targetLineColor = targetLineColor;
}
public Order IssueOrderForTransformedActor(Actor newActor)
{
return new Order(orderString, newActor, target, true);
}
public override IEnumerable<TargetLineNode> TargetLineNodes(Actor self)
{
if (targetLineColor != null)
yield return new TargetLineNode(target, targetLineColor.Value);
}
}
}