diff --git a/OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs index b08cf18505..5a8014f3a3 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithIdleOverlay.cs @@ -19,6 +19,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Renders a decorative animation on units and buildings.")] public class WithIdleOverlayInfo : UpgradableTraitInfo, IRenderActorPreviewSpritesInfo, Requires, Requires { + [Desc("Animation to play when the actor is created.")] + [SequenceReference] public readonly string StartSequence = null; + [Desc("Sequence name to use")] [SequenceReference] public readonly string Sequence = "idle-overlay"; @@ -67,7 +70,11 @@ namespace OpenRA.Mods.Common.Traits buildComplete = !self.HasTrait(); // always render instantly for units overlay = new Animation(self.World, rs.GetImage(self)); - overlay.PlayRepeating(RenderSprites.NormalizeSequence(overlay, self.GetDamageState(), info.Sequence)); + if (info.StartSequence != null) + overlay.PlayThen(RenderSprites.NormalizeSequence(overlay, self.GetDamageState(), info.StartSequence), + () => overlay.PlayRepeating(RenderSprites.NormalizeSequence(overlay, self.GetDamageState(), info.Sequence))); + else + overlay.PlayRepeating(RenderSprites.NormalizeSequence(overlay, self.GetDamageState(), info.Sequence)); var anim = new AnimationWithOffset(overlay, () => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))), diff --git a/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs b/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs index f386f8ec39..0bbcd71e38 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSpriteBody.cs @@ -57,11 +57,11 @@ namespace OpenRA.Mods.Common.Traits DefaultAnimation = new Animation(init.World, rs.GetImage(init.Self), baseFacing); rs.Add(new AnimationWithOffset(DefaultAnimation, null, () => IsTraitDisabled)); - if (Info.StartSequence != null) - PlayCustomAnimation(init.Self, Info.StartSequence, - () => DefaultAnimation.PlayRepeating(NormalizeSequence(init.Self, Info.Sequence))); + if (info.StartSequence != null) + PlayCustomAnimation(init.Self, info.StartSequence, + () => PlayCustomAnimationRepeating(init.Self, info.Sequence)); else - DefaultAnimation.PlayRepeating(NormalizeSequence(init.Self, Info.Sequence)); + DefaultAnimation.PlayRepeating(NormalizeSequence(init.Self, info.Sequence)); } public string NormalizeSequence(Actor self, string sequence) diff --git a/mods/cnc/rules/tech.yaml b/mods/cnc/rules/tech.yaml index 9f2fead910..2a564ba8a1 100644 --- a/mods/cnc/rules/tech.yaml +++ b/mods/cnc/rules/tech.yaml @@ -11,8 +11,13 @@ V19: V19.Husk: Inherits: ^CivBuildingHusk + -RenderBuilding: + AutoSelectionSize: RenderSprites: + BodyOrientation: + QuantizedFacings: 1 WithSpriteBody: + WithIdleOverlay: StartSequence: fire-start Sequence: fire-loop Building: diff --git a/mods/cnc/sequences/decorations.yaml b/mods/cnc/sequences/decorations.yaml index 8c062f662e..5ff5cd8da9 100644 --- a/mods/cnc/sequences/decorations.yaml +++ b/mods/cnc/sequences/decorations.yaml @@ -667,10 +667,12 @@ v19.husk: fire-start: flmspt Length: * Offset: 7,-15 + ZOffset: 1 fire-loop: flmspt Start: 50 Length: * Offset: 7,-15 + ZOffset: 1 v20: Defaults: diff --git a/mods/ra/rules/civilian.yaml b/mods/ra/rules/civilian.yaml index 564b4f790f..d68f1e6779 100644 --- a/mods/ra/rules/civilian.yaml +++ b/mods/ra/rules/civilian.yaml @@ -232,8 +232,13 @@ V19.Husk: ExcludeTilesets: DESERT Tooltip: Name: Husk (Oil Pump) + -RenderBuilding: + AutoSelectionSize: RenderSprites: + BodyOrientation: + QuantizedFacings: 1 WithSpriteBody: + WithIdleOverlay: StartSequence: fire-start Sequence: fire-loop -Health: diff --git a/mods/ra/sequences/decorations.yaml b/mods/ra/sequences/decorations.yaml index a7b67df73b..a677b72d00 100644 --- a/mods/ra/sequences/decorations.yaml +++ b/mods/ra/sequences/decorations.yaml @@ -514,10 +514,12 @@ v19.husk: fire-start: flmspt Length: * Offset: 7,-15 + ZOffset: 1 fire-loop: flmspt Start: 50 Length: * Offset: 7,-15 + ZOffset: 1 utilpol1: idle: