diff --git a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs index d74c51d4c0..30cda1ca69 100644 --- a/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/PlaceBuildingOrderGenerator.cs @@ -166,6 +166,7 @@ namespace OpenRA.Mods.Common.Orders var owner = Queue.Actor.Owner; var ai = variants[variant].ActorInfo; var bi = variants[variant].BuildingInfo; + var notification = Queue.Info.CannotPlaceAudio ?? placeBuildingInfo.CannotPlaceNotification; if (mi.Button == MouseButton.Left) { @@ -178,7 +179,7 @@ namespace OpenRA.Mods.Common.Orders orderType = "PlacePlug"; if (!AcceptsPlug(topLeft, plugInfo)) { - Game.Sound.PlayNotification(world.Map.Rules, owner, "Speech", placeBuildingInfo.CannotPlaceNotification, owner.Faction.InternalName); + Game.Sound.PlayNotification(world.Map.Rules, owner, "Speech", notification, owner.Faction.InternalName); yield break; } } @@ -190,7 +191,7 @@ namespace OpenRA.Mods.Common.Orders foreach (var order in ClearBlockersOrders(world, topLeft)) yield return order; - Game.Sound.PlayNotification(world.Map.Rules, owner, "Speech", placeBuildingInfo.CannotPlaceNotification, owner.Faction.InternalName); + Game.Sound.PlayNotification(world.Map.Rules, owner, "Speech", notification, owner.Faction.InternalName); yield break; } diff --git a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs index 7f6306f377..009f511c9c 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProductionQueue.cs @@ -73,6 +73,12 @@ namespace OpenRA.Mods.Common.Traits "The filename of the audio is defined per faction in notifications.yaml.")] public readonly string LimitedAudio = null; + [NotificationReference("Speech")] + [Desc("Notification played when you can't place a building.", + "Overrides PlaceBuilding.CannotPlaceNotification for this queue.", + "The filename of the audio is defined per faction in notifications.yaml.")] + public readonly string CannotPlaceAudio = 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.")]