From 069b7c5500447c89fe270c3fa6c67fa6f9579050 Mon Sep 17 00:00:00 2001 From: michaeldgg2 <119738087+michaeldgg2@users.noreply.github.com> Date: Sun, 19 Mar 2023 21:25:35 +0100 Subject: [PATCH] RepairableBuilding: play/display notification when repair process is aborted. --- .../Traits/Buildings/RepairableBuilding.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/Buildings/RepairableBuilding.cs b/OpenRA.Mods.Common/Traits/Buildings/RepairableBuilding.cs index 45fd838792..3c3cf81d60 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/RepairableBuilding.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/RepairableBuilding.cs @@ -47,10 +47,19 @@ namespace OpenRA.Mods.Common.Traits public readonly string RepairCondition = null; [NotificationReference("Speech")] + [Desc("Speech notification to play when the repair process is started.")] public readonly string RepairingNotification = null; + [Desc("Text notification to display when the repair process is started.")] public readonly string RepairingTextNotification = null; + [NotificationReference("Speech")] + [Desc("Speech notification to play when the repair process is aborted.")] + public readonly string RepairingStoppedNotification = null; + + [Desc("Text notification to display when the repair process is aborted.")] + public readonly string RepairingStoppedTextNotification = null; + public override object Create(ActorInitializer init) { return new RepairableBuilding(init.Self, this); } } @@ -105,6 +114,12 @@ namespace OpenRA.Mods.Common.Traits if (Repairers.Remove(player)) { UpdateCondition(self); + if (!Repairers.Any()) + { + Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", Info.RepairingStoppedNotification, player.Faction.InternalName); + TextNotificationsManager.AddTransientLine(Info.RepairingStoppedTextNotification, self.Owner); + } + return; }