Merge pull request #13181 from pchote/repair-cursor-flash

Fix repair cursor visual feedback target.
This commit is contained in:
atlimit8
2017-04-25 16:52:10 -05:00
committed by GitHub
3 changed files with 5 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ namespace OpenRA
public uint ExtraData;
public bool IsImmediate;
public bool SuppressVisualFeedback;
public Actor VisualFeedbackTarget;
public Player Player { get { return Subject != null ? Subject.Owner : null; } }

View File

@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Orders
if (repairBuilding == null)
yield break;
yield return new Order(orderId, underCursor, false) { TargetActor = repairBuilding };
yield return new Order(orderId, underCursor, false) { TargetActor = repairBuilding, VisualFeedbackTarget = underCursor };
}
public void Tick(World world)

View File

@@ -194,9 +194,10 @@ namespace OpenRA.Mods.Common.Widgets
if (!flashed && !o.SuppressVisualFeedback)
{
if (o.TargetActor != null)
var visualTargetActor = o.VisualFeedbackTarget ?? o.TargetActor;
if (visualTargetActor != null)
{
world.AddFrameEndTask(w => w.Add(new FlashTarget(o.TargetActor)));
world.AddFrameEndTask(w => w.Add(new FlashTarget(visualTargetActor)));
flashed = true;
}
else if (o.TargetLocation != CPos.Zero)