diff --git a/src/game/level_update.c b/src/game/level_update.c index be5b8c3a..a0dd919a 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -1260,7 +1260,7 @@ s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) { #endif sWarpDest.type = WARP_TYPE_NOT_WARPING; sDelayedWarpOp = WARP_OP_NONE; - gNeverEnteredCastle = save_file_exists(gCurrSaveFileNum - 1) == FALSE && CVarGetInteger("gEnhancements.DisablePeachCutscene", 0) == 0; + gNeverEnteredCastle = save_file_exists(gCurrSaveFileNum - 1) == FALSE; gCurrLevelNum = levelNum; gCurrCourseNum = COURSE_NONE; @@ -1274,6 +1274,8 @@ s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) { select_mario_cam_mode(); set_yoshi_as_not_dead(); + CALL_EVENT(LevelInitFromSaveFile); + return levelNum; } diff --git a/src/port/hooks/list/EngineEvent.h b/src/port/hooks/list/EngineEvent.h index 74f30b1b..2683f553 100644 --- a/src/port/hooks/list/EngineEvent.h +++ b/src/port/hooks/list/EngineEvent.h @@ -24,4 +24,6 @@ DEFINE_EVENT(LevelScriptBeginArea, DEFINE_EVENT(GeoLayoutCallASM, GraphNodeFunc* func; int16_t* parameter; -); \ No newline at end of file +); + +DEFINE_EVENT(LevelInitFromSaveFile); diff --git a/src/port/mods/PortEnhancements.cpp b/src/port/mods/PortEnhancements.cpp index 8cfb518c..3103dd2a 100644 --- a/src/port/mods/PortEnhancements.cpp +++ b/src/port/mods/PortEnhancements.cpp @@ -3,6 +3,7 @@ #define INIT_EVENT_IDS #include "sm64.h" +#include "game/level_update.h" #include "menu/title_screen.h" #include "port/hooks/Events.h" #include "assets/bin/segment2.h" @@ -73,11 +74,18 @@ void PortEnhancements_Init() { RenderPauseCourseOptions* ev = (RenderPauseCourseOptions*)event; *ev->render = true; }); + + REGISTER_LISTENER(LevelInitFromSaveFile, EVENT_PRIORITY_NORMAL, [](IEvent* event) { + if (CVarGetInteger("gEnhancements.DisableLakituCutscene", 0)) { + gNeverEnteredCastle = false; + } + }); } void PortEnhancements_Register() { // Register engine events REGISTER_EVENT(GameFrameUpdate); + REGISTER_EVENT(LevelInitFromSaveFile); REGISTER_EVENT(GeoLayoutCallASM); REGISTER_EVENT(LevelScriptCallLoop); REGISTER_EVENT(LevelScriptBeginArea); diff --git a/src/port/ui/GhostshipMenuEnhancements.cpp b/src/port/ui/GhostshipMenuEnhancements.cpp index e3cad081..d0c7898c 100644 --- a/src/port/ui/GhostshipMenuEnhancements.cpp +++ b/src/port/ui/GhostshipMenuEnhancements.cpp @@ -137,6 +137,11 @@ void GhostshipMenu::AddMenuEnhancements() { .CVar(CVAR_ENHANCEMENT("DisablePeachCutscene")) .RaceDisable(false) .Options(CheckboxOptions().Tooltip("Skips the Peach cutscene when starting a new game.")); + AddWidget(path, "Skip Intro Lakitu", WIDGET_CVAR_CHECKBOX) + .CVar(CVAR_ENHANCEMENT("DisableLakituCutscene")) + .RaceDisable(false) + .Options(CheckboxOptions().Tooltip("The Lakitu will not appear when Mario reaches the bridge outside Peach's \n" + "Castle. Also skips Bowser's message when Mario first enters the castle.")); path = { "Enhancements", "Fixes", SECTION_COLUMN_1 }; AddSidebarEntry("Enhancements", path.sidebarName, 1);