TargetLine for Rally Points

Also enabled allied players to see waypoints.
This commit is contained in:
Huw Pascoe
2015-11-14 22:05:22 +00:00
parent bacac082cc
commit e92ccdf808
2 changed files with 49 additions and 8 deletions

View File

@@ -9,6 +9,7 @@
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Mods.Common.Effects;
using OpenRA.Traits;
@@ -32,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
public object Create(ActorInitializer init) { return new RallyPoint(init.Self, this); }
}
public class RallyPoint : IIssueOrder, IResolveOrder, ISync, INotifyOwnerChanged
public class RallyPoint : IIssueOrder, IResolveOrder, ISync, INotifyOwnerChanged, INotifyCreated
{
[Sync] public CPos Location;
public RallyPointInfo Info;
@@ -48,7 +49,11 @@ namespace OpenRA.Mods.Common.Traits
Info = info;
ResetLocation(self);
PaletteName = info.IsPlayerPalette ? info.Palette + self.Owner.InternalName : info.Palette;
self.World.Add(new RallyPointIndicator(self, this));
}
public void Created(Actor self)
{
self.World.Add(new RallyPointIndicator(self, this, self.Info.TraitInfos<ExitInfo>().ToArray()));
}
public void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)