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

@@ -12,12 +12,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Primitives;
using OpenRA.Traits;
namespace OpenRA.Activities
{
public enum ActivityState { Queued, Active, Canceling, Done }
public class TargetLineNode
{
public readonly Target Target;
public readonly Color Color;
public TargetLineNode(Target target, Color color)
{
// Note: Not all activities are drawable. In that case, pass Target.Invalid as target,
// if "yield break" in TargetLineNode(Actor self) is not feasible.
Target = target;
Color = color;
}
}
/*
* Things to be aware of when writing activities:
*
@@ -204,6 +219,11 @@ namespace OpenRA.Activities
yield break;
}
public virtual IEnumerable<TargetLineNode> TargetLineNodes(Actor self)
{
yield break;
}
public IEnumerable<string> DebugLabelComponents()
{
var act = this;