summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSonic Dreamcaster <alejandro.asenjo88@gmail.com>2025-02-18 20:12:19 -0300
committerSonic Dreamcaster <alejandro.asenjo88@gmail.com>2025-02-18 20:12:19 -0300
commit2b2e10a7c48f230b3ccb9ee4a1b46d83d34f639e (patch)
tree9f729ef5e215136254f06a761c990bb066381021 /src
parentc76d6277a8a631740119f3bb219bba61f4e1ea98 (diff)
parent38a2029cecd2b720c14eb19a949d6b99daf06da2 (diff)
Merge branch 'main' of https://github.com/HarbourMasters/Starship
Diffstat (limited to 'src')
-rw-r--r--src/port/mods/PortEnhancements.c14
-rw-r--r--src/port/ui/ImguiUI.cpp7
2 files changed, 19 insertions, 2 deletions
diff --git a/src/port/mods/PortEnhancements.c b/src/port/mods/PortEnhancements.c
index 641ad55f..3c38a290 100644
--- a/src/port/mods/PortEnhancements.c
+++ b/src/port/mods/PortEnhancements.c
@@ -165,7 +165,21 @@ void OnGameUpdatePost(IEvent* event) {
}
void OnPlayUpdateEvent(IEvent* event){
+ bool debugPaused = CVarGetInteger("gDebugPause", 0);
+ bool shouldRepause = false;
+ if (CVarGetInteger("gLToDebugPause", 0)){
+ if (gControllerPress[0].button & L_TRIG) {
+ CVarSetInteger("gDebugPause", !debugPaused);
+ shouldRepause = debugPaused && CVarGetInteger("gLToFrameAdvance", 0);
+ }
+ } else {
+ CVarSetInteger("gDebugPause", 0); //Unpause if we disable the shortcut
+ }
+
event->cancelled = CVarGetInteger("gDebugPause", 0);
+ if (shouldRepause){
+ CVarSetInteger("gDebugPause", 1);
+ }
}
void RefillBoostMeter(Player* player) {
diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp
index 71c294be..829b45ec 100644
--- a/src/port/ui/ImguiUI.cpp
+++ b/src/port/ui/ImguiUI.cpp
@@ -718,8 +718,11 @@ void DrawDebugMenu() {
.tooltip = "Jump to credits at the main menu"
});
- if (gGameState == GSTATE_PLAY){
- UIWidgets::CVarCheckbox("Debug Pause", "gDebugPause");
+ UIWidgets::CVarCheckbox("Press L to toggle Debug Pause", "gLToDebugPause");
+ if (CVarGetInteger("gLToDebugPause", 0)){
+ ImGui::Dummy(ImVec2(22.0f, 0.0f));
+ ImGui::SameLine();
+ UIWidgets::CVarCheckbox("Pressing L again advances one frame instead", "gLToFrameAdvance");
}
if (CVarGetInteger(StringHelper::Sprintf("gCheckpoint.%d.Set", gCurrentLevel).c_str(), 0)) {