fix parachute palette configuration
This commit is contained in:
@@ -32,7 +32,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[SequenceReference("Image")] public readonly string ClosingSequence = null;
|
[SequenceReference("Image")] public readonly string ClosingSequence = null;
|
||||||
|
|
||||||
[Desc("Palette used to render the parachute.")]
|
[Desc("Palette used to render the parachute.")]
|
||||||
public readonly string Palette = "player";
|
[PaletteReference("IsPlayerPalette")] public readonly string Palette = "player";
|
||||||
|
public readonly bool IsPlayerPalette = true;
|
||||||
|
|
||||||
[Desc("Parachute position relative to the paradropped unit.")]
|
[Desc("Parachute position relative to the paradropped unit.")]
|
||||||
public readonly WVec Offset = new WVec(0, 0, 384);
|
public readonly WVec Offset = new WVec(0, 0, 384);
|
||||||
@@ -44,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[SequenceReference("ShadowImage")] public readonly string ShadowSequence = null;
|
[SequenceReference("ShadowImage")] public readonly string ShadowSequence = null;
|
||||||
|
|
||||||
[Desc("Palette used to render the paradropped unit's shadow.")]
|
[Desc("Palette used to render the paradropped unit's shadow.")]
|
||||||
public readonly string ShadowPalette = "shadow";
|
[PaletteReference(false)] public readonly string ShadowPalette = "shadow";
|
||||||
|
|
||||||
[Desc("Shadow position relative to the paradropped unit's intended landing position.")]
|
[Desc("Shadow position relative to the paradropped unit's intended landing position.")]
|
||||||
public readonly WVec ShadowOffset = new WVec(0, 128, 0);
|
public readonly WVec ShadowOffset = new WVec(0, 128, 0);
|
||||||
@@ -108,7 +109,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
p => RenderUtils.ZOffsetFromCenter(self, p, 1));
|
p => RenderUtils.ZOffsetFromCenter(self, p, 1));
|
||||||
|
|
||||||
var rs = self.Trait<RenderSprites>();
|
var rs = self.Trait<RenderSprites>();
|
||||||
rs.Add(anim, info.Palette);
|
rs.Add(anim, info.Palette, info.IsPlayerPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpgradeEnabled(Actor self)
|
protected override void UpgradeEnabled(Actor self)
|
||||||
@@ -147,7 +148,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
shadow.Tick();
|
shadow.Tick();
|
||||||
var pos = self.CenterPosition - new WVec(0, 0, self.CenterPosition.Z);
|
var pos = self.CenterPosition - new WVec(0, 0, self.CenterPosition.Z);
|
||||||
return new IRenderable[] { new SpriteRenderable(shadow.Image, pos, info.ShadowOffset, info.ShadowZOffset, wr.Palette(info.ShadowPalette), 1, true) };
|
var palette = wr.Palette(info.ShadowPalette);
|
||||||
|
return new IRenderable[] { new SpriteRenderable(shadow.Image, pos, info.ShadowOffset, info.ShadowZOffset, palette, 1, true) };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user