From e99c951a0c47d613b51587a99e7f967d5bca608d Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sat, 19 Sep 2015 15:21:34 +0200 Subject: [PATCH 1/3] Hide WithBuildingPlacedOverlay after it has been played Fixes #9319. --- .../Traits/Render/WithBuildingPlacedOverlay.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedOverlay.cs index fe322347d9..5b8efe8418 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedOverlay.cs @@ -35,6 +35,7 @@ namespace OpenRA.Mods.Common.Traits { readonly Animation overlay; bool buildComplete; + bool visible; public WithBuildingPlacedOverlay(Actor self, WithBuildingPlacedOverlayInfo info) { @@ -47,15 +48,16 @@ namespace OpenRA.Mods.Common.Traits var anim = new AnimationWithOffset(overlay, () => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))), - () => !buildComplete); + () => !visible || !buildComplete); - overlay.Play(info.Sequence); + overlay.PlayThen(info.Sequence, () => visible = false); rs.Add(anim, info.Palette, info.IsPlayerPalette); } public void BuildingComplete(Actor self) { buildComplete = true; + visible = false; } public void Sold(Actor self) { } @@ -79,7 +81,8 @@ namespace OpenRA.Mods.Common.Traits public void BuildingPlaced(Actor self) { - overlay.Play(overlay.CurrentSequence.Name); + visible = true; + overlay.PlayThen(overlay.CurrentSequence.Name, () => visible = false); } } } \ No newline at end of file From 58e474ec80eab04b298b21f735ce40356f5a3e19 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sat, 19 Sep 2015 20:30:22 +0200 Subject: [PATCH 2/3] Make repair overlay invisible when not repairing --- OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs b/OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs index 0276d63150..370bfb4fd1 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithRepairOverlay.cs @@ -39,6 +39,7 @@ namespace OpenRA.Mods.Common.Traits { readonly Animation overlay; bool buildComplete; + bool visible; public WithRepairOverlay(Actor self, WithRepairOverlayInfo info) { @@ -47,11 +48,11 @@ namespace OpenRA.Mods.Common.Traits buildComplete = !self.Info.HasTraitInfo(); // always render instantly for units overlay = new Animation(self.World, rs.GetImage(self)); - overlay.Play(info.Sequence); + overlay.PlayThen(info.Sequence, () => visible = false); var anim = new AnimationWithOffset(overlay, () => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))), - () => !buildComplete, + () => !visible || !buildComplete, () => info.PauseOnLowPower && self.IsDisabled(), p => WithTurret.ZOffsetFromCenter(self, p, 1)); @@ -77,7 +78,8 @@ namespace OpenRA.Mods.Common.Traits public void Repairing(Actor self, Actor host) { - overlay.Play(overlay.CurrentSequence.Name); + visible = true; + overlay.PlayThen(overlay.CurrentSequence.Name, () => visible = false); } } } \ No newline at end of file From 4aaa62845df2729e64819de9c772ee0965e6aa64 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sat, 19 Sep 2015 20:32:39 +0200 Subject: [PATCH 3/3] Fix TS repair depot idle overlay This was an idle animation in the original, and this and "platform" cannot be displayed at the same time anyway. Also increased Tick rate to match idle light. --- mods/ts/rules/gdi-structures.yaml | 2 +- mods/ts/sequences/structures.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/ts/rules/gdi-structures.yaml b/mods/ts/rules/gdi-structures.yaml index 259074a9e4..d911bae8c3 100644 --- a/mods/ts/rules/gdi-structures.yaml +++ b/mods/ts/rules/gdi-structures.yaml @@ -233,7 +233,7 @@ GADEPT: Sequence: idle-light WithIdleOverlay@GROUND: Sequence: ground - WithRepairOverlay@CIRCUITS: + WithIdleOverlay@CIRCUITS: Sequence: circuits WithRepairOverlay@CRANE: Sequence: crane diff --git a/mods/ts/sequences/structures.yaml b/mods/ts/sequences/structures.yaml index 21d42b72d3..beaef28e60 100644 --- a/mods/ts/sequences/structures.yaml +++ b/mods/ts/sequences/structures.yaml @@ -1073,10 +1073,12 @@ gadept.gdi: circuits: gtdept_a Length: 5 ZOffset: -1c511 + Tick: 120 damaged-circuits: gtdept_a Start: 5 Length: 5 ZOffset: -1c511 + Tick: 120 crane: gtdept_c Length: 16 platform: gtdept_d @@ -1129,10 +1131,12 @@ gadept.nod: circuits: gtdept_a Length: 5 ZOffset: -1c511 + Tick: 120 damaged-circuits: gtdept_a Start: 5 Length: 5 ZOffset: -1c511 + Tick: 120 crane: gtdept_c Length: 16 platform: gtdept_d