Skip to content

Commit

Permalink
Added confirm menu support to "return to lobby" and "restart speed be…
Browse files Browse the repository at this point in the history
…rry" in pause menu.
  • Loading branch information
NoMathExpectation committed Jun 30, 2024
1 parent 80a0078 commit 630fdfa
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Source/LevelExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 630fdfa

Please sign in to comment.