Rename WithMuzzleFlash to WithMuzzleOverlay

This commit is contained in:
reaperrr
2015-09-20 00:31:13 +02:00
parent cdd4590ece
commit 5b5164211e
21 changed files with 62 additions and 52 deletions

View File

@@ -433,7 +433,7 @@
<Compile Include="Traits\Render\WithHarvestAnimation.cs" />
<Compile Include="Traits\Render\WithHarvestOverlay.cs" />
<Compile Include="Traits\Render\WithIdleOverlay.cs" />
<Compile Include="Traits\Render\WithMuzzleFlash.cs" />
<Compile Include="Traits\Render\WithMuzzleOverlay.cs" />
<Compile Include="Traits\Render\WithParachute.cs" />
<Compile Include="Traits\Render\WithRangeCircle.cs" />
<Compile Include="Traits\Render\WithRankDecoration.cs" />

View File

@@ -17,22 +17,22 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Renders the MuzzleSequence from the Armament trait.")]
class WithMuzzleFlashInfo : UpgradableTraitInfo, Requires<RenderSpritesInfo>, Requires<AttackBaseInfo>, Requires<ArmamentInfo>
class WithMuzzleOverlayInfo : UpgradableTraitInfo, Requires<RenderSpritesInfo>, Requires<AttackBaseInfo>, Requires<ArmamentInfo>
{
[Desc("Ignore the weapon position, and always draw relative to the center of the actor")]
public readonly bool IgnoreOffset = false;
public override object Create(ActorInitializer init) { return new WithMuzzleFlash(init.Self, this); }
public override object Create(ActorInitializer init) { return new WithMuzzleOverlay(init.Self, this); }
}
class WithMuzzleFlash : UpgradableTrait<WithMuzzleFlashInfo>, INotifyAttack, IRender, ITick
class WithMuzzleOverlay : UpgradableTrait<WithMuzzleOverlayInfo>, INotifyAttack, IRender, ITick
{
readonly Dictionary<Barrel, bool> visible = new Dictionary<Barrel, bool>();
readonly Dictionary<Barrel, AnimationWithOffset> anims = new Dictionary<Barrel, AnimationWithOffset>();
readonly Func<int> getFacing;
readonly Armament[] armaments;
public WithMuzzleFlash(Actor self, WithMuzzleFlashInfo info)
public WithMuzzleOverlay(Actor self, WithMuzzleOverlayInfo info)
: base(info)
{
var render = self.Trait<RenderSprites>();

View File

@@ -2138,6 +2138,16 @@ namespace OpenRA.Mods.Common.UtilityCommands
node.Value.Value = node.Value.Value + "c0";
}
if (engineVersion < 20150920)
{
// Rename WithMuzzleFlash to WithMuzzleOverlay
if (depth == 1 && node.Key.StartsWith("WithMuzzleFlash"))
node.Key = node.Key.Replace("WithMuzzleFlash", "WithMuzzleOverlay");
if (depth == 1 && node.Key.StartsWith("-WithMuzzleFlash"))
node.Key = node.Key.Replace("-WithMuzzleFlash", "-WithMuzzleOverlay");
}
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
}
}