diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2024-04-01 00:05:02 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-31 20:05:02 -0700 |
| commit | 997c45c2d2a2eebc71417d2d858b23038a3f666e (patch) | |
| tree | c371934677b1b4cd5ba711d3ba17ee22fb02b302 /src/code/z_kaleido_setup.c | |
| parent | 5bef89a6ff33c3e84ad58d201bd1996a0d9f7db4 (diff) | |
Introduce `z64pause_menu.h` header (#1505)
* z64pause_menu.h
* move functions and variables
* Move PauseMenuPage
* move stuff that seems public to the new header
* KALEIDO_OVL_MAX
* bss
* review
* IS_PAUSED
* format
* add argument to pause macros
* Update include/z64pause_menu.h
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
* bss
* More IS_PAUSED I missed
* early returns
* bss
* empty commit to trigger GHA
* bss
* bss
* bss
* includes
* bss
---------
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Diffstat (limited to 'src/code/z_kaleido_setup.c')
| -rw-r--r-- | src/code/z_kaleido_setup.c | 85 |
1 files changed, 51 insertions, 34 deletions
diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index 3b1ff5cfc..d19f96059 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -1,7 +1,9 @@ -#include "global.h" +#include "z64pause_menu.h" + +#include "z64.h" #include "z64rumble.h" #include "z64shrink_window.h" -#include "z64view.h" + #include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" s16 sKaleidoSetupRightPageIndex[] = { @@ -10,12 +12,14 @@ s16 sKaleidoSetupRightPageIndex[] = { PAUSE_MASK, // PAUSE_QUEST PAUSE_ITEM, // PAUSE_MASK }; + f32 sKaleidoSetupRightPageEyeX[] = { PAUSE_EYE_DIST * -PAUSE_MAP_X, // PAUSE_ITEM PAUSE_EYE_DIST * -PAUSE_QUEST_X, // PAUSE_MAP PAUSE_EYE_DIST * -PAUSE_MASK_X, // PAUSE_QUEST PAUSE_EYE_DIST * -PAUSE_ITEM_X, // PAUSE_MASK }; + f32 sKaleidoSetupRightPageEyeZ[] = { PAUSE_EYE_DIST * -PAUSE_MAP_Z, // PAUSE_ITEM PAUSE_EYE_DIST * -PAUSE_QUEST_Z, // PAUSE_MAP @@ -89,39 +93,52 @@ void KaleidoSetup_Update(PlayState* play) { if (msgCtx && msgCtx) {} } - if ((pauseCtx->state == PAUSE_STATE_OFF) && (pauseCtx->debugEditor == DEBUG_EDITOR_NONE) && - (play->gameOverCtx.state == GAMEOVER_INACTIVE)) { - if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) { - if ((gSaveContext.save.cutsceneIndex < 0xFFF0) && (gSaveContext.nextCutsceneIndex < 0xFFF0)) { - if (!Play_InCsMode(play) || ((msgCtx->msgMode != MSGMODE_NONE) && (msgCtx->currentTextId == 0xFF))) { - if ((play->unk_1887C < 2) && (gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) && - (gSaveContext.magicState != MAGIC_STATE_FILL)) { - if (!CHECK_EVENTINF(EVENTINF_17) && !(player->stateFlags1 & PLAYER_STATE1_20)) { - if (!(play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) && - !(play->actorCtx.flags & ACTORCTX_FLAG_PICTO_BOX_ON)) { - if (!play->actorCtx.isOverrideInputOn && - CHECK_BTN_ALL(input->press.button, BTN_START)) { - gSaveContext.prevHudVisibility = gSaveContext.hudVisibility; - pauseCtx->itemDescriptionOn = false; - pauseCtx->state = PAUSE_STATE_OPENING_0; - func_800F4A10(play); - // Set next page mode to scroll left - pauseCtx->nextPageMode = pauseCtx->pageIndex * 2 + 1; - Audio_SetPauseState(true); - } - - if (pauseCtx->state == PAUSE_STATE_OPENING_0) { - GameState_SetFramerateDivisor(&play->state, 2); - if (ShrinkWindow_Letterbox_GetSizeTarget() != 0) { - ShrinkWindow_Letterbox_SetSizeTarget(0); - } - Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_OPEN); - } - } - } - } - } + if (IS_PAUSED(pauseCtx) || (play->gameOverCtx.state != GAMEOVER_INACTIVE)) { + return; + } + + if ((play->transitionTrigger != TRANS_TRIGGER_OFF) || (play->transitionMode != TRANS_MODE_OFF)) { + return; + } + + if ((gSaveContext.save.cutsceneIndex >= 0xFFF0) || (gSaveContext.nextCutsceneIndex >= 0xFFF0)) { + return; + } + + if (!Play_InCsMode(play) || ((msgCtx->msgMode != MSGMODE_NONE) && (msgCtx->currentTextId == 0xFF))) { + if (play->unk_1887C >= 2) { + return; + } + + if ((gSaveContext.magicState == MAGIC_STATE_STEP_CAPACITY) || (gSaveContext.magicState == MAGIC_STATE_FILL)) { + return; + } + + if (CHECK_EVENTINF(EVENTINF_17) || (player->stateFlags1 & PLAYER_STATE1_20)) { + return; + } + + if ((play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) || + (play->actorCtx.flags & ACTORCTX_FLAG_PICTO_BOX_ON)) { + return; + } + + if (!play->actorCtx.isOverrideInputOn && CHECK_BTN_ALL(input->press.button, BTN_START)) { + gSaveContext.prevHudVisibility = gSaveContext.hudVisibility; + pauseCtx->itemDescriptionOn = false; + pauseCtx->state = PAUSE_STATE_OPENING_0; + func_800F4A10(play); + // Set next page mode to scroll left + pauseCtx->nextPageMode = pauseCtx->pageIndex * 2 + 1; + Audio_SetPauseState(true); + } + + if (pauseCtx->state == PAUSE_STATE_OPENING_0) { + GameState_SetFramerateDivisor(&play->state, 2); + if (ShrinkWindow_Letterbox_GetSizeTarget() != 0) { + ShrinkWindow_Letterbox_SetSizeTarget(0); } + Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_OPEN); } } } |
