diff --git a/OpenRA.Game/Graphics/WorldRenderer.cs b/OpenRA.Game/Graphics/WorldRenderer.cs index 1c2bdf7b9a..ca906377fb 100644 --- a/OpenRA.Game/Graphics/WorldRenderer.cs +++ b/OpenRA.Game/Graphics/WorldRenderer.cs @@ -204,12 +204,6 @@ namespace OpenRA.Graphics Game.Renderer.Flush(); } - public void DrawRollover(Actor unit) - { - if (unit.Info.HasTraitInfo()) - new SelectionBarsRenderable(unit, true, true).Render(this); - } - public void RefreshPalette() { palette.ApplyModifiers(World.WorldActor.TraitsImplementing()); diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index e7c78008ac..99ad8281ad 100644 --- a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs @@ -33,13 +33,20 @@ namespace OpenRA.Widgets this.worldRenderer = worldRenderer; } + void DrawRollover(Actor unit) + { + // TODO: Integrate this with SelectionDecorations to unhardcode the *Renderable + if (unit.Info.HasTraitInfo()) + new SelectionBarsRenderable(unit, true, true).Render(worldRenderer); + } + public override void Draw() { if (!IsDragging) { // Render actors under the mouse pointer foreach (var u in SelectActorsInBoxWithDeadzone(World, lastMousePosition, lastMousePosition)) - worldRenderer.DrawRollover(u); + DrawRollover(u); return; } @@ -48,7 +55,7 @@ namespace OpenRA.Widgets var selbox = SelectionBox; Game.Renderer.WorldLineRenderer.DrawRect(selbox.Value.First.ToFloat2(), selbox.Value.Second.ToFloat2(), Color.White); foreach (var u in SelectActorsInBoxWithDeadzone(World, selbox.Value.First, selbox.Value.Second)) - worldRenderer.DrawRollover(u); + DrawRollover(u); } public override bool HandleMouseInput(MouseInput mi)