Separate ping lifetime from beacons. Fixes #5424.

This commit is contained in:
Paul Chote
2014-05-24 23:05:22 +12:00
parent f5badcfc98
commit cb13335b8d

View File

@@ -37,6 +37,7 @@ namespace OpenRA.Mods.RA
public readonly string BeaconPoster = null; public readonly string BeaconPoster = null;
public readonly string BeaconPosterPalette = "chrome"; public readonly string BeaconPosterPalette = "chrome";
public readonly bool DisplayRadarPing = false; public readonly bool DisplayRadarPing = false;
public readonly int RadarPingDuration = 5 * 25;
public readonly string OrderName; public readonly string OrderName;
public abstract object Create(ActorInitializer init); public abstract object Create(ActorInitializer init);
@@ -49,6 +50,7 @@ namespace OpenRA.Mods.RA
public readonly Actor self; public readonly Actor self;
public readonly SupportPowerInfo Info; public readonly SupportPowerInfo Info;
protected Beacon beacon; protected Beacon beacon;
protected RadarPing ping;
public SupportPower(Actor self, SupportPowerInfo info) public SupportPower(Actor self, SupportPowerInfo info)
{ {
@@ -82,11 +84,11 @@ namespace OpenRA.Mods.RA
} }
if (Info.DisplayRadarPing && manager.RadarPings != null) if (Info.DisplayRadarPing && manager.RadarPings != null)
manager.RadarPings.Value.Add( ping = manager.RadarPings.Value.Add(
() => order.Player.IsAlliedWith(self.World.RenderPlayer), () => order.Player.IsAlliedWith(self.World.RenderPlayer),
order.TargetLocation.CenterPosition, order.TargetLocation.CenterPosition,
order.Player.Color.RGB, order.Player.Color.RGB,
Info.BeaconDuration); Info.RadarPingDuration);
} }
public virtual IOrderGenerator OrderGenerator(string order, SupportPowerManager manager) public virtual IOrderGenerator OrderGenerator(string order, SupportPowerManager manager)