Skip to content

Commit

Permalink
add credits skip enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
Qlonever committed Dec 29, 2024
1 parent 28e31cf commit 95b2b7a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/overlays/ovl_ending/fox_end1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,17 @@ void Ending_Main(void) {
gCsFrameCount++;
gGameFrameCount++;

if (CVarGetInteger("gSkipCredits", 0)) {
gControllerLock = 0;
if (gControllerPress[0].button & START_BUTTON) {
D_ending_80196D00 = 7;
D_ending_80196D04 = 7200;
D_ending_80192E70 = 7200;
}
} else {
gControllerLock = 10000;
}

switch (D_ending_80196D00) {
case 0:
gRadioState = 0;
Expand Down Expand Up @@ -1150,6 +1161,10 @@ void Ending_Draw(void) {
}

void Ending_8018ABE8(void) {
if (CVarGetInteger("gSkipCredits", 0)) {
return;
}

if (gControllerPress[3].button & Z_TRIG) {
D_ending_80198584 ^= 1;
}
Expand Down Expand Up @@ -1357,6 +1372,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;
Expand Down
4 changes: 3 additions & 1 deletion src/overlays/ovl_ending/fox_end2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,9 @@ void Ending_801924EC(u32 arg0) {
}

void Ending_801926D4(void) {
gControllerLock = 10000;
if (!CVarGetInteger("gSkipCredits", 0)) {
gControllerLock = 10000;
}

Matrix_Push(&gGfxMatrix);

Expand Down
9 changes: 9 additions & 0 deletions src/port/ui/ImguiUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down

0 comments on commit 95b2b7a

Please sign in to comment.