From cfcca0f9eb3116ee28c597019281249d0c4a8495 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Wed, 17 Jan 2024 18:49:14 -0500 Subject: [PATCH] clean up event queues --- Assets/Scripts/Games/FlipperFlop/FlipperFlop.cs | 12 ++++++------ Assets/Scripts/Games/Lockstep/Lockstep.cs | 2 ++ .../Scripts/Games/OctopusMachine/OctopusMachine.cs | 5 +++++ Assets/Scripts/Games/Tunnel/Tunnel.cs | 5 +++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Games/FlipperFlop/FlipperFlop.cs b/Assets/Scripts/Games/FlipperFlop/FlipperFlop.cs index 06a578ecb..de8eac0f3 100644 --- a/Assets/Scripts/Games/FlipperFlop/FlipperFlop.cs +++ b/Assets/Scripts/Games/FlipperFlop/FlipperFlop.cs @@ -229,6 +229,12 @@ namespace HeavenStudio.Games evt.Disable(); } } + public override void OnPlay(double beat) + { + queuedInputs.Clear(); + queuedAttentions.Clear(); + queuedFlipperRollVoiceLines.Clear(); + } public override void OnBeatPulse(double beat) { @@ -322,12 +328,6 @@ namespace HeavenStudio.Games } } } - else if (!cond.isPlaying) - { - queuedInputs.Clear(); - queuedAttentions.Clear(); - queuedFlipperRollVoiceLines.Clear(); - } } public void ToggleTuck() diff --git a/Assets/Scripts/Games/Lockstep/Lockstep.cs b/Assets/Scripts/Games/Lockstep/Lockstep.cs index a78d8b168..3fed9b82c 100644 --- a/Assets/Scripts/Games/Lockstep/Lockstep.cs +++ b/Assets/Scripts/Games/Lockstep/Lockstep.cs @@ -280,6 +280,7 @@ namespace HeavenStudio.Games { rt.Release(); } + queuedInputs.Clear(); } private static bool ForceStepOnBeat(double beat) @@ -310,6 +311,7 @@ namespace HeavenStudio.Games public override void OnPlay(double beat) { + queuedInputs.Clear(); QueueSwitchBGs(beat); PersistColors(beat); } diff --git a/Assets/Scripts/Games/OctopusMachine/OctopusMachine.cs b/Assets/Scripts/Games/OctopusMachine/OctopusMachine.cs index c91267bd7..e89a4fc8b 100644 --- a/Assets/Scripts/Games/OctopusMachine/OctopusMachine.cs +++ b/Assets/Scripts/Games/OctopusMachine/OctopusMachine.cs @@ -389,6 +389,11 @@ namespace HeavenStudio.Games public override void OnPlay(double beat) { + + if (queuedSqueezes.Count > 0) queuedSqueezes.Clear(); + if (queuedReleases.Count > 0) queuedReleases.Clear(); + if (queuedPops.Count > 0) queuedPops.Clear(); + queuePrepare = double.MaxValue; PersistColor(beat); } diff --git a/Assets/Scripts/Games/Tunnel/Tunnel.cs b/Assets/Scripts/Games/Tunnel/Tunnel.cs index 881079643..f5e68e629 100644 --- a/Assets/Scripts/Games/Tunnel/Tunnel.cs +++ b/Assets/Scripts/Games/Tunnel/Tunnel.cs @@ -126,6 +126,11 @@ namespace HeavenStudio.Games } } + public override void OnPlay(double beat) + { + queuedInputs.Clear(); + } + private void Start() { handStart = -1f;