Rename SelectionBoxRenderable to SelectionBoxAnnotationRenderable.

This commit is contained in:
Paul Chote
2019-09-15 12:37:23 +01:00
committed by abcdefg30
parent 43e84c89ef
commit 1599eac66c
5 changed files with 10 additions and 10 deletions

View File

@@ -179,7 +179,7 @@ namespace OpenRA.Mods.Cnc.Traits
if (unit.CanBeViewedByPlayer(manager.Self.Owner))
{
var bounds = unit.TraitsImplementing<IDecorationBounds>().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<IDecorationBounds>().FirstNonEmptyBounds(unit, wr);
yield return new SelectionBoxRenderable(unit, bounds, Color.Red);
yield return new SelectionBoxAnnotationRenderable(unit, bounds, Color.Red);
}
}
}

View File

@@ -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; }

View File

@@ -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);

View File

@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Traits
foreach (var unit in power.UnitsInRange(xy))
{
var bounds = unit.TraitsImplementing<IDecorationBounds>().FirstNonEmptyBounds(unit, wr);
yield return new SelectionBoxRenderable(unit, bounds, Color.Red);
yield return new SelectionBoxAnnotationRenderable(unit, bounds, Color.Red);
}
}

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly WPos CenterPosition;
public readonly IReadOnlyDictionary<CPos, SubCell> 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);
}