From be3fe9028a738041db2fd2f53ea72e8351b14cc1 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Sun, 8 Dec 2024 20:37:46 -0500 Subject: [PATCH] fix: remove the input delay on pause menu, allowing for inputs immediately when opening the pause menu --- source/funkin/play/PauseSubState.hx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/funkin/play/PauseSubState.hx b/source/funkin/play/PauseSubState.hx index 3e7d8170c..384f2dc20 100644 --- a/source/funkin/play/PauseSubState.hx +++ b/source/funkin/play/PauseSubState.hx @@ -129,7 +129,10 @@ class PauseSubState extends MusicBeatSubState * Disallow input until transitions are complete! * This prevents the pause menu from immediately closing when opened, among other things. */ - public var allowInput:Bool = false; + public var allowInput:Bool = true; + + // If this is true, it means we are frame 1 of our substate. + var justOpened:Bool = true; /** * The entries currently displayed in the pause menu. @@ -398,10 +401,6 @@ class PauseSubState extends MusicBeatSubState FlxTween.tween(child, {alpha: 1, y: child.y + 5}, 1.8, {ease: FlxEase.quartOut, startDelay: delay}); delay += 0.1; } - - new FlxTimer().start(0.2, (_) -> { - allowInput = true; - }); } // =============== @@ -424,15 +423,18 @@ class PauseSubState extends MusicBeatSubState changeSelection(1); } - if (controls.ACCEPT) + if (controls.ACCEPT && !justOpened) { currentMenuEntries[currentEntry].callback(this); } - else if (controls.PAUSE) + else if (controls.PAUSE && !justOpened) { resume(this); } + // we only want justOpened to be true for 1 single frame, when we first get into the pause menu substate + justOpened = false; + #if FEATURE_DEBUG_FUNCTIONS // to pause the game and get screenshots easy, press H on pause menu! if (FlxG.keys.justPressed.H)