diff --git a/OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs b/OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs index 2a26e00ab7..75c78a3f8d 100644 --- a/OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs +++ b/OpenRA.Mods.Cnc/Traits/SupportPowers/ChronoshiftPower.cs @@ -179,7 +179,7 @@ namespace OpenRA.Mods.Cnc.Traits if (unit.CanBeViewedByPlayer(manager.Self.Owner)) { var bounds = unit.TraitsImplementing().FirstNonEmptyBounds(unit, wr); - yield return new SelectionBoxRenderable(unit, bounds, Color.Red); + yield return new SelectionBoxAnnotationRenderable(unit, bounds, Color.Red); } } } @@ -302,7 +302,7 @@ namespace OpenRA.Mods.Cnc.Traits if (unit.CanBeViewedByPlayer(manager.Self.Owner)) { var bounds = unit.TraitsImplementing().FirstNonEmptyBounds(unit, wr); - yield return new SelectionBoxRenderable(unit, bounds, Color.Red); + yield return new SelectionBoxAnnotationRenderable(unit, bounds, Color.Red); } } } diff --git a/OpenRA.Mods.Common/Graphics/SelectionBoxRenderable.cs b/OpenRA.Mods.Common/Graphics/SelectionBoxAnnotationRenderable.cs similarity index 86% rename from OpenRA.Mods.Common/Graphics/SelectionBoxRenderable.cs rename to OpenRA.Mods.Common/Graphics/SelectionBoxAnnotationRenderable.cs index 06709608bb..6e9be1a75f 100644 --- a/OpenRA.Mods.Common/Graphics/SelectionBoxRenderable.cs +++ b/OpenRA.Mods.Common/Graphics/SelectionBoxAnnotationRenderable.cs @@ -14,16 +14,16 @@ using OpenRA.Primitives; namespace OpenRA.Mods.Common.Graphics { - public struct SelectionBoxRenderable : IRenderable, IFinalizedRenderable + public struct SelectionBoxAnnotationRenderable : IRenderable, IFinalizedRenderable { readonly WPos pos; readonly Rectangle decorationBounds; readonly Color color; - public SelectionBoxRenderable(Actor actor, Rectangle decorationBounds, Color color) + public SelectionBoxAnnotationRenderable(Actor actor, Rectangle decorationBounds, Color color) : this(actor.CenterPosition, decorationBounds, color) { } - public SelectionBoxRenderable(WPos pos, Rectangle decorationBounds, Color color) + public SelectionBoxAnnotationRenderable(WPos pos, Rectangle decorationBounds, Color color) { this.pos = pos; this.decorationBounds = decorationBounds; @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Graphics public IRenderable WithPalette(PaletteReference newPalette) { return this; } public IRenderable WithZOffset(int newOffset) { return this; } - public IRenderable OffsetBy(WVec vec) { return new SelectionBoxRenderable(pos + vec, decorationBounds, color); } + public IRenderable OffsetBy(WVec vec) { return new SelectionBoxAnnotationRenderable(pos + vec, decorationBounds, color); } public IRenderable AsDecoration() { return this; } public IFinalizedRenderable PrepareRender(WorldRenderer wr) { return this; } diff --git a/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs b/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs index ed96c4c396..06bb5f53bc 100644 --- a/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs +++ b/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs @@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Traits.Render var displayExtra = selected || (regularWorld && statusBars != StatusBarsType.Standard); if (Info.RenderSelectionBox && selected) - yield return new SelectionBoxRenderable(self, bounds, Info.SelectionBoxColor); + yield return new SelectionBoxAnnotationRenderable(self, bounds, Info.SelectionBoxColor); if (Info.RenderSelectionBars && (displayHealth || displayExtra)) yield return new SelectionBarsAnnotationRenderable(self, bounds, displayHealth, displayExtra); diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs index 0db34e80d5..618c208fb2 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/GrantExternalConditionPower.cs @@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Traits foreach (var unit in power.UnitsInRange(xy)) { var bounds = unit.TraitsImplementing().FirstNonEmptyBounds(unit, wr); - yield return new SelectionBoxRenderable(unit, bounds, Color.Red); + yield return new SelectionBoxAnnotationRenderable(unit, bounds, Color.Red); } } diff --git a/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs b/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs index 49a6cff8ea..e2306b5d3c 100644 --- a/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs +++ b/OpenRA.Mods.Common/Traits/World/EditorActorPreview.cs @@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits public readonly WPos CenterPosition; public readonly IReadOnlyDictionary Footprint; public readonly Rectangle Bounds; - public readonly SelectionBoxRenderable SelectionBox; + public readonly SelectionBoxAnnotationRenderable SelectionBox; public readonly ActorReference Actor; public string Tooltip @@ -94,7 +94,7 @@ namespace OpenRA.Mods.Common.Traits Bounds = r.Union(); - SelectionBox = new SelectionBoxRenderable(new WPos(CenterPosition.X, CenterPosition.Y, 8192), + SelectionBox = new SelectionBoxAnnotationRenderable(new WPos(CenterPosition.X, CenterPosition.Y, 8192), new Rectangle(Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height), Color.White); }