Use nameof() to reference image fields.

This commit is contained in:
Paul Chote
2020-08-15 11:00:11 +01:00
committed by abcdefg30
parent ac8b312140
commit cd9bf53e1a
37 changed files with 72 additions and 72 deletions

View File

@@ -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]

View File

@@ -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;

View File

@@ -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";

View File

@@ -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>();

View File

@@ -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))]

View File

@@ -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;

View File

@@ -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>();

View File

@@ -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";

View File

@@ -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;

View File

@@ -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";

View File

@@ -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";