From 95abe577bd35342cc25abdf0a4034942e43c87c7 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 06a578ec..de8eac0f 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 a78d8b16..3fed9b82 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 c91267bd..e89a4fc8 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 88107964..f5e68e62 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;