From 5e5d784a31861bfe24a3b2feb7c8b73686b6d15d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 26 Oct 2014 21:31:47 +0100 Subject: [PATCH] unhardcode and self-document --- OpenRA.Mods.RA/Power/Player/PowerManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Power/Player/PowerManager.cs b/OpenRA.Mods.RA/Power/Player/PowerManager.cs index 2ef7790bca..05f2a38512 100644 --- a/OpenRA.Mods.RA/Power/Player/PowerManager.cs +++ b/OpenRA.Mods.RA/Power/Player/PowerManager.cs @@ -17,6 +17,8 @@ namespace OpenRA.Mods.RA.Power public class PowerManagerInfo : ITraitInfo, Requires { public readonly int AdviceInterval = 250; + public readonly string SpeechNotification = "LowPower"; + public object Create(ActorInitializer init) { return new PowerManager(init.self, this); } } @@ -118,7 +120,7 @@ namespace OpenRA.Mods.RA.Power if (--nextPowerAdviceTime <= 0) { if (lowPower) - Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", "LowPower", self.Owner.Country.Race); + Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SpeechNotification, self.Owner.Country.Race); nextPowerAdviceTime = info.AdviceInterval; }