Rename WithNukeLaunch* traits to WithSupportPower*.

This commit is contained in:
Matthias Mailänder
2020-03-10 19:37:54 +01:00
committed by atlimit8
parent 52d0490f95
commit bd1760682f
8 changed files with 51 additions and 15 deletions

View File

@@ -14,8 +14,8 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render namespace OpenRA.Mods.Common.Traits.Render
{ {
[Desc("Replaces the building animation when `NukePower` is triggered.")] [Desc("Replaces the building animation when a support power is triggered.")]
public class WithNukeLaunchAnimationInfo : ConditionalTraitInfo, Requires<WithSpriteBodyInfo> public class WithSupportPowerActivationAnimationInfo : ConditionalTraitInfo, Requires<WithSpriteBodyInfo>
{ {
[SequenceReference] [SequenceReference]
[Desc("Sequence name to use")] [Desc("Sequence name to use")]
@@ -24,14 +24,14 @@ namespace OpenRA.Mods.Common.Traits.Render
[Desc("Which sprite body to play the animation on.")] [Desc("Which sprite body to play the animation on.")]
public readonly string Body = "body"; 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<WithNukeLaunchAnimationInfo>, INotifySupportPower public class WithSupportPowerActivationAnimation : ConditionalTrait<WithSupportPowerActivationAnimationInfo>, INotifySupportPower
{ {
readonly WithSpriteBody wsb; readonly WithSpriteBody wsb;
public WithNukeLaunchAnimation(Actor self, WithNukeLaunchAnimationInfo info) public WithSupportPowerActivationAnimation(Actor self, WithSupportPowerActivationAnimationInfo info)
: base(info) : base(info)
{ {
wsb = self.TraitsImplementing<WithSpriteBody>().Single(w => w.Info.Name == Info.Body); wsb = self.TraitsImplementing<WithSpriteBody>().Single(w => w.Info.Name == Info.Body);

View File

@@ -14,8 +14,8 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render namespace OpenRA.Mods.Common.Traits.Render
{ {
[Desc("Displays an overlay when `NukePower` is triggered.")] [Desc("Displays an overlay when a support power is triggered.")]
public class WithNukeLaunchOverlayInfo : ConditionalTraitInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo> public class WithSupportPowerActivationOverlayInfo : ConditionalTraitInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
{ {
[SequenceReference] [SequenceReference]
[Desc("Sequence name to use")] [Desc("Sequence name to use")]
@@ -31,15 +31,15 @@ namespace OpenRA.Mods.Common.Traits.Render
[Desc("Custom palette is a player palette BaseName")] [Desc("Custom palette is a player palette BaseName")]
public readonly bool IsPlayerPalette = false; 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<WithNukeLaunchOverlayInfo>, INotifySupportPower public class WithSupportPowerActivationOverlay : ConditionalTrait<WithSupportPowerActivationOverlayInfo>, INotifySupportPower
{ {
readonly Animation overlay; readonly Animation overlay;
bool visible; bool visible;
public WithNukeLaunchOverlay(Actor self, WithNukeLaunchOverlayInfo info) public WithSupportPowerActivationOverlay(Actor self, WithSupportPowerActivationOverlayInfo info)
: base(info) : base(info)
{ {
var rs = self.Trait<RenderSprites>(); var rs = self.Trait<RenderSprites>();

View File

@@ -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<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
actorNode.RenameChildrenMatching("WithNukeLaunchAnimation", "WithSupportPowerActivationAnimation", true);
actorNode.RenameChildrenMatching("WithNukeLaunchOverlay", "WithSupportPowerActivationOverlay", true);
yield break;
}
}
}

View File

@@ -82,6 +82,7 @@ namespace OpenRA.Mods.Common.UpdateRules
new ModernizeDecorationTraits(), new ModernizeDecorationTraits(),
new RenameInfiltrationNotifications(), new RenameInfiltrationNotifications(),
new MoveClassicFacingFudge(), new MoveClassicFacingFudge(),
new RenameWithNukeLaunch()
}) })
}; };

View File

@@ -813,9 +813,9 @@ TMPL:
CircleSequence: circles CircleSequence: circles
SupportPowerPaletteOrder: 30 SupportPowerPaletteOrder: 30
WithBuildingBib: WithBuildingBib:
WithNukeLaunchAnimation: WithSupportPowerActivationAnimation:
RequiresCondition: !build-incomplete RequiresCondition: !build-incomplete
WithNukeLaunchOverlay: WithSupportPowerActivationOverlay:
RequiresCondition: !build-incomplete RequiresCondition: !build-incomplete
Sequence: smoke Sequence: smoke
SupportPowerChargeBar: SupportPowerChargeBar:

View File

@@ -1038,7 +1038,7 @@ palace:
corrino: palace.corrino corrino: palace.corrino
WithBuildingBib: WithBuildingBib:
HasMinibib: True HasMinibib: True
WithNukeLaunchOverlay: WithSupportPowerActivationOverlay:
RequiresCondition: !build-incomplete && !launchpad-damaged && harkonnen RequiresCondition: !build-incomplete && !launchpad-damaged && harkonnen
GrantConditionOnDamageState@LAUNCHPADDAMAGED: GrantConditionOnDamageState@LAUNCHPADDAMAGED:
Condition: launchpad-damaged Condition: launchpad-damaged

View File

@@ -66,7 +66,7 @@ MSLO:
Amount: -150 Amount: -150
MustBeDestroyed: MustBeDestroyed:
RequiredForShortGame: false RequiredForShortGame: false
WithNukeLaunchAnimation: WithSupportPowerActivationAnimation:
RequiresCondition: !build-incomplete RequiresCondition: !build-incomplete
GAP: GAP:

View File

@@ -495,7 +495,7 @@ NAMISL:
TrailPalette: effectalpha75 TrailPalette: effectalpha75
TrailInterval: 0 TrailInterval: 0
TrailSequences: idle TrailSequences: idle
WithNukeLaunchOverlay: WithSupportPowerActivationOverlay:
NAWAST: NAWAST:
Inherits: ^Building Inherits: ^Building