From bc4bfbd0c52b005fdf5a09980b958cdcbcf7df97 Mon Sep 17 00:00:00 2001 From: Qlonever <42286723+Qlonever@users.noreply.github.com> Date: Sat, 28 Dec 2024 19:47:39 -0500 Subject: [PATCH] add credits skip enhancement --- src/overlays/ovl_ending/fox_end1.c | 8 ++++++++ src/overlays/ovl_ending/fox_end2.c | 7 +++++++ src/port/ui/ImguiUI.cpp | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/src/overlays/ovl_ending/fox_end1.c b/src/overlays/ovl_ending/fox_end1.c index 95176060..6172d53a 100644 --- a/src/overlays/ovl_ending/fox_end1.c +++ b/src/overlays/ovl_ending/fox_end1.c @@ -1150,6 +1150,10 @@ void Ending_Draw(void) { } void Ending_8018ABE8(void) { + if (CVarGetInteger("gSkipCredits", 0)) { + return; + } + if (gControllerPress[3].button & Z_TRIG) { D_ending_80198584 ^= 1; } @@ -1357,6 +1361,10 @@ void Ending_8018B174(Vec3f* actorPos, Vec3f* actorRot, f32* actorScale) { Vec3f sp1C = *actorRot; scale = *actorScale; + if (CVarGetInteger("gSkipCredits", 0)) { + return; + } + if (gControllerHold[2].button & Z_TRIG) { if (gControllerHold[2].button & R_CBUTTONS) { var_fa1 += 100.0f; diff --git a/src/overlays/ovl_ending/fox_end2.c b/src/overlays/ovl_ending/fox_end2.c index b94a8e23..8194005f 100644 --- a/src/overlays/ovl_ending/fox_end2.c +++ b/src/overlays/ovl_ending/fox_end2.c @@ -1084,6 +1084,13 @@ void Ending_801924EC(u32 arg0) { void Ending_801926D4(void) { gControllerLock = 10000; + if (CVarGetInteger("gSkipCredits", 0)) { + gControllerLock = 0; + if (gControllerPress[0].button & START_BUTTON) { + Ending_80191234(D_ending_801934B4[93].unk_0C, &D_ending_801934B4[93]); + } + } + Matrix_Push(&gGfxMatrix); Ending_801924EC(D_ending_80192E70); diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index 99dd148d..e2e7f637 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -449,6 +449,15 @@ void DrawEnhancementsMenu() { ImGui::EndMenu(); } + + if (UIWidgets::BeginMenu("Cutscenes")) { + UIWidgets::CVarCheckbox("Skip Credits", "gSkipCredits", { + .tooltip = "Allows skipping credits by pressing the START button", + .defaultValue = true + }); + + ImGui::EndMenu(); + } if (UIWidgets::BeginMenu("Fixes")) { UIWidgets::CVarCheckbox("Macbeth: Level ending cutscene camera fix", "gMaCameraFix", {