Unhardcode player beacons for documentation and lint testing.

This commit is contained in:
Matthias Mailänder
2016-04-24 23:42:57 +02:00
parent 76124b7c79
commit 9f4cdb9843
7 changed files with 26 additions and 10 deletions

View File

@@ -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))

View File

@@ -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);

View File

@@ -138,6 +138,8 @@ namespace OpenRA.Mods.Common.Traits
Info.BeaconImage,
Info.BeaconPoster,
Info.BeaconPosterPalette,
Info.ArrowSequence,
Info.CircleSequence,
Info.ClockSequence,
() => missile.FractionComplete);

View File

@@ -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.")]