check palette references

This commit is contained in:
Matthias Mailänder
2015-07-19 18:08:17 +02:00
parent ba8e292b71
commit 118782a85e
55 changed files with 191 additions and 58 deletions

View File

@@ -43,4 +43,11 @@ namespace OpenRA.Traits
[AttributeUsage(AttributeTargets.Field)]
public sealed class UpgradeUsedReferenceAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Field)]
public sealed class PaletteDefinitionAttribute : Attribute { }
// TODO: differentiate player palettes
[AttributeUsage(AttributeTargets.Field)]
public sealed class PaletteReferenceAttribute : Attribute { }
}

View File

@@ -16,15 +16,20 @@ namespace OpenRA.Traits
public class FixedColorPaletteInfo : ITraitInfo
{
[Desc("The name of the palette to base off.")]
public readonly string Base = "terrain";
[PaletteReference] public readonly string Base = "terrain";
[Desc("The name of the resulting palette")]
public readonly string Name = "resources";
[PaletteDefinition] public readonly string Name = "resources";
[Desc("Remap these indices to pre-defined colors.")]
public readonly int[] RemapIndex = { };
[Desc("The fixed color to remap.")]
public readonly HSLColor Color;
[Desc("Luminosity range to span.")]
public readonly float Ramp = 0.05f;
[Desc("Allow palette modifiers to change the palette.")]
public readonly bool AllowModifiers = true;

View File

@@ -17,13 +17,17 @@ namespace OpenRA.Traits
public class PlayerColorPaletteInfo : ITraitInfo
{
[Desc("The name of the palette to base off.")]
public readonly string BasePalette = null;
[PaletteReference] public readonly string BasePalette = null;
[Desc("The prefix for the resulting player palettes")]
public readonly string BaseName = "player";
[Desc("Remap these indices to player colors.")]
public readonly int[] RemapIndex = { };
[Desc("Luminosity range to span.")]
public readonly float Ramp = 0.05f;
[Desc("Allow palette modifiers to change the palette.")]
public readonly bool AllowModifiers = true;

View File

@@ -17,7 +17,7 @@ namespace OpenRA.Traits
{
public readonly string Sequence = "resources";
[SequenceReference("Sequence")] public readonly string[] Variants = { };
public readonly string Palette = "terrain";
[PaletteReference] public readonly string Palette = "terrain";
public readonly int ResourceType = 1;
public readonly int ValuePerUnit = 0;