Rename and tweak post-render interfaces.

This commit is contained in:
Paul Chote
2016-08-22 16:50:49 +01:00
parent f1990853df
commit 11805bb567
24 changed files with 129 additions and 143 deletions

View File

@@ -20,14 +20,14 @@ 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 : IPostRender, IWorldLoaded, IChatCommand
public class TerrainGeometryOverlay : IRenderAboveWorld, IWorldLoaded, IChatCommand
{
const string CommandName = "terrainoverlay";
const string CommandDesc = "Toggles the terrain geometry overlay";
public bool Enabled;
public void WorldLoaded(World w, WorldRenderer wr)
void IWorldLoaded.WorldLoaded(World w, WorldRenderer wr)
{
var console = w.WorldActor.TraitOrDefault<ChatCommands>();
var help = w.WorldActor.TraitOrDefault<HelpCommand>();
@@ -39,13 +39,13 @@ namespace OpenRA.Mods.Common.Traits
help.RegisterHelp(CommandName, CommandDesc);
}
public void InvokeCommand(string name, string arg)
void IChatCommand.InvokeCommand(string name, string arg)
{
if (name == CommandName)
Enabled ^= true;
}
public void RenderAfterWorld(WorldRenderer wr, Actor self)
void IRenderAboveWorld.RenderAboveWorld(Actor self, WorldRenderer wr)
{
if (!Enabled)
return;