Remove 'ed' from WithTurretedAttackAnimation

Too confusing, as people might think it requires 'WithTurretedSpriteBody', also not entirely in line with our (admittedly implicit) render trait naming convention.
This commit is contained in:
reaperrr
2017-07-11 06:20:52 +02:00
committed by Paul Chote
parent c0b8bb3fcf
commit c611b5aeeb
3 changed files with 10 additions and 6 deletions

View File

@@ -417,7 +417,7 @@
<Compile Include="Traits\Render\Hovers.cs" /> <Compile Include="Traits\Render\Hovers.cs" />
<Compile Include="Traits\Render\LeavesTrails.cs" /> <Compile Include="Traits\Render\LeavesTrails.cs" />
<Compile Include="Traits\Render\RenderSpritesEditorOnly.cs" /> <Compile Include="Traits\Render\RenderSpritesEditorOnly.cs" />
<Compile Include="Traits\Render\WithTurretedAttackAnimation.cs" /> <Compile Include="Traits\Render\WithTurretAttackAnimation.cs" />
<Compile Include="Traits\Render\WithTurretedSpriteBody.cs" /> <Compile Include="Traits\Render\WithTurretedSpriteBody.cs" />
<Compile Include="Traits\Render\RenderUtils.cs" /> <Compile Include="Traits\Render\RenderUtils.cs" />
<Compile Include="Traits\Render\RenderDebugState.cs" /> <Compile Include="Traits\Render\RenderDebugState.cs" />

View File

@@ -14,7 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render namespace OpenRA.Mods.Common.Traits.Render
{ {
public class WithTurretedAttackAnimationInfo : ITraitInfo, Requires<WithSpriteTurretInfo>, Requires<ArmamentInfo>, Requires<AttackBaseInfo> public class WithTurretAttackAnimationInfo : ITraitInfo, Requires<WithSpriteTurretInfo>, Requires<ArmamentInfo>, Requires<AttackBaseInfo>
{ {
[Desc("Armament name")] [Desc("Armament name")]
public readonly string Armament = "primary"; public readonly string Armament = "primary";
@@ -37,19 +37,19 @@ namespace OpenRA.Mods.Common.Traits.Render
[Desc("Should the animation be delayed relative to preparation or actual attack?")] [Desc("Should the animation be delayed relative to preparation or actual attack?")]
public readonly AttackDelayType DelayRelativeTo = AttackDelayType.Preparation; public readonly AttackDelayType DelayRelativeTo = AttackDelayType.Preparation;
public object Create(ActorInitializer init) { return new WithTurretedAttackAnimation(init, this); } public object Create(ActorInitializer init) { return new WithTurretAttackAnimation(init, this); }
} }
public class WithTurretedAttackAnimation : ITick, INotifyAttack public class WithTurretAttackAnimation : ITick, INotifyAttack
{ {
readonly WithTurretedAttackAnimationInfo info; readonly WithTurretAttackAnimationInfo info;
readonly AttackBase attack; readonly AttackBase attack;
readonly Armament armament; readonly Armament armament;
readonly WithSpriteTurret wst; readonly WithSpriteTurret wst;
int tick; int tick;
public WithTurretedAttackAnimation(ActorInitializer init, WithTurretedAttackAnimationInfo info) public WithTurretAttackAnimation(ActorInitializer init, WithTurretAttackAnimationInfo info)
{ {
this.info = info; this.info = info;
attack = init.Self.Trait<AttackBase>(); attack = init.Self.Trait<AttackBase>();

View File

@@ -984,6 +984,10 @@ namespace OpenRA.Mods.Common.UtilityCommands
} }
} }
if (engineVersion < 20170915)
if (node.Key.StartsWith("WithTurretedAttackAnimation", StringComparison.Ordinal))
RenameNodeKey(node, "WithTurretAttackAnimation");
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
} }