diff --git a/src/game/bettercamera.inc.h b/src/game/bettercamera.inc.h index 3d048e18..fc063e2a 100644 --- a/src/game/bettercamera.inc.h +++ b/src/game/bettercamera.inc.h @@ -193,7 +193,11 @@ void newcam_init_settings(void) { newcam_analogue = (s16)configCameraAnalog; newcam_degrade = (f32)configCameraDegrade; - newcam_toggle(configEnableCamera); + // setup main menu camera + extern bool gDjuiInMainMenu; + if (gDjuiInMainMenu) { newcam_tilt = 5; } + + newcam_toggle(configEnableCamera || gDjuiInMainMenu); } /** Mathematic calculations. This stuffs so basic even *I* understand it lol diff --git a/src/game/camera.h b/src/game/camera.h index 5263bb9e..3496dada 100644 --- a/src/game/camera.h +++ b/src/game/camera.h @@ -776,4 +776,6 @@ void obj_rotate_towards_point(struct Object *o, Vec3f point, s16 pitchOff, s16 y Gfx *geo_camera_fov(s32 callContext, struct GraphNode *g, UNUSED void *context); +s32 set_camera_mode_fixed(struct Camera* c, s16 x, s16 y, s16 z); + #endif // CAMERA_H diff --git a/src/game/level_update.c b/src/game/level_update.c index dad9e42c..520b2064 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -1300,7 +1300,9 @@ s32 init_level(void) { } else if (gDebugLevelSelect == 0) { if (gMarioState->action != ACT_UNINITIALIZED) { bool skipIntro = (gNetworkType == NT_NONE); - if (save_file_exists(gCurrSaveFileNum - 1) || skipIntro) { + if (gDjuiInMainMenu) { + set_mario_action(gMarioState, ACT_INTRO_CUTSCENE, 7); + } else if (save_file_exists(gCurrSaveFileNum - 1) || skipIntro) { set_mario_action(gMarioState, ACT_IDLE, 0); } else if (gCLIOpts.SkipIntro == 0 && configSkipIntro == 0 && gServerSettings.skipIntro == 0) { set_mario_action(gMarioState, ACT_INTRO_CUTSCENE, 0); diff --git a/src/game/mario.c b/src/game/mario.c index e1bd3046..76b0c80f 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -1782,7 +1782,7 @@ void mario_update_hitbox_and_cap_model(struct MarioState *m) { } struct NetworkPlayer* np = &gNetworkPlayers[gMarioState->playerIndex]; - u8 teleportFade = (m->flags & MARIO_TELEPORTING) || (np->type != NPT_LOCAL && np->fadeOpacity < 32); + u8 teleportFade = (m->flags & MARIO_TELEPORTING) || (gMarioState->playerIndex != 0 && np->fadeOpacity < 32); if (teleportFade && (m->fadeWarpOpacity != 0xFF)) { bodyState->modelState &= ~0xFF; bodyState->modelState |= (0x100 | m->fadeWarpOpacity); diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index 57919542..7a05a114 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -1830,7 +1830,7 @@ static void intro_cutscene_peach_lakitu_scene(struct MarioState *m) { #define TIMER_RAISE_PIPE 38 #endif -static void intro_cutscene_raise_pipe(struct MarioState *m) { +static void intro_cutscene_raise_pipe(struct MarioState* m) { u8 globalIndex = gNetworkPlayers[m->playerIndex].globalIndex; if (globalIndex == UNKNOWN_GLOBAL_INDEX) { globalIndex = 0; } sIntroWarpPipeObj[globalIndex]->oPosY = camera_approach_f32_symmetric(sIntroWarpPipeObj[globalIndex]->oPosY, 260.0f, 10.0f); @@ -1844,6 +1844,24 @@ static void intro_cutscene_raise_pipe(struct MarioState *m) { advance_cutscene_step(m); } } + +static void intro_cutscene_raise_pipe_main_menu(struct MarioState* m) { + u8 globalIndex = gNetworkPlayers[m->playerIndex].globalIndex; + if (globalIndex == UNKNOWN_GLOBAL_INDEX) { globalIndex = 0; } + if (sIntroWarpPipeObj[globalIndex] == NULL) { + sIntroWarpPipeObj[globalIndex] = + spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_CASTLE_GROUNDS_WARP_PIPE, + bhvStaticObject, m->pos[0], 260, m->pos[2], 0, 180, 0); + } + + if (m->actionTimer++ > 1) { + m->vel[1] = 60.0f; + m->faceAngle[1] = m->area->camera->yaw; + advance_cutscene_step(m); + m->actionArg = 3; + m->actionTimer = 110; + } +} #undef TIMER_RAISE_PIPE static void intro_cutscene_jump_out_of_pipe(struct MarioState *m) { @@ -1931,7 +1949,8 @@ enum { INTRO_CUTSCENE_JUMP_OUT_OF_PIPE, INTRO_CUTSCENE_LAND_OUTSIDE_PIPE, INTRO_CUTSCENE_LOWER_PIPE, - INTRO_CUTSCENE_SET_MARIO_TO_IDLE + INTRO_CUTSCENE_SET_MARIO_TO_IDLE, + INTRO_CUTSCENE_RAISE_PIPE_MAIN_MENU }; static s32 act_intro_cutscene(struct MarioState *m) { @@ -1957,6 +1976,9 @@ static s32 act_intro_cutscene(struct MarioState *m) { case INTRO_CUTSCENE_SET_MARIO_TO_IDLE: intro_cutscene_set_mario_to_idle(m); break; + case INTRO_CUTSCENE_RAISE_PIPE_MAIN_MENU: + intro_cutscene_raise_pipe_main_menu(m); + break; } return FALSE; } diff --git a/src/pc/djui/djui.c b/src/pc/djui/djui.c index d2572fae..0a030c77 100644 --- a/src/pc/djui/djui.c +++ b/src/pc/djui/djui.c @@ -7,6 +7,7 @@ static Gfx* sSavedDisplayListHead = NULL; struct DjuiRoot* gDjuiRoot = NULL; static struct DjuiText* sDjuiPauseOptions = NULL; +bool gDjuiInMainMenu = true; void djui_init(void) { gDjuiRoot = djui_root_create(); diff --git a/src/pc/djui/djui.h b/src/pc/djui/djui.h index d0b161f4..f864946f 100644 --- a/src/pc/djui/djui.h +++ b/src/pc/djui/djui.h @@ -51,6 +51,7 @@ #include "djui_panel_cheats.h" extern struct DjuiRoot* gDjuiRoot; +extern bool gDjuiInMainMenu; void djui_init(void); void djui_connect_menu_open(void); diff --git a/src/pc/djui/djui_panel.c b/src/pc/djui/djui_panel.c index 108fa4bf..2e089b4f 100644 --- a/src/pc/djui/djui_panel.c +++ b/src/pc/djui/djui_panel.c @@ -145,6 +145,7 @@ void djui_panel_shutdown(void) { sPanelList = NULL; sPanelRemoving = NULL; sMoveAmount = 0; + gDjuiInMainMenu = false; gInteractableOverridePad = false; gDjuiPanelJoinMessageVisible = false; gDjuiPanelMainCreated = false;