Include selection decorations when calculating ScreenMap bounds.
This commit is contained in:
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
public override object Create(ActorInitializer init) { return new IsometricSelectionDecorations(init.Self, this); }
|
public override object Create(ActorInitializer init) { return new IsometricSelectionDecorations(init.Self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class IsometricSelectionDecorations : SelectionDecorationsBase
|
public class IsometricSelectionDecorations : SelectionDecorationsBase, IRender
|
||||||
{
|
{
|
||||||
readonly IsometricSelectable selectable;
|
readonly IsometricSelectable selectable;
|
||||||
|
|
||||||
@@ -61,5 +61,15 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
var bounds = selectable.DecorationBounds(self, wr);
|
var bounds = selectable.DecorationBounds(self, wr);
|
||||||
yield return new IsometricSelectionBarsAnnotationRenderable(self, bounds, displayHealth, displayExtra);
|
yield return new IsometricSelectionBarsAnnotationRenderable(self, bounds, displayHealth, displayExtra);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IEnumerable<IRenderable> IRender.Render(Actor self, WorldRenderer wr)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerable<Rectangle> IRender.ScreenBounds(Actor self, WorldRenderer wr)
|
||||||
|
{
|
||||||
|
yield return selectable.DecorationBounds(self, wr).BoundingRect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
public override object Create(ActorInitializer init) { return new SelectionDecorations(init.Self, this); }
|
public override object Create(ActorInitializer init) { return new SelectionDecorations(init.Self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SelectionDecorations : SelectionDecorationsBase
|
public class SelectionDecorations : SelectionDecorationsBase, IRender
|
||||||
{
|
{
|
||||||
readonly Interactable interactable;
|
readonly Interactable interactable;
|
||||||
|
|
||||||
@@ -62,5 +62,15 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
var bounds = interactable.DecorationBounds(self, wr);
|
var bounds = interactable.DecorationBounds(self, wr);
|
||||||
yield return new SelectionBarsAnnotationRenderable(self, bounds, displayHealth, displayExtra);
|
yield return new SelectionBarsAnnotationRenderable(self, bounds, displayHealth, displayExtra);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IEnumerable<IRenderable> IRender.Render(Actor self, WorldRenderer wr)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerable<Rectangle> IRender.ScreenBounds(Actor self, WorldRenderer wr)
|
||||||
|
{
|
||||||
|
yield return interactable.DecorationBounds(self, wr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user