Use nameof() to reference image fields.
This commit is contained in:
@@ -24,10 +24,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Width (in pixels) of the rallypoint line.")]
|
||||
public readonly int LineWidth = 1;
|
||||
|
||||
[SequenceReference("Image", allowNullImage: true)]
|
||||
[SequenceReference(nameof(Image), allowNullImage: true)]
|
||||
public readonly string FlagSequence = "flag";
|
||||
|
||||
[SequenceReference("Image", allowNullImage: true)]
|
||||
[SequenceReference(nameof(Image), allowNullImage: true)]
|
||||
public readonly string CirclesSequence = "circles";
|
||||
|
||||
[Desc("Cursor to display when rally point can be set.")]
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Dig animation image to play when transitioning.")]
|
||||
public readonly string SubterraneanTransitionImage = null;
|
||||
|
||||
[SequenceReference("SubterraneanTransitionImage")]
|
||||
[SequenceReference(nameof(SubterraneanTransitionImage))]
|
||||
[Desc("Dig animation sequence to play when transitioning.")]
|
||||
public readonly string SubterraneanTransitionSequence = null;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Image containing the crate effect animation sequence.")]
|
||||
public readonly string Image = "crate-effects";
|
||||
|
||||
[SequenceReference("Image", allowNullImage: true)]
|
||||
[SequenceReference(nameof(Image), allowNullImage: true)]
|
||||
[Desc("Animation sequence played when collected. Leave empty for no effect.")]
|
||||
public readonly string Sequence = null;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Image for the level up sprite.")]
|
||||
public readonly string LevelUpImage = null;
|
||||
|
||||
[SequenceReference("LevelUpImage", allowNullImage: true)]
|
||||
[SequenceReference(nameof(LevelUpImage), allowNullImage: true)]
|
||||
[Desc("Sequence for the level up sprite. Needs to be present on LevelUpImage.")]
|
||||
public readonly string LevelUpSequence = "levelup";
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Image where Ground/WaterCorpseSequence is looked up.")]
|
||||
public readonly string Image = "explosion";
|
||||
|
||||
[SequenceReference("Image", allowNullImage: true)]
|
||||
[SequenceReference(nameof(Image), allowNullImage: true)]
|
||||
public readonly string GroundCorpseSequence = null;
|
||||
|
||||
[PaletteReference]
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public readonly string GroundImpactSound = null;
|
||||
|
||||
[SequenceReference("Image", allowNullImage: true)]
|
||||
[SequenceReference(nameof(Image), allowNullImage: true)]
|
||||
public readonly string WaterCorpseSequence = null;
|
||||
|
||||
[PaletteReference]
|
||||
|
||||
@@ -31,13 +31,13 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public readonly string BeaconImage = "beacon";
|
||||
|
||||
[SequenceReference("BeaconImage")]
|
||||
[SequenceReference(nameof(BeaconImage))]
|
||||
public readonly string BeaconSequence = null;
|
||||
|
||||
[SequenceReference("BeaconImage")]
|
||||
[SequenceReference(nameof(BeaconImage))]
|
||||
public readonly string ArrowSequence = "arrow";
|
||||
|
||||
[SequenceReference("BeaconImage")]
|
||||
[SequenceReference(nameof(BeaconImage))]
|
||||
public readonly string CircleSequence = "circles";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new PlaceBeacon(init.Self, this); }
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
[FieldLoader.Require]
|
||||
public readonly string Image = null;
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
public readonly string[] Sequences = { "idle" };
|
||||
|
||||
[PaletteReference]
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
[Desc("Image used for the overlay.")]
|
||||
public readonly string Image = null;
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Sequence used for the overlay (cannot be animated).")]
|
||||
public readonly string Sequence = null;
|
||||
|
||||
|
||||
@@ -27,11 +27,11 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
[Desc("Image that defines the pip sequences.")]
|
||||
public readonly string Image = "pips";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Sequence used for empty pips.")]
|
||||
public readonly string EmptySequence = "pip-empty";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Sequence used for full pips.")]
|
||||
public readonly string FullSequence = "pip-green";
|
||||
|
||||
|
||||
@@ -26,15 +26,15 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
[Desc("Image that defines the pip sequences.")]
|
||||
public readonly string Image = "pips";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Sequence used for empty pips.")]
|
||||
public readonly string EmptySequence = "pip-empty";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Sequence used for full pips that aren't defined in CustomPipSequences.")]
|
||||
public readonly string FullSequence = "pip-green";
|
||||
|
||||
[SequenceReference("Image", dictionaryReference: LintDictionaryReference.Values)]
|
||||
[SequenceReference(nameof(Image), dictionaryReference: LintDictionaryReference.Values)]
|
||||
[Desc("Pip sequence to use for specific passenger actors.")]
|
||||
public readonly Dictionary<string, string> CustomPipSequences = new Dictionary<string, string>();
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
{
|
||||
public readonly string Image = "smoke_m";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
public readonly string IdleSequence = "idle";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
public readonly string LoopSequence = "loop";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
public readonly string EndSequence = "end";
|
||||
|
||||
[PaletteReference(nameof(IsPlayerPalette))]
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public readonly string Image = null;
|
||||
|
||||
[FieldLoader.Require]
|
||||
[SequenceReference("Image", allowNullImage: true)]
|
||||
[SequenceReference(nameof(Image), allowNullImage: true)]
|
||||
[Desc("Sequence used for this decoration (can be animated).")]
|
||||
public readonly string Sequence = null;
|
||||
|
||||
|
||||
@@ -27,15 +27,15 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
[Desc("Image that defines the pip sequences.")]
|
||||
public readonly string Image = "pips";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Sequence used for empty pips.")]
|
||||
public readonly string EmptySequence = "pip-empty";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Sequence used for full pips that aren't defined in ResourceSequences.")]
|
||||
public readonly string FullSequence = "pip-green";
|
||||
|
||||
[SequenceReference("Image", dictionaryReference: LintDictionaryReference.Values)]
|
||||
[SequenceReference(nameof(Image), dictionaryReference: LintDictionaryReference.Values)]
|
||||
[Desc("Pip sequence to use for specific resource types.")]
|
||||
public readonly Dictionary<string, string> ResourceSequences = new Dictionary<string, string>();
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
[Desc("Image used for this decoration. Defaults to the actor's type.")]
|
||||
public readonly string Image = null;
|
||||
|
||||
[SequenceReference("Image", allowNullImage: true)]
|
||||
[SequenceReference(nameof(Image), allowNullImage: true)]
|
||||
[Desc("Animation to play when the actor is created.")]
|
||||
public readonly string StartSequence = null;
|
||||
|
||||
[SequenceReference("Image", allowNullImage: true)]
|
||||
[SequenceReference(nameof(Image), allowNullImage: true)]
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "idle-overlay";
|
||||
|
||||
|
||||
@@ -25,15 +25,15 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
[Desc("The image that contains the parachute sequences.")]
|
||||
public readonly string Image = null;
|
||||
|
||||
[SequenceReference("Image", allowNullImage: true)]
|
||||
[SequenceReference(nameof(Image), allowNullImage: true)]
|
||||
[Desc("Parachute opening sequence.")]
|
||||
public readonly string OpeningSequence = null;
|
||||
|
||||
[SequenceReference("Image", allowNullImage: true)]
|
||||
[SequenceReference(nameof(Image), allowNullImage: true)]
|
||||
[Desc("Parachute idle sequence.")]
|
||||
public readonly string Sequence = null;
|
||||
|
||||
[SequenceReference("Image", allowNullImage: true)]
|
||||
[SequenceReference(nameof(Image), allowNullImage: true)]
|
||||
[Desc("Parachute closing sequence. Defaults to opening sequence played backwards.")]
|
||||
public readonly string ClosingSequence = null;
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
[Desc("The image that contains the shadow sequence for the paradropped unit.")]
|
||||
public readonly string ShadowImage = null;
|
||||
|
||||
[SequenceReference("ShadowImage", allowNullImage: true)]
|
||||
[SequenceReference(nameof(ShadowImage), allowNullImage: true)]
|
||||
[Desc("Paradropped unit's shadow sequence.")]
|
||||
public readonly string ShadowSequence = null;
|
||||
|
||||
|
||||
@@ -27,11 +27,11 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
[Desc("Image that defines the pip sequences.")]
|
||||
public readonly string Image = "pips";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Sequence used for empty pips.")]
|
||||
public readonly string EmptySequence = "pip-empty";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Sequence used for full pips.")]
|
||||
public readonly string FullSequence = "pip-green";
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
public readonly string Image = "pips";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Sprite sequence used to render the control group 0-9 numbers.")]
|
||||
public readonly string GroupSequence = "groups";
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public readonly string Sprite = "smokey";
|
||||
|
||||
[SequenceReference("Sprite")]
|
||||
[SequenceReference(nameof(Sprite))]
|
||||
public readonly string Sequence = "idle";
|
||||
|
||||
public readonly string Palette = "effect";
|
||||
|
||||
@@ -27,11 +27,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Delay (in ticks) after launch until the missile is spawned.")]
|
||||
public readonly int MissileDelay = 0;
|
||||
|
||||
[SequenceReference("MissileWeapon")]
|
||||
[SequenceReference(nameof(MissileWeapon))]
|
||||
[Desc("Sprite sequence for the ascending missile.")]
|
||||
public readonly string MissileUp = "up";
|
||||
|
||||
[SequenceReference("MissileWeapon")]
|
||||
[SequenceReference(nameof(MissileWeapon))]
|
||||
[Desc("Sprite sequence for the descending missile.")]
|
||||
public readonly string MissileDown = "down";
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Trail animation.")]
|
||||
public readonly string TrailImage = null;
|
||||
|
||||
[SequenceReference("TrailImage", allowNullImage: true)]
|
||||
[SequenceReference(nameof(TrailImage), allowNullImage: true)]
|
||||
[Desc("Loop a randomly chosen sequence of TrailImage from this list while this projectile is moving.")]
|
||||
public readonly string[] TrailSequences = { };
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public readonly string EffectImage = null;
|
||||
|
||||
[SequenceReference("EffectImage")]
|
||||
[SequenceReference(nameof(EffectImage))]
|
||||
public readonly string EffectSequence = null;
|
||||
|
||||
[PaletteReference]
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public readonly string IconImage = "icon";
|
||||
|
||||
[SequenceReference("IconImage")]
|
||||
[SequenceReference(nameof(IconImage))]
|
||||
[Desc("Icon sprite displayed in the support power palette.")]
|
||||
public readonly string Icon = null;
|
||||
|
||||
@@ -89,22 +89,22 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public readonly string BeaconImage = "beacon";
|
||||
|
||||
[SequenceReference("BeaconImage")]
|
||||
[SequenceReference(nameof(BeaconImage))]
|
||||
public readonly string BeaconPoster = null;
|
||||
|
||||
[PaletteReference]
|
||||
public readonly string BeaconPosterPalette = "chrome";
|
||||
|
||||
[SequenceReference("BeaconImage")]
|
||||
[SequenceReference(nameof(BeaconImage))]
|
||||
public readonly string ClockSequence = null;
|
||||
|
||||
[SequenceReference("BeaconImage")]
|
||||
[SequenceReference(nameof(BeaconImage))]
|
||||
public readonly string BeaconSequence = null;
|
||||
|
||||
[SequenceReference("BeaconImage")]
|
||||
[SequenceReference(nameof(BeaconImage))]
|
||||
public readonly string ArrowSequence = null;
|
||||
|
||||
[SequenceReference("BeaconImage")]
|
||||
[SequenceReference(nameof(BeaconImage))]
|
||||
public readonly string CircleSequence = null;
|
||||
|
||||
[Desc("Delay after launch, measured in ticks.")]
|
||||
|
||||
@@ -25,11 +25,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Sequence image where the selection overlay types are defined.")]
|
||||
public readonly string Image = "editor-overlay";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Sequence to use for the copy overlay.")]
|
||||
public readonly string CopySequence = "copy";
|
||||
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Sequence to use for the paste overlay.")]
|
||||
public readonly string PasteSequence = "paste";
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string Image = "resources";
|
||||
|
||||
[FieldLoader.Require]
|
||||
[SequenceReference("Image")]
|
||||
[SequenceReference(nameof(Image))]
|
||||
[Desc("Randomly chosen image sequences.")]
|
||||
public readonly string[] Sequences = { };
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public class ShroudRendererInfo : TraitInfo
|
||||
{
|
||||
public readonly string Sequence = "shroud";
|
||||
[SequenceReference("Sequence")]
|
||||
[SequenceReference(nameof(Sequence))]
|
||||
public readonly string[] ShroudVariants = { "shroud" };
|
||||
|
||||
[SequenceReference("Sequence")]
|
||||
[SequenceReference(nameof(Sequence))]
|
||||
public readonly string[] FogVariants = { "fog" };
|
||||
|
||||
[PaletteReference]
|
||||
@@ -40,13 +40,13 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Use the upper four bits when calculating frame")]
|
||||
public readonly bool UseExtendedIndex = false;
|
||||
|
||||
[SequenceReference("Sequence")]
|
||||
[SequenceReference(nameof(Sequence))]
|
||||
[Desc("Override for source art that doesn't define a fully shrouded tile")]
|
||||
public readonly string OverrideFullShroud = null;
|
||||
|
||||
public readonly int OverrideShroudIndex = 15;
|
||||
|
||||
[SequenceReference("Sequence")]
|
||||
[SequenceReference(nameof(Sequence))]
|
||||
[Desc("Override for source art that doesn't define a fully fogged tile")]
|
||||
public readonly string OverrideFullFog = null;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Sprite sequence name")]
|
||||
public readonly string SmokeType = "smoke_m";
|
||||
|
||||
[SequenceReference("SmokeType")]
|
||||
[SequenceReference(nameof(SmokeType))]
|
||||
public readonly string SmokeSequence = "idle";
|
||||
|
||||
[PaletteReference]
|
||||
|
||||
Reference in New Issue
Block a user