Overhaul target line rendering:
- Targets are now defined by the activities - Queued activities are shown - Support custom attack colors
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Primitives;
|
||||
@@ -75,10 +76,6 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
TickInner(self, target, useLastVisibleTarget);
|
||||
|
||||
// Update target lines if required
|
||||
if (useLastVisibleTarget != oldUseLastVisibleTarget && targetLineColor.HasValue)
|
||||
self.SetTargetLine(useLastVisibleTarget ? lastVisibleTarget : target, targetLineColor.Value, false);
|
||||
|
||||
// We need to wait for movement to finish before transitioning to
|
||||
// the next state or next activity
|
||||
if (!TickChild(self))
|
||||
@@ -146,5 +143,11 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override IEnumerable<TargetLineNode> TargetLineNodes(Actor self)
|
||||
{
|
||||
if (targetLineColor != null)
|
||||
yield return new TargetLineNode(useLastVisibleTarget ? lastVisibleTarget : target, targetLineColor.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user