Introduce Order.SuppressVisualFeedback to cleanly disable flashes.
This commit is contained in:
@@ -45,6 +45,7 @@ namespace OpenRA
|
||||
public CPos ExtraLocation;
|
||||
public uint ExtraData;
|
||||
public bool IsImmediate;
|
||||
public bool SuppressVisualFeedback;
|
||||
|
||||
public Player Player { get { return Subject.Owner; } }
|
||||
|
||||
|
||||
@@ -152,14 +152,14 @@ namespace OpenRA.Widgets
|
||||
if (o == null)
|
||||
continue;
|
||||
|
||||
if (!flashed)
|
||||
if (!flashed && !o.SuppressVisualFeedback)
|
||||
{
|
||||
if (o.TargetActor != null)
|
||||
{
|
||||
world.AddFrameEndTask(w => w.Add(new FlashTarget(o.TargetActor)));
|
||||
flashed = true;
|
||||
}
|
||||
else if (o.Subject != world.LocalPlayer.PlayerActor && o.TargetLocation != CPos.Zero) // TODO: this filters building placement, but also suppport powers :(
|
||||
else if (o.TargetLocation != CPos.Zero)
|
||||
{
|
||||
world.AddFrameEndTask(w => w.Add(new MoveFlash(worldRenderer.Position(worldRenderer.Viewport.ViewToWorldPx(mi.Location)), world)));
|
||||
flashed = true;
|
||||
|
||||
@@ -84,7 +84,8 @@ namespace OpenRA.Mods.RA.AI
|
||||
ai.world.IssueOrder(new Order("PlaceBuilding", ai.p.PlayerActor, false)
|
||||
{
|
||||
TargetLocation = location.Value,
|
||||
TargetString = currentBuilding.Item
|
||||
TargetString = currentBuilding.Item,
|
||||
SuppressVisualFeedback = true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ namespace OpenRA.Mods.RA.AI
|
||||
p.PlayerName, buildings.Length);
|
||||
|
||||
foreach (var a in buildings)
|
||||
world.IssueOrder(new Order("SetRallyPoint", a.Actor, false) { TargetLocation = ChooseRallyLocationNear(a.Actor.Location) });
|
||||
world.IssueOrder(new Order("SetRallyPoint", a.Actor, false) { TargetLocation = ChooseRallyLocationNear(a.Actor.Location), SuppressVisualFeedback = true });
|
||||
}
|
||||
|
||||
// Won't work for shipyards...
|
||||
@@ -773,7 +773,7 @@ namespace OpenRA.Mods.RA.AI
|
||||
if (attackLocation == null)
|
||||
return;
|
||||
|
||||
world.IssueOrder(new Order(sp.Info.OrderName, supportPowerMngr.self, false) { TargetLocation = attackLocation.Value });
|
||||
world.IssueOrder(new Order(sp.Info.OrderName, supportPowerMngr.self, false) { TargetLocation = attackLocation.Value, SuppressVisualFeedback = true });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA.Orders
|
||||
if (!world.ShroudObscures(xy))
|
||||
{
|
||||
world.CancelInputMode();
|
||||
yield return new Order("PlaceBeacon", world.LocalPlayer.PlayerActor, false) { TargetLocation = xy };
|
||||
yield return new Order("PlaceBeacon", world.LocalPlayer.PlayerActor, false) { TargetLocation = xy, SuppressVisualFeedback = true };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,8 +62,12 @@ namespace OpenRA.Mods.RA.Orders
|
||||
}
|
||||
|
||||
var isLineBuild = world.Map.Rules.Actors[Building].Traits.Contains<LineBuildInfo>();
|
||||
yield return new Order(isLineBuild ? "LineBuild" : "PlaceBuilding",
|
||||
Producer.Owner.PlayerActor, false) { TargetLocation = topLeft, TargetString = Building };
|
||||
yield return new Order(isLineBuild ? "LineBuild" : "PlaceBuilding", Producer.Owner.PlayerActor, false)
|
||||
{
|
||||
TargetLocation = topLeft,
|
||||
TargetString = Building,
|
||||
SuppressVisualFeedback = true
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.RA
|
||||
public Order IssueOrder( Actor self, IOrderTargeter order, Target target, bool queued )
|
||||
{
|
||||
if (order.OrderID == "SetRallyPoint")
|
||||
return new Order(order.OrderID, self, false) { TargetLocation = target.CenterPosition.ToCPos() };
|
||||
return new Order(order.OrderID, self, false) { TargetLocation = target.CenterPosition.ToCPos(), SuppressVisualFeedback = true };
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,8 @@ namespace OpenRA.Mods.RA
|
||||
yield return new Order(order, manager.self, false)
|
||||
{
|
||||
TargetLocation = xy,
|
||||
ExtraLocation = sourceLocation
|
||||
ExtraLocation = sourceLocation,
|
||||
SuppressVisualFeedback = true
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
world.CancelInputMode();
|
||||
if (mi.Button == MouseButton.Left && power.UnitsInRange(xy).Any())
|
||||
yield return new Order(order, manager.self, false) { TargetLocation = xy };
|
||||
yield return new Order(order, manager.self, false) { TargetLocation = xy, SuppressVisualFeedback = true };
|
||||
}
|
||||
|
||||
public void Tick(World world)
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
world.CancelInputMode();
|
||||
if (mi.Button == expectedButton && world.Map.IsInMap(xy))
|
||||
yield return new Order(order, manager.self, false) { TargetLocation = xy };
|
||||
yield return new Order(order, manager.self, false) { TargetLocation = xy, SuppressVisualFeedback = true };
|
||||
}
|
||||
|
||||
public virtual void Tick(World world)
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
// HACK: Abuse of the type system here with `CPos`
|
||||
world.IssueOrder(new Order("SetStance", world.LocalPlayer.PlayerActor, false)
|
||||
{ TargetLocation = new CPos((int)ss, 0), TargetString = p.InternalName });
|
||||
{ TargetLocation = new CPos((int)ss, 0), TargetString = p.InternalName, SuppressVisualFeedback = true });
|
||||
|
||||
bw.Text = ss.ToString();
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace OpenRA.Mods.RA.Widgets
|
||||
at.PredictedStance = nextStance;
|
||||
|
||||
// FIXME: Abuse of the type system here with `CPos`
|
||||
return new Order("SetUnitStance", a, false) { TargetLocation = new CPos((int)nextStance, 0) };
|
||||
return new Order("SetUnitStance", a, false) { TargetLocation = new CPos((int)nextStance, 0), SuppressVisualFeedback = true };
|
||||
});
|
||||
|
||||
Game.Debug("Unit stance set to: {0}".F(nextStance));
|
||||
|
||||
Reference in New Issue
Block a user