Added a flag ShowShadow in WithVoxelBarrel, WithVoxelBody, WithVoxelTurret, WithVoxelUnloadBody and WithVoxelWalkerBody

This commit is contained in:
abc013
2016-09-20 13:34:05 +02:00
parent c9474a857a
commit b9d1f373fe
7 changed files with 33 additions and 14 deletions

View File

@@ -24,7 +24,11 @@ namespace OpenRA.Mods.TS.Traits.Render
{
public class WithVoxelWalkerBodyInfo : ITraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<IMoveInfo>, Requires<IFacingInfo>
{
[Desc("The speed of the walker's legs.")]
public readonly int TickRate = 5;
[Desc("Defines if the Voxel should have a shadow.")]
public readonly bool ShowShadow = true;
public object Create(ActorInitializer init) { return new WithVoxelWalkerBody(init.Self, this); }
public IEnumerable<VoxelAnimation> RenderPreviewVoxels(
@@ -36,7 +40,7 @@ namespace OpenRA.Mods.TS.Traits.Render
yield return new VoxelAnimation(voxel, () => WVec.Zero,
() => new[] { body.QuantizeOrientation(orientation(), facings) },
() => false, () => frame);
() => false, () => frame, ShowShadow);
}
}
@@ -62,7 +66,7 @@ namespace OpenRA.Mods.TS.Traits.Render
frames = voxel.Frames;
rv.Add(new VoxelAnimation(voxel, () => WVec.Zero,
() => new[] { body.QuantizeOrientation(self, self.Orientation) },
() => false, () => frame));
() => false, () => frame, info.ShowShadow));
// Selection size
var rvi = self.Info.TraitInfo<RenderVoxelsInfo>();