Add remappable support to production icons.
This commit is contained in:
committed by
abcdefg30
parent
df4c363e9c
commit
9050a2447b
@@ -38,10 +38,13 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Sequence of the actor that contains the icon.")]
|
||||
public readonly string Icon = "icon";
|
||||
|
||||
[PaletteReference]
|
||||
[PaletteReference("IconPaletteIsPlayerPalette")]
|
||||
[Desc("Palette used for the production icon.")]
|
||||
public readonly string IconPalette = "chrome";
|
||||
|
||||
[Desc("Custom palette is a player palette BaseName")]
|
||||
public readonly bool IconPaletteIsPlayerPalette = false;
|
||||
|
||||
[Desc("Base build time in frames (-1 indicates to use the unit's Value).")]
|
||||
public readonly int BuildDuration = -1;
|
||||
|
||||
|
||||
@@ -164,6 +164,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly ActorInfo ActorInfo;
|
||||
public readonly Animation Icon;
|
||||
public readonly string IconPalette;
|
||||
public readonly bool IconPaletteIsPlayerPalette;
|
||||
public readonly int ProductionQueueOrder;
|
||||
public readonly int BuildPaletteOrder;
|
||||
public readonly TooltipInfo TooltipInfo;
|
||||
@@ -189,6 +190,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Icon = new Animation(owner.World, image);
|
||||
Icon.Play(BuildableInfo.Icon);
|
||||
IconPalette = BuildableInfo.IconPalette;
|
||||
IconPaletteIsPlayerPalette = BuildableInfo.IconPaletteIsPlayerPalette;
|
||||
BuildPaletteOrder = BuildableInfo.BuildPaletteOrder;
|
||||
ProductionQueueOrder = queues.Where(q => BuildableInfo.Queue.Contains(q.Type))
|
||||
.Select(q => q.DisplayOrder)
|
||||
|
||||
Reference in New Issue
Block a user