Rename WithTurret, WithBarrel and WithReloadingTurret

Make them use RenderUtils.ZOffsetFromCenter.
This commit is contained in:
reaperrr
2015-10-04 19:56:35 +02:00
parent 72ec431766
commit 35c4aca983
17 changed files with 99 additions and 45 deletions

View File

@@ -84,7 +84,7 @@
<Compile Include="Traits\Render\WithGunboatBody.cs" />
<Compile Include="Traits\Render\WithCargo.cs" />
<Compile Include="Traits\Render\WithDeliveryAnimation.cs" />
<Compile Include="Traits\Render\WithReloadingTurret.cs" />
<Compile Include="Traits\Render\WithReloadingSpriteTurret.cs" />
<Compile Include="Traits\Render\WithRoof.cs" />
<Compile Include="Traits\SupportPowers\IonCannonPower.cs" />
<Compile Include="Widgets\Logic\CncMainMenuLogic.cs" />

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Traits
{
[Desc("Renders ammo-dependent turret graphics for units with the Turreted trait.")]
public class WithReloadingTurretInfo : WithTurretInfo, Requires<AmmoPoolInfo>, Requires<ArmamentInfo>
public class WithReloadingSpriteTurretInfo : WithSpriteTurretInfo, Requires<AmmoPoolInfo>, Requires<ArmamentInfo>
{
[Desc("AmmoPool to use for ammo-dependent sequences.")]
public readonly string AmmoPoolName = null;
@@ -27,17 +27,17 @@ namespace OpenRA.Mods.Cnc.Traits
"Adds current reload stage to Sequence as suffix when a matching AmmoPool is present.")]
public readonly int ReloadStages = -1;
public override object Create(ActorInitializer init) { return new WithReloadingTurret(init.Self, this); }
public override object Create(ActorInitializer init) { return new WithReloadingSpriteTurret(init.Self, this); }
}
public class WithReloadingTurret : WithTurret
public class WithReloadingSpriteTurret : WithSpriteTurret
{
readonly int reloadStages;
readonly AmmoPool ammoPool;
string sequence;
string ammoSuffix;
public WithReloadingTurret(Actor self, WithReloadingTurretInfo info)
public WithReloadingSpriteTurret(Actor self, WithReloadingSpriteTurretInfo info)
: base(self, info)
{
ammoPool = self.TraitsImplementing<AmmoPool>().FirstOrDefault(a => a.Info.Name == info.AmmoPoolName);