Rename SelectionBarsRenderable to SelectionBarsAnnotationRenderable.
This commit is contained in:
@@ -15,7 +15,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.Common.Graphics
|
namespace OpenRA.Mods.Common.Graphics
|
||||||
{
|
{
|
||||||
public struct SelectionBarsRenderable : IRenderable, IFinalizedRenderable
|
public struct SelectionBarsAnnotationRenderable : IRenderable, IFinalizedRenderable
|
||||||
{
|
{
|
||||||
readonly WPos pos;
|
readonly WPos pos;
|
||||||
readonly Actor actor;
|
readonly Actor actor;
|
||||||
@@ -23,14 +23,14 @@ namespace OpenRA.Mods.Common.Graphics
|
|||||||
readonly bool displayExtra;
|
readonly bool displayExtra;
|
||||||
readonly Rectangle decorationBounds;
|
readonly Rectangle decorationBounds;
|
||||||
|
|
||||||
public SelectionBarsRenderable(Actor actor, Rectangle decorationBounds, bool displayHealth, bool displayExtra)
|
public SelectionBarsAnnotationRenderable(Actor actor, Rectangle decorationBounds, bool displayHealth, bool displayExtra)
|
||||||
: this(actor.CenterPosition, actor, decorationBounds)
|
: this(actor.CenterPosition, actor, decorationBounds)
|
||||||
{
|
{
|
||||||
this.displayHealth = displayHealth;
|
this.displayHealth = displayHealth;
|
||||||
this.displayExtra = displayExtra;
|
this.displayExtra = displayExtra;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SelectionBarsRenderable(WPos pos, Actor actor, Rectangle decorationBounds)
|
public SelectionBarsAnnotationRenderable(WPos pos, Actor actor, Rectangle decorationBounds)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
this.pos = pos;
|
this.pos = pos;
|
||||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Graphics
|
|||||||
|
|
||||||
public IRenderable WithPalette(PaletteReference newPalette) { return this; }
|
public IRenderable WithPalette(PaletteReference newPalette) { return this; }
|
||||||
public IRenderable WithZOffset(int newOffset) { return this; }
|
public IRenderable WithZOffset(int newOffset) { return this; }
|
||||||
public IRenderable OffsetBy(WVec vec) { return new SelectionBarsRenderable(pos + vec, actor, decorationBounds); }
|
public IRenderable OffsetBy(WVec vec) { return new SelectionBarsAnnotationRenderable(pos + vec, actor, decorationBounds); }
|
||||||
public IRenderable AsDecoration() { return this; }
|
public IRenderable AsDecoration() { return this; }
|
||||||
|
|
||||||
void DrawExtraBars(WorldRenderer wr, float2 start, float2 end)
|
void DrawExtraBars(WorldRenderer wr, float2 start, float2 end)
|
||||||
@@ -109,7 +109,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
yield return new SelectionBoxRenderable(self, bounds, Info.SelectionBoxColor);
|
yield return new SelectionBoxRenderable(self, bounds, Info.SelectionBoxColor);
|
||||||
|
|
||||||
if (Info.RenderSelectionBars && (displayHealth || displayExtra))
|
if (Info.RenderSelectionBars && (displayHealth || displayExtra))
|
||||||
yield return new SelectionBarsRenderable(self, bounds, displayHealth, displayExtra);
|
yield return new SelectionBarsAnnotationRenderable(self, bounds, displayHealth, displayExtra);
|
||||||
|
|
||||||
// Target lines and pips are always only displayed for selected allied actors
|
// Target lines and pips are always only displayed for selected allied actors
|
||||||
if (!selected || !self.Owner.IsAlliedWith(wr.World.RenderPlayer))
|
if (!selected || !self.Owner.IsAlliedWith(wr.World.RenderPlayer))
|
||||||
@@ -125,7 +125,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
public void DrawRollover(Actor self, WorldRenderer worldRenderer)
|
public void DrawRollover(Actor self, WorldRenderer worldRenderer)
|
||||||
{
|
{
|
||||||
var bounds = decorationBounds.FirstNonEmptyBounds(self, worldRenderer);
|
var bounds = decorationBounds.FirstNonEmptyBounds(self, worldRenderer);
|
||||||
new SelectionBarsRenderable(self, bounds, true, true).Render(worldRenderer);
|
new SelectionBarsAnnotationRenderable(self, bounds, true, true).Render(worldRenderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<IRenderable> DrawPips(Actor self, Rectangle bounds, WorldRenderer wr)
|
IEnumerable<IRenderable> DrawPips(Actor self, Rectangle bounds, WorldRenderer wr)
|
||||||
|
|||||||
Reference in New Issue
Block a user