Add a lint test for audio notifications.
Only traits are linted - the UI still hardcodes too many audio references for this to be worthwhile.
This commit is contained in:
@@ -26,9 +26,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Length of time (in ticks) to display a location ping in the minimap.")]
|
||||
public readonly int RadarPingDuration = 10 * 25;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("The audio notification type to play.")]
|
||||
public string Notification = "BaseAttack";
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("The audio notification to play to allies when under attack.",
|
||||
"Won't play a notification to allies if this is null.")]
|
||||
public string AllyNotification = null;
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Length of time (in ticks) to display a location ping in the minimap.")]
|
||||
public readonly int RadarPingDuration = 10 * 25;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("The audio notification type to play.")]
|
||||
public string Notification = "HarvesterAttack";
|
||||
|
||||
|
||||
@@ -48,8 +48,13 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Delay between the game over condition being met, and the game actually ending, in milliseconds.")]
|
||||
public readonly int GameOverDelay = 1500;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
public readonly string WinNotification = null;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
public readonly string LoseNotification = null;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
public readonly string LeaveNotification = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new MissionObjectives(init.World, this); }
|
||||
|
||||
@@ -18,7 +18,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class PlaceBeaconInfo : ITraitInfo
|
||||
{
|
||||
public readonly int Duration = 30 * 25;
|
||||
|
||||
public readonly string NotificationType = "Sounds";
|
||||
|
||||
[NotificationReference(typeFromField: "NotificationType")]
|
||||
public readonly string Notification = "Beacon";
|
||||
|
||||
public readonly bool IsPlayerPalette = true;
|
||||
|
||||
@@ -31,9 +31,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Play NewOptionsNotification this many ticks after building placement.")]
|
||||
public readonly int NewOptionsNotificationDelay = 10;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Notification to play after building placement if new construction options are available.")]
|
||||
public readonly string NewOptionsNotification = null;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
public readonly string CannotPlaceNotification = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new PlaceBuilding(this); }
|
||||
|
||||
@@ -41,13 +41,17 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Display order for the DefaultCash option.")]
|
||||
public readonly int DefaultCashDropdownDisplayOrder = 0;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Speech notification to play when the player does not have any funds.")]
|
||||
public readonly string InsufficientFundsNotification = null;
|
||||
|
||||
[Desc("Delay (in ticks) during which warnings will be muted.")]
|
||||
public readonly int InsufficientFundsNotificationDelay = 750;
|
||||
|
||||
[NotificationReference("Sounds")]
|
||||
public readonly string CashTickUpNotification = null;
|
||||
|
||||
[NotificationReference("Sounds")]
|
||||
public readonly string CashTickDownNotification = null;
|
||||
|
||||
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(Ruleset rules)
|
||||
|
||||
@@ -50,28 +50,34 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("The build time is multiplied with this value on low power.")]
|
||||
public readonly int LowPowerSlowdown = 3;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Notification played when production is complete.",
|
||||
"The filename of the audio is defined per faction in notifications.yaml.")]
|
||||
public readonly string ReadyAudio = null;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Notification played when you can't train another actor",
|
||||
"when the build limit exceeded or the exit is jammed.",
|
||||
"The filename of the audio is defined per faction in notifications.yaml.")]
|
||||
public readonly string BlockedAudio = null;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Notification played when you can't queue another actor",
|
||||
"when the queue length limit is exceeded.",
|
||||
"The filename of the audio is defined per faction in notifications.yaml.")]
|
||||
public readonly string LimitedAudio = null;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Notification played when user clicks on the build palette icon.",
|
||||
"The filename of the audio is defined per faction in notifications.yaml.")]
|
||||
public readonly string QueuedAudio = null;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Notification played when player right-clicks on the build palette icon.",
|
||||
"The filename of the audio is defined per faction in notifications.yaml.")]
|
||||
public readonly string OnHoldAudio = null;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("Notification played when player right-clicks on a build palette icon that is already on hold.",
|
||||
"The filename of the audio is defined per faction in notifications.yaml.")]
|
||||
public readonly string CancelledAudio = null;
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("The percentage threshold above which a warning is played.")]
|
||||
public readonly int Threshold = 80;
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("The speech to play for the warning.")]
|
||||
public readonly string Notification = "SilosNeeded";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user