From 630fdfa8c01ea84b47450bc3a900b52c7d8ebe03 Mon Sep 17 00:00:00 2001 From: NoMathExpectation <85624722+NoMathExpectation@users.noreply.github.com> Date: Sun, 30 Jun 2024 19:05:16 +0800 Subject: [PATCH] Added confirm menu support to "return to lobby" and "restart speed berry" in pause menu. --- Source/LevelExtension.cs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Source/LevelExtension.cs b/Source/LevelExtension.cs index 091a3a1..8039a46 100644 --- a/Source/LevelExtension.cs +++ b/Source/LevelExtension.cs @@ -326,6 +326,38 @@ private static void AfterCreatePauseMenuButtons(Level level, TextMenu menu, bool }); continue; } + + if (label == "collabutils2_returntolobby".DialogCleanOrNull()) + { + var origPressed = button.OnPressed; + button.Pressed(() => + { + menu.RemoveSelf(); + level.PauseMainMenuOpen = false; + level.GiveUpGolden(menu.IndexOf(button), minimal, label, m2 => + { + m2.RemoveSelf(); + origPressed(); + }); + }); + continue; + } + + if (label == "collabutils2_restartspeedberry".DialogCleanOrNull()) + { + var origPressed = button.OnPressed; + button.Pressed(() => + { + menu.RemoveSelf(); + level.PauseMainMenuOpen = false; + level.GiveUpGolden(menu.IndexOf(button), minimal, label, m2 => + { + m2.RemoveSelf(); + origPressed(); + }); + }); + continue; + } } }