Add support for defining the palette of WithResourceLevelOverlay
This commit is contained in:
@@ -21,6 +21,13 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
[Desc("Sequence name to use")]
|
[Desc("Sequence name to use")]
|
||||||
public readonly string Sequence = "resources";
|
public readonly string Sequence = "resources";
|
||||||
|
|
||||||
|
[PaletteReference("IsPlayerPalette")]
|
||||||
|
[Desc("Custom palette name.")]
|
||||||
|
public readonly string Palette = null;
|
||||||
|
|
||||||
|
[Desc("Custom palette is a player palette BaseName.")]
|
||||||
|
public readonly bool IsPlayerPalette = false;
|
||||||
|
|
||||||
public override object Create(ActorInitializer init) { return new WithResourceLevelOverlay(init.Self, this); }
|
public override object Create(ActorInitializer init) { return new WithResourceLevelOverlay(init.Self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
0);
|
0);
|
||||||
|
|
||||||
anim = new AnimationWithOffset(a, null, () => IsTraitDisabled, 1024);
|
anim = new AnimationWithOffset(a, null, () => IsTraitDisabled, 1024);
|
||||||
rs.Add(anim);
|
rs.Add(anim, info.Palette, info.IsPlayerPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
void INotifyDamageStateChanged.DamageStateChanged(Actor self, AttackInfo e)
|
void INotifyDamageStateChanged.DamageStateChanged(Actor self, AttackInfo e)
|
||||||
|
|||||||
Reference in New Issue
Block a user