Make WithRotor independent from WithTurret
Move WithRotor to Mods.Common
This commit is contained in:
@@ -162,6 +162,7 @@
|
|||||||
<Compile Include="Traits\Render\WithBuildingPlacedAnimation.cs" />
|
<Compile Include="Traits\Render\WithBuildingPlacedAnimation.cs" />
|
||||||
<Compile Include="Traits\Render\WithDeathAnimation.cs" />
|
<Compile Include="Traits\Render\WithDeathAnimation.cs" />
|
||||||
<Compile Include="Traits\Render\WithResources.cs" />
|
<Compile Include="Traits\Render\WithResources.cs" />
|
||||||
|
<Compile Include="Traits\Render\WithRotor.cs" />
|
||||||
<Compile Include="Traits\Render\WithShadow.cs" />
|
<Compile Include="Traits\Render\WithShadow.cs" />
|
||||||
<Compile Include="Traits\Render\WithSmoke.cs" />
|
<Compile Include="Traits\Render\WithSmoke.cs" />
|
||||||
<Compile Include="Traits\ShakeOnDeath.cs" />
|
<Compile Include="Traits\ShakeOnDeath.cs" />
|
||||||
|
|||||||
11
OpenRA.Mods.RA/Render/WithRotor.cs → OpenRA.Mods.Common/Traits/Render/WithRotor.cs
Executable file → Normal file
11
OpenRA.Mods.RA/Render/WithRotor.cs → OpenRA.Mods.Common/Traits/Render/WithRotor.cs
Executable file → Normal file
@@ -12,10 +12,9 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Mods.Common.Graphics;
|
using OpenRA.Mods.Common.Graphics;
|
||||||
using OpenRA.Mods.Common.Traits;
|
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
|
||||||
namespace OpenRA.Mods.RA.Render
|
namespace OpenRA.Mods.Common.Traits
|
||||||
{
|
{
|
||||||
[Desc("Displays a helicopter rotor overlay.")]
|
[Desc("Displays a helicopter rotor overlay.")]
|
||||||
public class WithRotorInfo : ITraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<IBodyOrientationInfo>
|
public class WithRotorInfo : ITraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<IBodyOrientationInfo>
|
||||||
@@ -64,7 +63,7 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
rotorAnim.PlayRepeating(info.Sequence);
|
rotorAnim.PlayRepeating(info.Sequence);
|
||||||
rs.Add(info.Id, new AnimationWithOffset(rotorAnim,
|
rs.Add(info.Id, new AnimationWithOffset(rotorAnim,
|
||||||
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
||||||
null, () => false, p => WithTurret.ZOffsetFromCenter(self, p, 1)));
|
null, () => false, p => ZOffsetFromCenter(self, p, 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick(Actor self)
|
public void Tick(Actor self)
|
||||||
@@ -75,5 +74,11 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
|
|
||||||
rotorAnim.ReplaceAnim(isFlying ? info.Sequence : info.GroundSequence);
|
rotorAnim.ReplaceAnim(isFlying ? info.Sequence : info.GroundSequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public int ZOffsetFromCenter(Actor self, WPos pos, int offset)
|
||||||
|
{
|
||||||
|
var delta = self.CenterPosition - pos;
|
||||||
|
return delta.Y + delta.Z + offset;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -239,7 +239,6 @@
|
|||||||
<Compile Include="Render\RenderLandingCraft.cs" />
|
<Compile Include="Render\RenderLandingCraft.cs" />
|
||||||
<Compile Include="Render\WithBuildingExplosion.cs" />
|
<Compile Include="Render\WithBuildingExplosion.cs" />
|
||||||
<Compile Include="Render\WithMuzzleFlash.cs" />
|
<Compile Include="Render\WithMuzzleFlash.cs" />
|
||||||
<Compile Include="Render\WithRotor.cs" />
|
|
||||||
<Compile Include="Repairable.cs" />
|
<Compile Include="Repairable.cs" />
|
||||||
<Compile Include="RepairableNear.cs" />
|
<Compile Include="RepairableNear.cs" />
|
||||||
<Compile Include="ScaredyCat.cs" />
|
<Compile Include="ScaredyCat.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user