WithIdleOverlay: support animation with facings

This commit is contained in:
dnqbob
2024-05-01 10:00:59 +08:00
committed by Gustas
parent 670067ae3a
commit 64f35feb13

View File

@@ -92,9 +92,10 @@ namespace OpenRA.Mods.Common.Traits.Render
{
var rs = self.Trait<RenderSprites>();
var body = self.Trait<BodyOrientation>();
var facing = self.TraitOrDefault<IFacing>();
var image = info.Image ?? rs.GetImage(self);
overlay = new Animation(self.World, image, () => IsTraitPaused)
overlay = new Animation(self.World, image, facing == null ? () => WAngle.Zero : (body == null ? () => facing.Facing : () => body.QuantizeFacing(facing.Facing)), () => IsTraitPaused)
{
IsDecoration = info.IsDecoration
};