Add a IAutoSelctionSizeInfo trait interface

This commit is contained in:
abcdefg30
2017-04-19 13:43:29 +02:00
committed by reaperrr
parent 767fd5438e
commit 2a3139dc39
6 changed files with 8 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Special case trait for actors that need to define targetable area and screen map bounds manually.")]
public class CustomSelectionSizeInfo : ITraitInfo
public class CustomSelectionSizeInfo : ITraitInfo, IAutoSelectionSizeInfo
{
[FieldLoader.Require]
public readonly int[] CustomBounds = null;

View File

@@ -14,7 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Automatically calculates the targetable area and screen map boundaries from the sprite size.")]
public class AutoSelectionSizeInfo : ITraitInfo, Requires<RenderSpritesInfo>
public class AutoSelectionSizeInfo : ITraitInfo, Requires<RenderSpritesInfo>, IAutoSelectionSizeInfo
{
public object Create(ActorInitializer init) { return new AutoSelectionSize(this); }
}

View File

@@ -19,7 +19,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Also returns a default selection size that is calculated automatically from the voxel dimensions.")]
public class WithVoxelBodyInfo : ConditionalTraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>
public class WithVoxelBodyInfo : ConditionalTraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, IAutoSelectionSizeInfo
{
public readonly string Sequence = "idle";