From b3b0aa75ae0049802a33b7ae7f040a8a6d8ce5d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 8 Mar 2020 19:37:20 +0100 Subject: [PATCH] Add new interfaces for support powers. --- OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs | 6 ++++++ OpenRA.Mods.Common/TraitsInterfaces.cs | 1 + 2 files changed, 7 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs index 8ee86aa42b..7ca610dd0d 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs @@ -152,6 +152,9 @@ namespace OpenRA.Mods.Common.Traits Game.Sound.PlayToPlayer(SoundType.UI, self.Owner, Info.EndChargeSound); Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.EndChargeSpeechNotification, self.Owner.Faction.InternalName); + + foreach (var notify in self.TraitsImplementing()) + notify.Charged(self); } public virtual void SelectTarget(Actor self, string order, SupportPowerManager manager) @@ -172,6 +175,9 @@ namespace OpenRA.Mods.Common.Traits order.Player.Color, Info.RadarPingDuration); } + + foreach (var notify in self.TraitsImplementing()) + notify.Activated(self); } public virtual void PlayLaunchSounds() diff --git a/OpenRA.Mods.Common/TraitsInterfaces.cs b/OpenRA.Mods.Common/TraitsInterfaces.cs index 1cfc3f27fb..1aebc3cbd1 100644 --- a/OpenRA.Mods.Common/TraitsInterfaces.cs +++ b/OpenRA.Mods.Common/TraitsInterfaces.cs @@ -133,6 +133,7 @@ namespace OpenRA.Mods.Common.Traits [RequireExplicitImplementation] public interface INotifyPowerLevelChanged { void PowerLevelChanged(Actor self); } + public interface INotifySupportPower { void Charged(Actor self); void Activated(Actor self); } public interface INotifyBuildingPlaced { void BuildingPlaced(Actor self); } public interface INotifyNuke { void Launching(Actor self); }