Skip to content

Commit

Permalink
Tweak persistent bunny hood to only hide in first person for deku (#924)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjoecox authored Jan 6, 2025
1 parent 4fe49f8 commit 411ed9a
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions mm/2s2h/Enhancements/Masks/PersistentMasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,21 @@ void UpdatePersistentMasksState() {
// This hook draws the mask on the players head when it's active and they aren't in first person
onPlayerPostLimbDrawHook = GameInteractor::Instance->RegisterGameHookForID<GameInteractor::OnPlayerPostLimbDraw>(
PLAYER_LIMB_HEAD, [](Player* player, s32 limbIndex) {
// Ensure they aren't in first person
if (STATE_CVAR && !(player->stateFlags1 & PLAYER_STATE1_100000)) {
OPEN_DISPS(gPlayState->state.gfxCtx);
Matrix_Push();
Player_DrawBunnyHood(gPlayState);
gSPDisplayList(POLY_OPA_DISP++,
(Gfx*)D_801C0B20[PLAYER_MASK_BUNNY - 1]); // D_801C0B20 is an array of mask DLs
Matrix_Pop();
CLOSE_DISPS(gPlayState->state.gfxCtx);
if (!STATE_CVAR) {
return;
}

if (player->transformation == PLAYER_FORM_DEKU && player->stateFlags1 & PLAYER_STATE1_100000) {
return;
}

OPEN_DISPS(gPlayState->state.gfxCtx);
Matrix_Push();
Player_DrawBunnyHood(gPlayState);
gSPDisplayList(POLY_OPA_DISP++,
(Gfx*)D_801C0B20[PLAYER_MASK_BUNNY - 1]); // D_801C0B20 is an array of mask DLs
Matrix_Pop();
CLOSE_DISPS(gPlayState->state.gfxCtx);
});

// This hook sets up the quad and draws the "active" blue border around the mask in the pause menu
Expand Down

0 comments on commit 411ed9a

Please sign in to comment.