From c611b5aeebcf1ef8a29fb4095fc0f4844682a9d3 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Tue, 11 Jul 2017 06:20:52 +0200 Subject: [PATCH] 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. --- OpenRA.Mods.Common/OpenRA.Mods.Common.csproj | 2 +- ...AttackAnimation.cs => WithTurretAttackAnimation.cs} | 10 +++++----- OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) rename OpenRA.Mods.Common/Traits/Render/{WithTurretedAttackAnimation.cs => WithTurretAttackAnimation.cs} (88%) diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 40eb4f8805..8b21715476 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -417,7 +417,7 @@ - + diff --git a/OpenRA.Mods.Common/Traits/Render/WithTurretedAttackAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithTurretAttackAnimation.cs similarity index 88% rename from OpenRA.Mods.Common/Traits/Render/WithTurretedAttackAnimation.cs rename to OpenRA.Mods.Common/Traits/Render/WithTurretAttackAnimation.cs index a492104d00..254185afa0 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithTurretedAttackAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithTurretAttackAnimation.cs @@ -14,7 +14,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits.Render { - public class WithTurretedAttackAnimationInfo : ITraitInfo, Requires, Requires, Requires + public class WithTurretAttackAnimationInfo : ITraitInfo, Requires, Requires, Requires { [Desc("Armament name")] 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?")] 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 Armament armament; readonly WithSpriteTurret wst; int tick; - public WithTurretedAttackAnimation(ActorInitializer init, WithTurretedAttackAnimationInfo info) + public WithTurretAttackAnimation(ActorInitializer init, WithTurretAttackAnimationInfo info) { this.info = info; attack = init.Self.Trait(); diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 64ec434114..93ebda8359 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -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); }