Always render actor selection boxes.

This commit is contained in:
Paul Chote
2010-11-26 12:59:22 +13:00
parent a3861823c9
commit 8565b7be0c
3 changed files with 7 additions and 15 deletions

View File

@@ -107,6 +107,11 @@ namespace OpenRA.Graphics
foreach (var t in a.TraitsImplementing<IPostRender>()) foreach (var t in a.TraitsImplementing<IPostRender>())
t.RenderAfterWorld(this, a); t.RenderAfterWorld(this, a);
foreach (var a in world.Selection.Actors)
if (!a.Destroyed)
foreach (var t in a.TraitsImplementing<IPostRenderSelection>())
t.RenderAfterWorld(this, a);
if (world.OrderGenerator != null) if (world.OrderGenerator != null)
world.OrderGenerator.RenderAfterWorld(this, world); world.OrderGenerator.RenderAfterWorld(this, world);

View File

@@ -77,15 +77,7 @@ namespace OpenRA.Orders
Game.Renderer.Flush(); Game.Renderer.Flush();
} }
public void RenderAfterWorld(WorldRenderer wr, World world) public void RenderAfterWorld(WorldRenderer wr, World world) {}
{
foreach (var a in world.Selection.Actors)
if (!a.Destroyed)
foreach (var t in a.TraitsImplementing<IPostRenderSelection>())
t.RenderAfterWorld(wr, a);
Game.Renderer.Flush();
}
public string GetCursor(World world, int2 xy, MouseInput mi) { return world.Map.IsInMap(xy) ? cursor : "generic-blocked"; } public string GetCursor(World world, int2 xy, MouseInput mi) { return world.Map.IsInMap(xy) ? cursor : "generic-blocked"; }
} }

View File

@@ -90,12 +90,7 @@ namespace OpenRA.Orders
custom.RenderAfterWorld(wr, world); custom.RenderAfterWorld(wr, world);
return; return;
} }
foreach (var a in world.Selection.Actors)
if (!a.Destroyed)
foreach (var t in a.TraitsImplementing<IPostRenderSelection>())
t.RenderAfterWorld( wr, a );
Game.Renderer.Flush(); Game.Renderer.Flush();
} }