Hide selection decorations when spectators zoom too far out.
This commit is contained in:
@@ -89,6 +89,8 @@ namespace OpenRA.Graphics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float MinZoom { get { return minZoom; } }
|
||||||
|
|
||||||
public void AdjustZoom(float dz)
|
public void AdjustZoom(float dz)
|
||||||
{
|
{
|
||||||
// Exponential ensures that equal positive and negative steps have the same effect
|
// Exponential ensures that equal positive and negative steps have the same effect
|
||||||
|
|||||||
@@ -109,6 +109,14 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
foreach (var r in RenderSelectionBars(self, wr, displayHealth, displayExtra))
|
foreach (var r in RenderSelectionBars(self, wr, displayHealth, displayExtra))
|
||||||
yield return r;
|
yield return r;
|
||||||
|
|
||||||
|
if (selected && self.World.LocalPlayer != null && self.World.LocalPlayer.PlayerActor.Trait<DeveloperMode>().PathDebug)
|
||||||
|
yield return new TargetLineRenderable(ActivityTargetPath(self), Color.Green);
|
||||||
|
|
||||||
|
// Hide decorations for spectators that zoom out further than the normal minimum level
|
||||||
|
// This avoids graphical glitches with pip rows and icons overlapping the selection box
|
||||||
|
if (wr.Viewport.Zoom < wr.Viewport.MinZoom)
|
||||||
|
yield break;
|
||||||
|
|
||||||
var renderDecorations = self.World.Selection.Contains(self) ? selectedDecorations : decorations;
|
var renderDecorations = self.World.Selection.Contains(self) ? selectedDecorations : decorations;
|
||||||
foreach (var kv in renderDecorations)
|
foreach (var kv in renderDecorations)
|
||||||
{
|
{
|
||||||
@@ -117,13 +125,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
foreach (var rr in r.RenderDecoration(self, wr, pos))
|
foreach (var rr in r.RenderDecoration(self, wr, pos))
|
||||||
yield return rr;
|
yield return rr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Target lines and pips are always only displayed for selected allied actors
|
|
||||||
if (!selected || !self.Owner.IsAlliedWith(wr.World.RenderPlayer))
|
|
||||||
yield break;
|
|
||||||
|
|
||||||
if (self.World.LocalPlayer != null && self.World.LocalPlayer.PlayerActor.Trait<DeveloperMode>().PathDebug)
|
|
||||||
yield return new TargetLineRenderable(ActivityTargetPath(self), Color.Green);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<IRenderable> ISelectionDecorations.RenderSelectionAnnotations(Actor self, WorldRenderer worldRenderer, Color color)
|
IEnumerable<IRenderable> ISelectionDecorations.RenderSelectionAnnotations(Actor self, WorldRenderer worldRenderer, Color color)
|
||||||
|
|||||||
Reference in New Issue
Block a user