Rename WithTurret, WithBarrel and WithReloadingTurret
Make them use RenderUtils.ZOffsetFromCenter.
This commit is contained in:
@@ -412,7 +412,7 @@
|
||||
<Compile Include="Traits\Render\ProductionBar.cs" />
|
||||
<Compile Include="Traits\Render\SupportPowerChargeBar.cs" />
|
||||
<Compile Include="Traits\Render\TimedUpgradeBar.cs" />
|
||||
<Compile Include="Traits\Render\WithBarrel.cs" />
|
||||
<Compile Include="Traits\Render\WithSpriteBarrel.cs" />
|
||||
<Compile Include="Traits\Render\WithBuildingExplosion.cs" />
|
||||
<Compile Include="Traits\Render\WithActiveAnimation.cs" />
|
||||
<Compile Include="Traits\Render\WithAttackAnimation.cs" />
|
||||
@@ -441,7 +441,7 @@
|
||||
<Compile Include="Traits\Render\WithShadow.cs" />
|
||||
<Compile Include="Traits\Render\WithSmoke.cs" />
|
||||
<Compile Include="Traits\Render\WithSpriteBody.cs" />
|
||||
<Compile Include="Traits\Render\WithTurret.cs" />
|
||||
<Compile Include="Traits\Render\WithSpriteTurret.cs" />
|
||||
<Compile Include="Traits\Render\WithFacingSpriteBody.cs" />
|
||||
<Compile Include="Traits\Render\WithBuildingPlacedOverlay.cs" />
|
||||
<Compile Include="Traits\Render\WithProductionDoorOverlay.cs" />
|
||||
|
||||
@@ -17,7 +17,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Renders barrels for units with the Turreted trait.")]
|
||||
public class WithBarrelInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires<TurretedInfo>,
|
||||
public class WithSpriteBarrelInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires<TurretedInfo>,
|
||||
Requires<ArmamentInfo>, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
|
||||
{
|
||||
[Desc("Sequence name to use.")]
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Visual offset.")]
|
||||
public readonly WVec LocalOffset = WVec.Zero;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new WithBarrel(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new WithSpriteBarrel(init.Self, this); }
|
||||
|
||||
public IEnumerable<IActorPreview> RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p)
|
||||
{
|
||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class WithBarrel : UpgradableTrait<WithBarrelInfo>
|
||||
public class WithSpriteBarrel : UpgradableTrait<WithSpriteBarrelInfo>
|
||||
{
|
||||
public readonly Animation DefaultAnimation;
|
||||
readonly RenderSprites rs;
|
||||
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
readonly Turreted turreted;
|
||||
readonly BodyOrientation body;
|
||||
|
||||
public WithBarrel(Actor self, WithBarrelInfo info)
|
||||
public WithSpriteBarrel(Actor self, WithSpriteBarrelInfo info)
|
||||
: base(info)
|
||||
{
|
||||
this.self = self;
|
||||
@@ -17,7 +17,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Renders turrets for units with the Turreted trait.")]
|
||||
public class WithTurretInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo,
|
||||
public class WithSpriteTurretInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo,
|
||||
Requires<RenderSpritesInfo>, Requires<TurretedInfo>, Requires<BodyOrientationInfo>, Requires<ArmamentInfo>
|
||||
{
|
||||
[Desc("Sequence name to use")]
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Render recoil")]
|
||||
public readonly bool Recoils = true;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new WithTurret(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new WithSpriteTurret(init.Self, this); }
|
||||
|
||||
public IEnumerable<IActorPreview> RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p)
|
||||
{
|
||||
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class WithTurret : UpgradableTrait<WithTurretInfo>, ITick, INotifyDamageStateChanged
|
||||
public class WithSpriteTurret : UpgradableTrait<WithSpriteTurretInfo>, ITick, INotifyDamageStateChanged
|
||||
{
|
||||
public readonly Animation DefaultAnimation;
|
||||
protected readonly AttackBase Attack;
|
||||
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
readonly Turreted t;
|
||||
readonly Armament[] arms;
|
||||
|
||||
public WithTurret(Actor self, WithTurretInfo info)
|
||||
public WithSpriteTurret(Actor self, WithSpriteTurretInfo info)
|
||||
: base(info)
|
||||
{
|
||||
rs = self.Trait<RenderSprites>();
|
||||
@@ -2399,6 +2399,60 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
}
|
||||
}
|
||||
|
||||
if (engineVersion < 20151127)
|
||||
{
|
||||
// Rename WithTurret to WithSpriteTurret
|
||||
if (depth == 1 && node.Key.StartsWith("WithTurret"))
|
||||
{
|
||||
var parts = node.Key.Split('@');
|
||||
node.Key = "WithSpriteTurret";
|
||||
if (parts.Length > 1)
|
||||
node.Key += "@" + parts[1];
|
||||
}
|
||||
|
||||
if (depth == 1 && node.Key.StartsWith("-WithTurret"))
|
||||
{
|
||||
var parts = node.Key.Split('@');
|
||||
node.Key = "-WithSpriteTurret";
|
||||
if (parts.Length > 1)
|
||||
node.Key += "@" + parts[1];
|
||||
}
|
||||
|
||||
// Rename WithBarrel to WithSpriteBarrel
|
||||
if (depth == 1 && node.Key.StartsWith("WithBarrel"))
|
||||
{
|
||||
var parts = node.Key.Split('@');
|
||||
node.Key = "WithSpriteBarrel";
|
||||
if (parts.Length > 1)
|
||||
node.Key += "@" + parts[1];
|
||||
}
|
||||
|
||||
if (depth == 1 && node.Key.StartsWith("-WithBarrel"))
|
||||
{
|
||||
var parts = node.Key.Split('@');
|
||||
node.Key = "-WithSpriteBarrel";
|
||||
if (parts.Length > 1)
|
||||
node.Key += "@" + parts[1];
|
||||
}
|
||||
|
||||
// Rename WithReloadingTurret to WithReloadingSpriteTurret
|
||||
if (depth == 1 && node.Key.StartsWith("WithReloadingTurret"))
|
||||
{
|
||||
var parts = node.Key.Split('@');
|
||||
node.Key = "WithReloadingSpriteTurret";
|
||||
if (parts.Length > 1)
|
||||
node.Key += "@" + parts[1];
|
||||
}
|
||||
|
||||
if (depth == 1 && node.Key.StartsWith("-WithReloadingTurret"))
|
||||
{
|
||||
var parts = node.Key.Split('@');
|
||||
node.Key = "-WithReloadingSpriteTurret";
|
||||
if (parts.Length > 1)
|
||||
node.Key += "@" + parts[1];
|
||||
}
|
||||
}
|
||||
|
||||
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user