DrawLineToTarget: made palette for rendering sprites customizable (and thus optional too)
This commit is contained in:
@@ -35,6 +35,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Width (in pixels) of the queued end node markers.")]
|
[Desc("Width (in pixels) of the queued end node markers.")]
|
||||||
public readonly int QueuedMarkerWidth = 2;
|
public readonly int QueuedMarkerWidth = 2;
|
||||||
|
|
||||||
|
[PaletteReference]
|
||||||
|
[Desc("Palette used for rendering sprites.")]
|
||||||
|
public readonly string Palette = TileSet.TerrainPaletteInternalName;
|
||||||
|
|
||||||
public override object Create(ActorInitializer init) { return new DrawLineToTarget(this); }
|
public override object Create(ActorInitializer init) { return new DrawLineToTarget(this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,9 +86,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return RenderAboveShroud(self, wr);
|
return RenderAboveShroud(self, wr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static IEnumerable<IRenderable> RenderAboveShroud(Actor self, WorldRenderer wr)
|
IEnumerable<IRenderable> RenderAboveShroud(Actor self, WorldRenderer wr)
|
||||||
{
|
{
|
||||||
var pal = wr.Palette(TileSet.TerrainPaletteInternalName);
|
var pal = wr.Palette(info.Palette);
|
||||||
var a = self.CurrentActivity;
|
var a = self.CurrentActivity;
|
||||||
for (; a != null; a = a.NextActivity)
|
for (; a != null; a = a.NextActivity)
|
||||||
if (!a.IsCanceling)
|
if (!a.IsCanceling)
|
||||||
|
|||||||
Reference in New Issue
Block a user