From f90ba8d4ad50c1ec9c4b6313e5edddda879adcac Mon Sep 17 00:00:00 2001 From: Kiloku Date: Wed, 12 Feb 2025 22:47:58 -0300 Subject: [PATCH] Make DebugPause work with a shortcut --- src/port/mods/PortEnhancements.c | 8 ++++++++ src/port/ui/ImguiUI.cpp | 5 ++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/port/mods/PortEnhancements.c b/src/port/mods/PortEnhancements.c index 641ad55f..14431076 100644 --- a/src/port/mods/PortEnhancements.c +++ b/src/port/mods/PortEnhancements.c @@ -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); } diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index 71c294be..63eb520a 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -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")) {