From 8565b7be0c4b5af65d2314aae48645f4ca1ad5bb Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 26 Nov 2010 12:59:22 +1300 Subject: [PATCH] Always render actor selection boxes. --- OpenRA.Game/Graphics/WorldRenderer.cs | 5 +++++ OpenRA.Game/Orders/GenericSelectTarget.cs | 10 +--------- OpenRA.Game/Orders/UnitOrderGenerator.cs | 7 +------ 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/OpenRA.Game/Graphics/WorldRenderer.cs b/OpenRA.Game/Graphics/WorldRenderer.cs index 53be597178..442b9521bc 100644 --- a/OpenRA.Game/Graphics/WorldRenderer.cs +++ b/OpenRA.Game/Graphics/WorldRenderer.cs @@ -107,6 +107,11 @@ namespace OpenRA.Graphics foreach (var t in a.TraitsImplementing()) t.RenderAfterWorld(this, a); + foreach (var a in world.Selection.Actors) + if (!a.Destroyed) + foreach (var t in a.TraitsImplementing()) + t.RenderAfterWorld(this, a); + if (world.OrderGenerator != null) world.OrderGenerator.RenderAfterWorld(this, world); diff --git a/OpenRA.Game/Orders/GenericSelectTarget.cs b/OpenRA.Game/Orders/GenericSelectTarget.cs index 15af275790..7999a2e196 100644 --- a/OpenRA.Game/Orders/GenericSelectTarget.cs +++ b/OpenRA.Game/Orders/GenericSelectTarget.cs @@ -77,15 +77,7 @@ namespace OpenRA.Orders Game.Renderer.Flush(); } - public void RenderAfterWorld(WorldRenderer wr, World world) - { - foreach (var a in world.Selection.Actors) - if (!a.Destroyed) - foreach (var t in a.TraitsImplementing()) - t.RenderAfterWorld(wr, a); - - Game.Renderer.Flush(); - } + public void RenderAfterWorld(WorldRenderer wr, World world) {} public string GetCursor(World world, int2 xy, MouseInput mi) { return world.Map.IsInMap(xy) ? cursor : "generic-blocked"; } } diff --git a/OpenRA.Game/Orders/UnitOrderGenerator.cs b/OpenRA.Game/Orders/UnitOrderGenerator.cs index b3c67743d6..537b6cc03f 100644 --- a/OpenRA.Game/Orders/UnitOrderGenerator.cs +++ b/OpenRA.Game/Orders/UnitOrderGenerator.cs @@ -90,12 +90,7 @@ namespace OpenRA.Orders custom.RenderAfterWorld(wr, world); return; } - - foreach (var a in world.Selection.Actors) - if (!a.Destroyed) - foreach (var t in a.TraitsImplementing()) - t.RenderAfterWorld( wr, a ); - + Game.Renderer.Flush(); }