Make DebugPause work with a shortcut

This commit is contained in:
Kiloku 2025-02-12 22:47:58 -03:00 committed by Lywx
parent 92fe25c22d
commit f90ba8d4ad
2 changed files with 10 additions and 3 deletions

View File

@ -165,6 +165,14 @@ void OnGameUpdatePost(IEvent* event) {
}
void OnPlayUpdateEvent(IEvent* event){
bool debugPaused = CVarGetInteger("gDebugPause", 0);
if (CVarGetInteger("gLToDebugPause", 0)){
if (gControllerPress[0].button & L_TRIG) {
CVarSetInteger("gDebugPause", !debugPaused);
}
} else {
CVarSetInteger("gDebugPause", 0); //Unpause if we disable the shortcut
}
event->cancelled = CVarGetInteger("gDebugPause", 0);
}

View File

@ -718,9 +718,8 @@ void DrawDebugMenu() {
.tooltip = "Jump to credits at the main menu"
});
if (gGameState == GSTATE_PLAY){
UIWidgets::CVarCheckbox("Debug Pause", "gDebugPause");
}
UIWidgets::CVarCheckbox("Press L to Debug Pause", "gLToDebugPause");
if (CVarGetInteger(StringHelper::Sprintf("gCheckpoint.%d.Set", gCurrentLevel).c_str(), 0)) {
if (UIWidgets::Button("Clear Checkpoint")) {