Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/game/level_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,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;
Expand All @@ -1273,6 +1273,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;
}

Expand Down
4 changes: 3 additions & 1 deletion src/port/hooks/list/EngineEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ DEFINE_EVENT(LevelScriptBeginArea,
DEFINE_EVENT(GeoLayoutCallASM,
GraphNodeFunc* func;
int16_t* parameter;
);
);

DEFINE_EVENT(LevelInitFromSaveFile);
8 changes: 8 additions & 0 deletions src/port/mods/PortEnhancements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions src/port/ui/GhostshipMenuEnhancements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading