Rename UpgradableTrait to ConditionalTrait.

This commit is contained in:
Paul Chote
2016-12-23 23:28:34 +00:00
parent d0270ab866
commit 268ed016ab
57 changed files with 114 additions and 114 deletions

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Changes the visual Z position periodically.")]
public class HoversInfo : UpgradableTraitInfo, Requires<IMoveInfo>
public class HoversInfo : ConditionalTraitInfo, Requires<IMoveInfo>
{
[Desc("Amount of Z axis changes in world units.")]
public readonly int OffsetModifier = -43;
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new Hovers(this, init.Self); }
}
public class Hovers : UpgradableTrait<HoversInfo>, IRenderModifier
public class Hovers : ConditionalTrait<HoversInfo>, IRenderModifier
{
readonly HoversInfo info;

View File

@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public enum TrailType { Cell, CenterPosition }
[Desc("Renders a sprite effect when leaving a cell.")]
public class LeavesTrailsInfo : UpgradableTraitInfo
public class LeavesTrailsInfo : ConditionalTraitInfo
{
public readonly string Image = null;
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new LeavesTrails(init.Self, this); }
}
public class LeavesTrails : UpgradableTrait<LeavesTrailsInfo>, ITick
public class LeavesTrails : ConditionalTrait<LeavesTrailsInfo>, ITick
{
BodyOrientation body;
IFacing facing;

View File

@@ -28,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
[Desc("Displays a custom UI overlay relative to the selection box.")]
public class WithDecorationInfo : UpgradableTraitInfo
public class WithDecorationInfo : ConditionalTraitInfo
{
[Desc("Image used for this decoration. Defaults to the actor's type.")]
public readonly string Image = null;
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new WithDecoration(init.Self, this); }
}
public class WithDecoration : UpgradableTrait<WithDecorationInfo>, ITick, IRenderAboveShroud, IRenderAboveShroudWhenSelected
public class WithDecoration : ConditionalTrait<WithDecorationInfo>, ITick, IRenderAboveShroud, IRenderAboveShroudWhenSelected
{
protected readonly Animation Anim;

View File

@@ -14,7 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Periodically plays an idle animation, replacing the default body animation.")]
public class WithIdleAnimationInfo : UpgradableTraitInfo, Requires<WithSpriteBodyInfo>
public class WithIdleAnimationInfo : ConditionalTraitInfo, Requires<WithSpriteBodyInfo>
{
[SequenceReference, Desc("Sequence names to use.")]
public readonly string[] Sequences = { "active" };
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new WithIdleAnimation(init.Self, this); }
}
public class WithIdleAnimation : UpgradableTrait<WithIdleAnimationInfo>, ITick, INotifyBuildComplete, INotifySold
public class WithIdleAnimation : ConditionalTrait<WithIdleAnimationInfo>, ITick, INotifyBuildComplete, INotifySold
{
readonly WithSpriteBody wsb;
bool buildComplete;

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Renders a decorative animation on units and buildings.")]
public class WithIdleOverlayInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
public class WithIdleOverlayInfo : ConditionalTraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
{
[Desc("Animation to play when the actor is created.")]
[SequenceReference] public readonly string StartSequence = null;
@@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public class WithIdleOverlay : UpgradableTrait<WithIdleOverlayInfo>, INotifyDamageStateChanged, INotifyBuildComplete, INotifySold, INotifyTransform
public class WithIdleOverlay : ConditionalTrait<WithIdleOverlayInfo>, INotifyDamageStateChanged, INotifyBuildComplete, INotifySold, INotifyTransform
{
readonly Animation overlay;
bool buildComplete;

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
public class WithInfantryBodyInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires<IMoveInfo>, Requires<RenderSpritesInfo>
public class WithInfantryBodyInfo : ConditionalTraitInfo, IRenderActorPreviewSpritesInfo, Requires<IMoveInfo>, Requires<RenderSpritesInfo>
{
public readonly int MinIdleDelay = 30;
public readonly int MaxIdleDelay = 110;
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public class WithInfantryBody : UpgradableTrait<WithInfantryBodyInfo>, ITick, INotifyAttack, INotifyIdle
public class WithInfantryBody : ConditionalTrait<WithInfantryBodyInfo>, ITick, INotifyAttack, INotifyIdle
{
readonly IMove move;
protected readonly Animation DefaultAnimation;

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Renders the MuzzleSequence from the Armament trait.")]
class WithMuzzleOverlayInfo : UpgradableTraitInfo, Requires<RenderSpritesInfo>, Requires<AttackBaseInfo>, Requires<ArmamentInfo>
class WithMuzzleOverlayInfo : ConditionalTraitInfo, Requires<RenderSpritesInfo>, Requires<AttackBaseInfo>, Requires<ArmamentInfo>
{
[Desc("Ignore the weapon position, and always draw relative to the center of the actor")]
public readonly bool IgnoreOffset = false;
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new WithMuzzleOverlay(init.Self, this); }
}
class WithMuzzleOverlay : UpgradableTrait<WithMuzzleOverlayInfo>, INotifyAttack, IRender, ITick
class WithMuzzleOverlay : ConditionalTrait<WithMuzzleOverlayInfo>, INotifyAttack, IRender, ITick
{
readonly Dictionary<Barrel, bool> visible = new Dictionary<Barrel, bool>();
readonly Dictionary<Barrel, AnimationWithOffset> anims = new Dictionary<Barrel, AnimationWithOffset>();

View File

@@ -19,7 +19,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Renders a parachute on units.")]
public class WithParachuteInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
public class WithParachuteInfo : ConditionalTraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
{
[Desc("The image that contains the parachute sequences.")]
public readonly string Image = null;
@@ -94,7 +94,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public class WithParachute : UpgradableTrait<WithParachuteInfo>, ITick, IRender
public class WithParachute : ConditionalTrait<WithParachuteInfo>, ITick, IRender
{
readonly Animation shadow;
readonly AnimationWithOffset anim;

View File

@@ -17,7 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Clones the actor sprite with another palette below it.")]
public class WithShadowInfo : UpgradableTraitInfo
public class WithShadowInfo : ConditionalTraitInfo
{
[PaletteReference] public readonly string Palette = "shadow";
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits.Render
public override object Create(ActorInitializer init) { return new WithShadow(this); }
}
public class WithShadow : UpgradableTrait<WithShadowInfo>, IRenderModifier
public class WithShadow : ConditionalTrait<WithShadowInfo>, IRenderModifier
{
readonly WithShadowInfo info;

View File

@@ -19,7 +19,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Renders barrels for units with the Turreted trait.")]
public class WithSpriteBarrelInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires<TurretedInfo>,
public class WithSpriteBarrelInfo : ConditionalTraitInfo, IRenderActorPreviewSpritesInfo, Requires<TurretedInfo>,
Requires<ArmamentInfo>, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
{
[Desc("Sequence name to use.")]
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public class WithSpriteBarrel : UpgradableTrait<WithSpriteBarrelInfo>
public class WithSpriteBarrel : ConditionalTrait<WithSpriteBarrelInfo>
{
public readonly Animation DefaultAnimation;
readonly RenderSprites rs;

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Default trait for rendering sprite-based actors.")]
public class WithSpriteBodyInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>
public class WithSpriteBodyInfo : ConditionalTraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>
{
[Desc("Animation to play when the actor is created."), SequenceReference]
public readonly string StartSequence = null;
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public class WithSpriteBody : UpgradableTrait<WithSpriteBodyInfo>, INotifyDamageStateChanged, INotifyBuildComplete
public class WithSpriteBody : ConditionalTrait<WithSpriteBodyInfo>, INotifyDamageStateChanged, INotifyBuildComplete
{
public readonly Animation DefaultAnimation;

View File

@@ -19,7 +19,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Renders turrets for units with the Turreted trait.")]
public class WithSpriteTurretInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo,
public class WithSpriteTurretInfo : ConditionalTraitInfo, IRenderActorPreviewSpritesInfo,
Requires<RenderSpritesInfo>, Requires<TurretedInfo>, Requires<BodyOrientationInfo>, Requires<ArmamentInfo>
{
[Desc("Sequence name to use")]
@@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public class WithSpriteTurret : UpgradableTrait<WithSpriteTurretInfo>, INotifyBuildComplete, INotifySold, INotifyTransform, ITick, INotifyDamageStateChanged
public class WithSpriteTurret : ConditionalTrait<WithSpriteTurretInfo>, INotifyBuildComplete, INotifySold, INotifyTransform, ITick, INotifyDamageStateChanged
{
public readonly Animation DefaultAnimation;
protected readonly AttackBase Attack;

View File

@@ -20,7 +20,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
[Desc("Displays a text overlay relative to the selection box.")]
public class WithTextDecorationInfo : UpgradableTraitInfo
public class WithTextDecorationInfo : ConditionalTraitInfo
{
[FieldLoader.Require] [Translate] public readonly string Text = null;
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public class WithTextDecoration : UpgradableTrait<WithTextDecorationInfo>, IRender, IRenderAboveShroudWhenSelected, INotifyCapture
public class WithTextDecoration : ConditionalTrait<WithTextDecorationInfo>, IRender, IRenderAboveShroudWhenSelected, INotifyCapture
{
readonly SpriteFont font;
Color color;

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
public class WithVoxelBarrelInfo : UpgradableTraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<ArmamentInfo>, Requires<TurretedInfo>
public class WithVoxelBarrelInfo : ConditionalTraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<ArmamentInfo>, Requires<TurretedInfo>
{
[Desc("Voxel sequence name to use")]
public readonly string Sequence = "barrel";
@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public class WithVoxelBarrel : UpgradableTrait<WithVoxelBarrelInfo>, INotifyBuildComplete, INotifySold, INotifyTransform
public class WithVoxelBarrel : ConditionalTrait<WithVoxelBarrelInfo>, INotifyBuildComplete, INotifySold, INotifyTransform
{
readonly Actor self;
readonly Armament armament;

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 : UpgradableTraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>
public class WithVoxelBodyInfo : ConditionalTraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>
{
public readonly string Sequence = "idle";
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public class WithVoxelBody : UpgradableTrait<WithVoxelBodyInfo>, IAutoSelectionSize
public class WithVoxelBody : ConditionalTrait<WithVoxelBodyInfo>, IAutoSelectionSize
{
readonly int2 size;

View File

@@ -18,7 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits.Render
{
public class WithVoxelTurretInfo : UpgradableTraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<TurretedInfo>
public class WithVoxelTurretInfo : ConditionalTraitInfo, IRenderActorPreviewVoxelsInfo, Requires<RenderVoxelsInfo>, Requires<TurretedInfo>
{
[Desc("Voxel sequence name to use")]
public readonly string Sequence = "turret";
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public class WithVoxelTurret : UpgradableTrait<WithVoxelTurretInfo>, INotifyBuildComplete, INotifySold, INotifyTransform
public class WithVoxelTurret : ConditionalTrait<WithVoxelTurretInfo>, INotifyBuildComplete, INotifySold, INotifyTransform
{
readonly Actor self;
readonly Turreted turreted;