diff --git a/OpenRA.Mods.RA/Render/WithVoxelBody.cs b/OpenRA.Mods.RA/Render/WithVoxelBody.cs index 7db92c7482..af28a54528 100755 --- a/OpenRA.Mods.RA/Render/WithVoxelBody.cs +++ b/OpenRA.Mods.RA/Render/WithVoxelBody.cs @@ -1,6 +1,6 @@ #region Copyright & License Information /* - * Copyright 2007-2013 The OpenRA Developers (see AUTHORS) + * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) * This file is part of OpenRA, which is free software. It is made * available to you under the terms of the GNU General Public License * as published by the Free Software Foundation. For more information, @@ -15,21 +15,24 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA.Render { + [Desc("Also returns a default selection size that is calculated automatically from the voxel dimensions.")] public class WithVoxelBodyInfo : ITraitInfo, Requires { - public object Create(ActorInitializer init) { return new WithVoxelBody(init.self); } + public readonly string Sequence = "idle"; + + public object Create(ActorInitializer init) { return new WithVoxelBody(init.self, this); } } public class WithVoxelBody : IAutoSelectionSize { int2 size; - public WithVoxelBody(Actor self) + public WithVoxelBody(Actor self, WithVoxelBodyInfo info) { var body = self.Trait(); var rv = self.Trait(); - var voxel = VoxelProvider.GetVoxel(rv.Image, "idle"); + var voxel = VoxelProvider.GetVoxel(rv.Image, info.Sequence); rv.Add(new VoxelAnimation(voxel, () => WVec.Zero, () => new[]{ body.QuantizeOrientation(self, self.Orientation) }, () => false, () => 0));