Do not render trails under fog by default.

Exposed a boolean for rendering a SpriteEffect under fog. Exposed a setting in LeavesTrails for this boolean, defaulting to false.
This commit is contained in:
Zimmermann Gyula
2016-02-14 15:18:53 +01:00
parent 2debda926a
commit f37e59e116
3 changed files with 14 additions and 4 deletions

View File

@@ -33,6 +33,9 @@ namespace OpenRA.Mods.Common.Traits
"CenterPosition to draw the trail sprite at the current position.")]
public readonly TrailType Type = TrailType.Cell;
[Desc("Should the trail be visible through fog.")]
public readonly bool VisibleThroughFog = false;
[Desc("Display a trail while stationary.")]
public readonly bool TrailWhileStationary = false;
@@ -76,7 +79,7 @@ namespace OpenRA.Mods.Common.Traits
if (Info.TerrainTypes.Contains(type) && !string.IsNullOrEmpty(Info.Image))
self.World.AddFrameEndTask(w => w.Add(new SpriteEffect(pos, self.World, Info.Image,
Info.Sequences.Random(Game.CosmeticRandom), Info.Palette)));
Info.Sequences.Random(Game.CosmeticRandom), Info.Palette, Info.VisibleThroughFog)));
cachedPosition = self.CenterPosition;
ticks = 0;