Replace DrawTargetLine checkbox with an Automatic/Manual/Disabled dropdown.

This commit is contained in:
Paul Chote
2019-08-07 10:32:55 +00:00
committed by teinarss
parent 2909445452
commit 95ca14d4a3
6 changed files with 63 additions and 22 deletions

View File

@@ -45,6 +45,9 @@ namespace OpenRA.Mods.Common.Traits
public void ShowTargetLines(Actor self)
{
if (Game.Settings.Game.TargetLines < TargetLinesType.Automatic)
return;
// Target lines are only automatically shown for the owning player
// Spectators and allies must use the force-display modifier
if (self.IsIdle || self.Owner != self.World.LocalPlayer)
@@ -61,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits
IEnumerable<IRenderable> IRenderAboveShroudWhenSelected.RenderAboveShroud(Actor self, WorldRenderer wr)
{
if (!self.Owner.IsAlliedWith(self.World.LocalPlayer))
if (!self.Owner.IsAlliedWith(self.World.LocalPlayer) || Game.Settings.Game.TargetLines == TargetLinesType.Disabled)
return Enumerable.Empty<IRenderable>();
// Players want to see the lines when in waypoint mode.
@@ -70,9 +73,6 @@ namespace OpenRA.Mods.Common.Traits
if (--lifetime <= 0 && !force)
return Enumerable.Empty<IRenderable>();
if (!(force || Game.Settings.Game.DrawTargetLine))
return Enumerable.Empty<IRenderable>();
renderableCache.Clear();
var prev = self.CenterPosition;
var a = self.CurrentActivity;