Unhardcode player beacons for documentation and lint testing.
This commit is contained in:
@@ -19,8 +19,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly int Duration = 30 * 25;
|
||||
public readonly string NotificationType = "Sounds";
|
||||
public readonly string Notification = "Beacon";
|
||||
|
||||
[PaletteReference(true)]
|
||||
public readonly string PalettePrefix = "player";
|
||||
|
||||
public readonly string BeaconImage = "beacon";
|
||||
[SequenceReference("BeaconImage")] public readonly string ArrowSequence = "arrow";
|
||||
[SequenceReference("BeaconImage")] public readonly string CircleSequence = "circles";
|
||||
|
||||
public object Create(ActorInitializer init) { return new PlaceBeacon(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -50,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (playerBeacon != null)
|
||||
self.World.Remove(playerBeacon);
|
||||
|
||||
playerBeacon = new Beacon(self.Owner, pos, info.Duration, info.PalettePrefix);
|
||||
playerBeacon = new Beacon(self.Owner, pos, info.Duration, info.PalettePrefix, info.BeaconImage, info.ArrowSequence, info.CircleSequence);
|
||||
self.World.Add(playerBeacon);
|
||||
|
||||
if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
|
||||
|
||||
@@ -173,6 +173,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Info.BeaconImage,
|
||||
Info.BeaconPoster,
|
||||
Info.BeaconPosterPalette,
|
||||
Info.ArrowSequence,
|
||||
Info.CircleSequence,
|
||||
Info.ClockSequence,
|
||||
() => 1 - ((distanceTestActor.CenterPosition - target).HorizontalLength - info.BeaconDistanceOffset.Length) * 1f / distance);
|
||||
|
||||
|
||||
@@ -138,6 +138,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Info.BeaconImage,
|
||||
Info.BeaconPoster,
|
||||
Info.BeaconPosterPalette,
|
||||
Info.ArrowSequence,
|
||||
Info.CircleSequence,
|
||||
Info.ClockSequence,
|
||||
() => missile.FractionComplete);
|
||||
|
||||
|
||||
@@ -51,6 +51,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[PaletteReference] public readonly string BeaconPosterPalette = "chrome";
|
||||
[SequenceReference("BeaconImage")] public readonly string ClockSequence = "clock";
|
||||
|
||||
[SequenceReference("BeaconImage")] public readonly string ArrowSequence = "arrow";
|
||||
[SequenceReference("BeaconImage")] public readonly string CircleSequence = "circles";
|
||||
|
||||
public readonly bool DisplayRadarPing = false;
|
||||
|
||||
[Desc("Measured in ticks.")]
|
||||
|
||||
Reference in New Issue
Block a user