From 2259a0e7a56a492e23280cc4115eb8ae2b8bde8f Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 12 Jul 2011 20:13:54 +1200 Subject: [PATCH] remove duplication of DrawSelectionBox --- OpenRA.Game/Traits/Selectable.cs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/OpenRA.Game/Traits/Selectable.cs b/OpenRA.Game/Traits/Selectable.cs index 4c374720cb..2a4d9f6a1f 100644 --- a/OpenRA.Game/Traits/Selectable.cs +++ b/OpenRA.Game/Traits/Selectable.cs @@ -36,7 +36,6 @@ namespace OpenRA.Traits var xy = new float2(bounds.Left, bounds.Top); var Xy = new float2(bounds.Right, bounds.Top); var xY = new float2(bounds.Left, bounds.Bottom); - var XY = new float2(bounds.Right, bounds.Bottom); var colorResults = self.TraitsImplementing().Select(t => t.GetSelectionColorModifier(self, selectionColor)).Where( c => c.ToArgb() != selectionColor.ToArgb()); @@ -44,7 +43,7 @@ namespace OpenRA.Traits if (colorResults.Any()) selectionColor = colorResults.First(); - DrawSelectionBox(self, xy, Xy, xY, XY, selectionColor); + wr.DrawSelectionBox(self, selectionColor); DrawHealthBar(self, xy, Xy); DrawControlGroup(wr, self, xy); DrawPips(wr, self, xY); @@ -78,19 +77,6 @@ namespace OpenRA.Traits } } - void DrawSelectionBox(Actor self, float2 xy, float2 Xy, float2 xY, float2 XY, Color c) - { - Game.Renderer.LineRenderer.DrawLine(xy, xy + new float2(4, 0), c, c); - Game.Renderer.LineRenderer.DrawLine(xy, xy + new float2(0, 4), c, c); - Game.Renderer.LineRenderer.DrawLine(Xy, Xy + new float2(-4, 0), c, c); - Game.Renderer.LineRenderer.DrawLine(Xy, Xy + new float2(0, 4), c, c); - - Game.Renderer.LineRenderer.DrawLine(xY, xY + new float2(4, 0), c, c); - Game.Renderer.LineRenderer.DrawLine(xY, xY + new float2(0, -4), c, c); - Game.Renderer.LineRenderer.DrawLine(XY, XY + new float2(-4, 0), c, c); - Game.Renderer.LineRenderer.DrawLine(XY, XY + new float2(0, -4), c, c); - } - void DrawSelectionBar(Actor self, float2 xy, float2 Xy, float value, Color barColor) { if (!self.IsInWorld) return;