diff --git a/OpenRA.Mods.Common/Traits/Render/WithNukeLaunchAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithSupportPowerActivationAnimation.cs similarity index 72% rename from OpenRA.Mods.Common/Traits/Render/WithNukeLaunchAnimation.cs rename to OpenRA.Mods.Common/Traits/Render/WithSupportPowerActivationAnimation.cs index bbd9975592..e6ac8f0c52 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithNukeLaunchAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSupportPowerActivationAnimation.cs @@ -14,8 +14,8 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits.Render { - [Desc("Replaces the building animation when `NukePower` is triggered.")] - public class WithNukeLaunchAnimationInfo : ConditionalTraitInfo, Requires + [Desc("Replaces the building animation when a support power is triggered.")] + public class WithSupportPowerActivationAnimationInfo : ConditionalTraitInfo, Requires { [SequenceReference] [Desc("Sequence name to use")] @@ -24,14 +24,14 @@ namespace OpenRA.Mods.Common.Traits.Render [Desc("Which sprite body to play the animation on.")] public readonly string Body = "body"; - public override object Create(ActorInitializer init) { return new WithNukeLaunchAnimation(init.Self, this); } + public override object Create(ActorInitializer init) { return new WithSupportPowerActivationAnimation(init.Self, this); } } - public class WithNukeLaunchAnimation : ConditionalTrait, INotifySupportPower + public class WithSupportPowerActivationAnimation : ConditionalTrait, INotifySupportPower { readonly WithSpriteBody wsb; - public WithNukeLaunchAnimation(Actor self, WithNukeLaunchAnimationInfo info) + public WithSupportPowerActivationAnimation(Actor self, WithSupportPowerActivationAnimationInfo info) : base(info) { wsb = self.TraitsImplementing().Single(w => w.Info.Name == Info.Body); diff --git a/OpenRA.Mods.Common/Traits/Render/WithNukeLaunchOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithSupportPowerActivationOverlay.cs similarity index 78% rename from OpenRA.Mods.Common/Traits/Render/WithNukeLaunchOverlay.cs rename to OpenRA.Mods.Common/Traits/Render/WithSupportPowerActivationOverlay.cs index 4af98bb6b6..bd10061a83 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithNukeLaunchOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSupportPowerActivationOverlay.cs @@ -14,8 +14,8 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits.Render { - [Desc("Displays an overlay when `NukePower` is triggered.")] - public class WithNukeLaunchOverlayInfo : ConditionalTraitInfo, Requires, Requires + [Desc("Displays an overlay when a support power is triggered.")] + public class WithSupportPowerActivationOverlayInfo : ConditionalTraitInfo, Requires, Requires { [SequenceReference] [Desc("Sequence name to use")] @@ -31,15 +31,15 @@ namespace OpenRA.Mods.Common.Traits.Render [Desc("Custom palette is a player palette BaseName")] public readonly bool IsPlayerPalette = false; - public override object Create(ActorInitializer init) { return new WithNukeLaunchOverlay(init.Self, this); } + public override object Create(ActorInitializer init) { return new WithSupportPowerActivationOverlay(init.Self, this); } } - public class WithNukeLaunchOverlay : ConditionalTrait, INotifySupportPower + public class WithSupportPowerActivationOverlay : ConditionalTrait, INotifySupportPower { readonly Animation overlay; bool visible; - public WithNukeLaunchOverlay(Actor self, WithNukeLaunchOverlayInfo info) + public WithSupportPowerActivationOverlay(Actor self, WithSupportPowerActivationOverlayInfo info) : base(info) { var rs = self.Trait(); diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/RenameWithNukeLaunch.cs b/OpenRA.Mods.Common/UpdateRules/Rules/RenameWithNukeLaunch.cs new file mode 100644 index 0000000000..e8585c4ad8 --- /dev/null +++ b/OpenRA.Mods.Common/UpdateRules/Rules/RenameWithNukeLaunch.cs @@ -0,0 +1,35 @@ +#region Copyright & License Information +/* + * Copyright 2007-2020 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. For more + * information, see COPYING. + */ +#endregion + +using System.Collections.Generic; + +namespace OpenRA.Mods.Common.UpdateRules.Rules +{ + class RenameWithNukeLaunch : UpdateRule + { + public override string Name { get { return "Renamed WithNukeLaunchAnimation and Overlay"; } } + public override string Description + { + get + { + return "`WithNukeLaunchAnimation` has been renamed to `WithSupportPowerActivationAnimation` and `WithNukeLaunchOverlay` to `WithSupportPowerActivationOverlay`."; + } + } + + public override IEnumerable UpdateActorNode(ModData modData, MiniYamlNode actorNode) + { + actorNode.RenameChildrenMatching("WithNukeLaunchAnimation", "WithSupportPowerActivationAnimation", true); + actorNode.RenameChildrenMatching("WithNukeLaunchOverlay", "WithSupportPowerActivationOverlay", true); + + yield break; + } + } +} diff --git a/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs b/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs index 5d8198e7db..832d0e23cc 100644 --- a/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs +++ b/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs @@ -82,6 +82,7 @@ namespace OpenRA.Mods.Common.UpdateRules new ModernizeDecorationTraits(), new RenameInfiltrationNotifications(), new MoveClassicFacingFudge(), + new RenameWithNukeLaunch() }) }; diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index aab9b303ba..91dd814025 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -813,9 +813,9 @@ TMPL: CircleSequence: circles SupportPowerPaletteOrder: 30 WithBuildingBib: - WithNukeLaunchAnimation: + WithSupportPowerActivationAnimation: RequiresCondition: !build-incomplete - WithNukeLaunchOverlay: + WithSupportPowerActivationOverlay: RequiresCondition: !build-incomplete Sequence: smoke SupportPowerChargeBar: diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index a3ab1941c9..d586a4c16e 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -1038,7 +1038,7 @@ palace: corrino: palace.corrino WithBuildingBib: HasMinibib: True - WithNukeLaunchOverlay: + WithSupportPowerActivationOverlay: RequiresCondition: !build-incomplete && !launchpad-damaged && harkonnen GrantConditionOnDamageState@LAUNCHPADDAMAGED: Condition: launchpad-damaged diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index d9d1206ff8..c4c77427ee 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -66,7 +66,7 @@ MSLO: Amount: -150 MustBeDestroyed: RequiredForShortGame: false - WithNukeLaunchAnimation: + WithSupportPowerActivationAnimation: RequiresCondition: !build-incomplete GAP: diff --git a/mods/ts/rules/nod-structures.yaml b/mods/ts/rules/nod-structures.yaml index 0771c4fc5f..bb551094eb 100644 --- a/mods/ts/rules/nod-structures.yaml +++ b/mods/ts/rules/nod-structures.yaml @@ -495,7 +495,7 @@ NAMISL: TrailPalette: effectalpha75 TrailInterval: 0 TrailSequences: idle - WithNukeLaunchOverlay: + WithSupportPowerActivationOverlay: NAWAST: Inherits: ^Building