From cf84e6f8d58c35df250d7667cf50ade329f0d16d Mon Sep 17 00:00:00 2001 From: Andre Mohren Date: Sun, 22 Jul 2018 13:43:12 +0200 Subject: [PATCH] GainsExperience notification now optional. --- OpenRA.Mods.Common/Traits/GainsExperience.cs | 4 +++- mods/cnc/rules/defaults.yaml | 1 + mods/d2k/rules/defaults.yaml | 1 + mods/ra/rules/defaults.yaml | 1 + mods/ts/rules/defaults.yaml | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/GainsExperience.cs b/OpenRA.Mods.Common/Traits/GainsExperience.cs index 5df38a6420..fc7ff48215 100644 --- a/OpenRA.Mods.Common/Traits/GainsExperience.cs +++ b/OpenRA.Mods.Common/Traits/GainsExperience.cs @@ -36,6 +36,8 @@ namespace OpenRA.Mods.Common.Traits [Desc("Should the level-up animation be suppressed when actor is created?")] public readonly bool SuppressLevelupAnimation = true; + public readonly string LevelUpNotification = null; + public object Create(ActorInitializer init) { return new GainsExperience(init, this); } } @@ -99,7 +101,7 @@ namespace OpenRA.Mods.Common.Traits if (!silent) { - Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "LevelUp", self.Owner.Faction.InternalName); + Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", info.LevelUpNotification, self.Owner.Faction.InternalName); self.World.AddFrameEndTask(w => w.Add(new CrateEffect(self, "levelup", info.LevelUpPalette))); } } diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index ab618e3f1e..4fcb3b9930 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -43,6 +43,7 @@ ^GainsExperience: GainsExperience: + LevelUpNotification: LevelUp Conditions: 200: rank-veteran 400: rank-veteran diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index 27a3aa59c0..55105180ec 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -15,6 +15,7 @@ ^GainsExperience: GainsExperience: + LevelUpNotification: LevelUp Conditions: 200: rank-veteran 400: rank-veteran diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index d7a6cec770..efd6690860 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -42,6 +42,7 @@ ^GainsExperience: GainsExperience: + LevelUpNotification: LevelUp Conditions: 200: rank-veteran 400: rank-veteran diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml index 3e797672b4..4871cd9f4f 100644 --- a/mods/ts/rules/defaults.yaml +++ b/mods/ts/rules/defaults.yaml @@ -17,6 +17,7 @@ ^GainsExperience: GainsExperience: + LevelUpNotification: LevelUp Conditions: 500: rank 1000: rank