From 71c804781e5e448977a44cd7fdc698ef4c3188d3 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sat, 23 Jan 2016 13:41:18 +0100 Subject: [PATCH] Unhardcode the "PrimaryBuildingSelected" notification --- OpenRA.Mods.Common/Traits/Buildings/PrimaryBuilding.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Buildings/PrimaryBuilding.cs b/OpenRA.Mods.Common/Traits/Buildings/PrimaryBuilding.cs index 9255081878..3e72923c53 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/PrimaryBuilding.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/PrimaryBuilding.cs @@ -30,6 +30,9 @@ namespace OpenRA.Mods.Common.Traits [UpgradeGrantedReference, Desc("The upgrades to grant while the primary building.")] public readonly string[] Upgrades = { "primary" }; + [Desc("The speech notification to play when selecting a primary building.")] + public readonly string SelectionNotification = "PrimaryBuildingSelected"; + public object Create(ActorInitializer init) { return new PrimaryBuilding(init.Self, this); } } @@ -93,7 +96,7 @@ namespace OpenRA.Mods.Common.Traits foreach (var up in info.Upgrades) manager.GrantUpgrade(self, up, this); - Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", "PrimaryBuildingSelected", self.Owner.Faction.InternalName); + Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SelectionNotification, self.Owner.Faction.InternalName); } } }