Migrate traits to IRenderAnnotations.

This commit is contained in:
Paul Chote
2019-09-14 09:26:14 +01:00
committed by abcdefg30
parent edaa7918fc
commit 1dc84f48de
19 changed files with 90 additions and 79 deletions

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Renders a debug overlay showing the terrain cells. Attach this to the world actor.")]
public class TerrainGeometryOverlayInfo : TraitInfo<TerrainGeometryOverlay> { }
public class TerrainGeometryOverlay : IRenderAboveShroud, IWorldLoaded, IChatCommand
public class TerrainGeometryOverlay : IRenderAnnotations, IWorldLoaded, IChatCommand
{
const string CommandName = "terrainoverlay";
const string CommandDesc = "toggles the terrain geometry overlay.";
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Traits
Enabled ^= true;
}
IEnumerable<IRenderable> IRenderAboveShroud.RenderAboveShroud(Actor self, WorldRenderer wr)
IEnumerable<IRenderable> IRenderAnnotations.RenderAnnotations(Actor self, WorldRenderer wr)
{
if (!Enabled)
yield break;
@@ -98,6 +98,6 @@ namespace OpenRA.Mods.Common.Traits
}
}
bool IRenderAboveShroud.SpatiallyPartitionable { get { return false; } }
bool IRenderAnnotations.SpatiallyPartitionable { get { return false; } }
}
}