Rename and move WithTurretedSpriteBody
The name wasn't in line with our implicit naming convention and ambigous on top of that. Also, only used by RA and TD so moved to Mods.Cnc.
This commit is contained in:
@@ -67,6 +67,7 @@
|
||||
<Compile Include="Traits\Attack\AttackPopupTurreted.cs" />
|
||||
<Compile Include="Traits\Buildings\ProductionAirdrop.cs" />
|
||||
<Compile Include="Traits\Render\WithGunboatBody.cs" />
|
||||
<Compile Include="Traits\Render\WithEmbeddedTurretSpriteBody.cs" />
|
||||
<Compile Include="Traits\Render\WithCargo.cs" />
|
||||
<Compile Include="Traits\Render\WithDeliveryAnimation.cs" />
|
||||
<Compile Include="Traits\Render\WithReloadingSpriteTurret.cs" />
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#endregion
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Cnc.Traits.Render;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.Common.Traits.Render;
|
||||
using OpenRA.Traits;
|
||||
@@ -17,7 +18,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Cnc.Traits
|
||||
{
|
||||
[Desc("Actor's turret rises from the ground before attacking.")]
|
||||
class AttackPopupTurretedInfo : AttackTurretedInfo, Requires<BuildingInfo>, Requires<WithTurretedSpriteBodyInfo>
|
||||
class AttackPopupTurretedInfo : AttackTurretedInfo, Requires<BuildingInfo>, Requires<WithEmbeddedTurretSpriteBodyInfo>
|
||||
{
|
||||
[Desc("How many game ticks should pass before closing the actor's turret.")]
|
||||
public int CloseDelay = 125;
|
||||
|
||||
@@ -14,14 +14,16 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Graphics;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Mods.Common.Traits.Render;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits.Render
|
||||
namespace OpenRA.Mods.Cnc.Traits.Render
|
||||
{
|
||||
[Desc("This actor has turret art with facings baked into the sprite.")]
|
||||
public class WithTurretedSpriteBodyInfo : WithSpriteBodyInfo, Requires<TurretedInfo>, Requires<BodyOrientationInfo>
|
||||
public class WithEmbeddedTurretSpriteBodyInfo : WithSpriteBodyInfo, Requires<TurretedInfo>, Requires<BodyOrientationInfo>
|
||||
{
|
||||
public override object Create(ActorInitializer init) { return new WithTurretedSpriteBody(init, this); }
|
||||
public override object Create(ActorInitializer init) { return new WithEmbeddedTurretSpriteBody(init, this); }
|
||||
|
||||
public override IEnumerable<IActorPreview> RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p)
|
||||
{
|
||||
@@ -36,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
}
|
||||
|
||||
public class WithTurretedSpriteBody : WithSpriteBody
|
||||
public class WithEmbeddedTurretSpriteBody : WithSpriteBody
|
||||
{
|
||||
readonly Turreted turreted;
|
||||
|
||||
@@ -47,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
return () => turreted.TurretFacing;
|
||||
}
|
||||
|
||||
public WithTurretedSpriteBody(ActorInitializer init, WithSpriteBodyInfo info)
|
||||
public WithEmbeddedTurretSpriteBody(ActorInitializer init, WithSpriteBodyInfo info)
|
||||
: base(init, info, MakeTurretFacingFunc(init.Self))
|
||||
{
|
||||
turreted = init.Self.TraitsImplementing<Turreted>().FirstOrDefault();
|
||||
@@ -418,7 +418,6 @@
|
||||
<Compile Include="Traits\Render\LeavesTrails.cs" />
|
||||
<Compile Include="Traits\Render\RenderSpritesEditorOnly.cs" />
|
||||
<Compile Include="Traits\Render\WithTurretAttackAnimation.cs" />
|
||||
<Compile Include="Traits\Render\WithTurretedSpriteBody.cs" />
|
||||
<Compile Include="Traits\Render\RenderUtils.cs" />
|
||||
<Compile Include="Traits\Render\RenderDebugState.cs" />
|
||||
<Compile Include="Traits\Render\RenderNameTag.cs" />
|
||||
|
||||
@@ -985,8 +985,12 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
}
|
||||
|
||||
if (engineVersion < 20170915)
|
||||
{
|
||||
if (node.Key.StartsWith("WithTurretedAttackAnimation", StringComparison.Ordinal))
|
||||
RenameNodeKey(node, "WithTurretAttackAnimation");
|
||||
if (node.Key.StartsWith("WithTurretedSpriteBody", StringComparison.Ordinal))
|
||||
RenameNodeKey(node, "WithEmbeddedTurretSpriteBody");
|
||||
}
|
||||
|
||||
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||
}
|
||||
|
||||
@@ -761,7 +761,7 @@ GUN:
|
||||
TurnSpeed: 12
|
||||
InitialFacing: 56
|
||||
-WithSpriteBody:
|
||||
WithTurretedSpriteBody:
|
||||
WithEmbeddedTurretSpriteBody:
|
||||
Armament:
|
||||
Weapon: TurretGun
|
||||
LocalOffset: 512,0,112
|
||||
@@ -811,7 +811,7 @@ SAM:
|
||||
InitialFacing: 0
|
||||
RealignDelay: -1
|
||||
-WithSpriteBody:
|
||||
WithTurretedSpriteBody:
|
||||
WithEmbeddedTurretSpriteBody:
|
||||
AutoSelectionSize:
|
||||
Armament:
|
||||
Weapon: Dragon
|
||||
|
||||
@@ -548,7 +548,7 @@ AGUN:
|
||||
TurnSpeed: 15
|
||||
InitialFacing: 224
|
||||
-WithSpriteBody:
|
||||
WithTurretedSpriteBody:
|
||||
WithEmbeddedTurretSpriteBody:
|
||||
Armament:
|
||||
Weapon: ZSU-23
|
||||
LocalOffset: 520,100,450, 520,-150,450
|
||||
@@ -751,7 +751,7 @@ GUN:
|
||||
TurnSpeed: 12
|
||||
InitialFacing: 56
|
||||
-WithSpriteBody:
|
||||
WithTurretedSpriteBody:
|
||||
WithEmbeddedTurretSpriteBody:
|
||||
Armament:
|
||||
Weapon: TurretGun
|
||||
LocalOffset: 512,0,112
|
||||
@@ -848,7 +848,7 @@ SAM:
|
||||
TurnSpeed: 30
|
||||
InitialFacing: 0
|
||||
-WithSpriteBody:
|
||||
WithTurretedSpriteBody:
|
||||
WithEmbeddedTurretSpriteBody:
|
||||
Armament:
|
||||
Weapon: Nike
|
||||
LocalOffset: 0,0,320
|
||||
|
||||
Reference in New Issue
Block a user