From 83bfccc10115b089f6b8d747c366c2be64c4335c Mon Sep 17 00:00:00 2001 From: ImVeryBad Date: Sun, 22 Mar 2026 11:25:28 +0100 Subject: [PATCH] Disable page navigation while Save Data prompts are open in Options. --- source/funkin/ui/options/SaveDataMenu.hx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/source/funkin/ui/options/SaveDataMenu.hx b/source/funkin/ui/options/SaveDataMenu.hx index 18e678136..9f39703cf 100644 --- a/source/funkin/ui/options/SaveDataMenu.hx +++ b/source/funkin/ui/options/SaveDataMenu.hx @@ -84,25 +84,24 @@ class SaveDataMenu extends Page prompt.createBgFromMargin(100, 0xFFFAFD6D); prompt.back.scrollFactor.set(0, 0); FlxG.state.add(prompt); + // Disable page navigation while the prompt is open + codex.currentPage.enabled = false; + + final closePrompt:()->Void = () -> { + codex.currentPage.enabled = true; + prompt.close(); + prompt.destroy(); + prompt = null; + }; prompt.onYes = function() { onYes(); - if (prompt != null) - { - prompt.close(); - prompt.destroy(); - prompt = null; - } + closePrompt(); }; - prompt.onNo = function() - { - prompt.close(); - prompt.destroy(); - prompt = null; - } + prompt.onNo = closePrompt; } public function openSaveDataPrompt()