Fixes order lines not being shown after reselect once their lifetime has expired.

Adds INotifyBecomingIdle.
This commit is contained in:
Pizzaoverhead
2014-02-15 19:17:21 +00:00
parent 9a8c9d1985
commit ed6147ce0b
5 changed files with 25 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Traits
public virtual object Create(ActorInitializer init) { return new DrawLineToTarget(init.self, this); }
}
public class DrawLineToTarget : IPostRenderSelection
public class DrawLineToTarget : IPostRenderSelection, INotifySelected, INotifyBecomingIdle
{
Actor self;
DrawLineToTargetInfo Info;
@@ -49,6 +49,12 @@ namespace OpenRA.Traits
lifetime = Info.Ticks;
}
public void Selected(Actor a)
{
// Reset the order line timeout.
lifetime = Info.Ticks;
}
public void RenderAfterWorld(WorldRenderer wr)
{
var force = Game.GetModifierKeys().HasModifier(Modifiers.Alt);
@@ -70,6 +76,12 @@ namespace OpenRA.Traits
wr.DrawTargetMarker(c, to);
}
}
public void OnBecomingIdle(Actor a)
{
if (a.IsIdle)
targets = null;
}
}
public static class LineTargetExts