diff --git a/OpenRA.Mods.RA/Effects/RallyPoint.cs b/OpenRA.Mods.RA/Effects/RallyPoint.cs index 8c8b56d254..555d597bd6 100755 --- a/OpenRA.Mods.RA/Effects/RallyPoint.cs +++ b/OpenRA.Mods.RA/Effects/RallyPoint.cs @@ -20,15 +20,15 @@ namespace OpenRA.Mods.RA.Effects { readonly Actor building; readonly RA.RallyPoint rp; - readonly RenderSimple rs; + readonly string palettePrefix; public Animation flag = new Animation("rallypoint"); public Animation circles = new Animation("rallypoint"); - public RallyPoint(Actor building) + public RallyPoint(Actor building, string palettePrefix) { this.building = building; rp = building.Trait(); - rs = building.Trait(); + this.palettePrefix = palettePrefix; flag.PlayRepeating("flag"); circles.Play("circles"); } @@ -54,7 +54,7 @@ namespace OpenRA.Mods.RA.Effects && building.World.Selection.Actors.Contains(building)) { var pos = Traits.Util.CenterOfCell(rp.rallyPoint); - var palette = rs.Palette(building.Owner, wr); + var palette = wr.Palette(palettePrefix+building.Owner.InternalName); yield return new Renderable(circles.Image, pos.ToFloat2() - .5f * circles.Image.size, diff --git a/OpenRA.Mods.RA/RallyPoint.cs b/OpenRA.Mods.RA/RallyPoint.cs index ba1c410200..7286f0eb1a 100755 --- a/OpenRA.Mods.RA/RallyPoint.cs +++ b/OpenRA.Mods.RA/RallyPoint.cs @@ -14,11 +14,12 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class RallyPointInfo : ITraitInfo, Requires + public class RallyPointInfo : ITraitInfo { public readonly int[] RallyPoint = { 1, 3 }; + public readonly string IndicatorPalettePrefix = "player"; - public object Create(ActorInitializer init) { return new RallyPoint(init.self); } + public object Create(ActorInitializer init) { return new RallyPoint(init.self, this); } } public class RallyPoint : IIssueOrder, IResolveOrder, ISync @@ -26,11 +27,10 @@ namespace OpenRA.Mods.RA [Sync] public CPos rallyPoint; public int nearEnough = 1; - public RallyPoint(Actor self) + public RallyPoint(Actor self, RallyPointInfo info) { - var info = self.Info.Traits.Get(); rallyPoint = self.Location + new CVec(info.RallyPoint[0], info.RallyPoint[1]); - self.World.AddFrameEndTask(w => w.Add(new Effects.RallyPoint(self))); + self.World.AddFrameEndTask(w => w.Add(new Effects.RallyPoint(self, info.IndicatorPalettePrefix))); } public IEnumerable Orders