Add Frame Advance feature

This commit is contained in:
Kiloku
2025-02-12 23:02:07 -03:00
committed by Lywx
parent f90ba8d4ad
commit 38a2029cec
2 changed files with 12 additions and 2 deletions
+6
View File
@@ -166,14 +166,20 @@ 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) {
+6 -2
View File
@@ -718,8 +718,12 @@ void DrawDebugMenu() {
.tooltip = "Jump to credits at the main menu"
});
UIWidgets::CVarCheckbox("Press L to Debug Pause", "gLToDebugPause");
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)) {
if (UIWidgets::Button("Clear Checkpoint")) {