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

@@ -103,7 +103,6 @@ namespace OpenRA.Mods.Common.Traits
{
var exit = CPos.Zero;
var exitLocation = CPos.Zero;
var target = Target.Invalid;
var info = (ProductionParadropInfo)Info;
var actorType = info.ActorType;
@@ -124,7 +123,6 @@ namespace OpenRA.Mods.Common.Traits
var initialFacing = exitinfo.Facing < 0 ? (to - spawn).Yaw.Facing : exitinfo.Facing;
exitLocation = rp.Value != null ? rp.Value.Location : exit;
target = Target.FromCell(self.World, exitLocation);
td.Add(new LocationInit(exit));
td.Add(new CenterPositionInit(spawn));
@@ -149,8 +147,6 @@ namespace OpenRA.Mods.Common.Traits
}
}
newUnit.SetTargetLine(target, rp.Value != null ? Color.Red : Color.Green, false);
if (!self.IsDead)
foreach (var t in self.TraitsImplementing<INotifyProduction>())
t.UnitProduced(self, newUnit, exit);