unhardcode and self-document more resource/smudge parameters

This commit is contained in:
Matthias Mailänder
2014-08-23 20:24:54 +02:00
parent f0fc63b15d
commit 5b4f8d1446
2 changed files with 10 additions and 2 deletions

View File

@@ -17,8 +17,10 @@ namespace OpenRA.Traits
{
// HACK: The editor is getting really unmaintanable...
public readonly string EditorSprite;
public readonly string[] Variants = { };
public readonly string Palette = "terrain";
public readonly string Sequence = "resources";
public readonly int ResourceType = 1;
public readonly int ValuePerUnit = 0;
@@ -47,7 +49,7 @@ namespace OpenRA.Traits
Variants = new Dictionary<string, Sprite[]>();
foreach (var v in info.Variants)
{
var seq = world.Map.SequenceProvider.GetSequence("resources", v);
var seq = world.Map.SequenceProvider.GetSequence(Info.Sequence, v);
var sprites = Exts.MakeArray(seq.Length, x => seq.GetSprite(x));
Variants.Add(v, sprites);
}