1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-12 10:54:44 +00:00

Merge commit '05c87518e7' into doc_pause_menu

This commit is contained in:
Dragorn421 2024-08-01 21:28:06 +02:00
commit 43931defff
No known key found for this signature in database
GPG key ID: 381AEBAF3D429335
4 changed files with 114 additions and 53 deletions

View file

@ -1,17 +1,25 @@
#include "global.h"
/*
* The following three arrays are effectively unused.
* They are partly equivalent to the `sKaleidoSetupRightPage*` arrays below,
* but make each page correspond to the opposite page instead of the page to the right.
*/
s16 sKaleidoSetupUnusedPageIndex[] = {
PAUSE_QUEST, // PAUSE_ITEM
PAUSE_EQUIP, // PAUSE_MAP
PAUSE_ITEM, // PAUSE_QUEST
PAUSE_MAP, // PAUSE_EQUIP
};
f32 sKaleidoSetupUnusedEyeX[] = {
PAUSE_EYE_DIST * -PAUSE_QUEST_X, // PAUSE_ITEM
PAUSE_EYE_DIST * -PAUSE_EQUIP_X, // PAUSE_MAP
PAUSE_EYE_DIST * -PAUSE_ITEM_X, // PAUSE_QUEST
PAUSE_EYE_DIST * -PAUSE_MAP_X, // PAUSE_EQUIP
};
f32 sKaleidoSetupUnusedEyeZ[] = {
PAUSE_EYE_DIST * -PAUSE_QUEST_Z, // PAUSE_ITEM
PAUSE_EYE_DIST * -PAUSE_EQUIP_Z, // PAUSE_MAP
@ -19,18 +27,26 @@ f32 sKaleidoSetupUnusedEyeZ[] = {
PAUSE_EYE_DIST * -PAUSE_MAP_Z, // PAUSE_EQUIP
};
/*
* The following three arrays are used when opening the pause menu to set up a page switch such that scrolling left
* brings to the initial page.
* For example to open the menu on page PAUSE_ITEM, the menu would open on PAUSE_MAP and scroll left to PAUSE_ITEM.
*/
s16 sKaleidoSetupRightPageIndex[] = {
PAUSE_MAP, // PAUSE_ITEM
PAUSE_QUEST, // PAUSE_MAP
PAUSE_EQUIP, // PAUSE_QUEST
PAUSE_ITEM, // PAUSE_EQUIP
};
f32 sKaleidoSetupRightPageEyeX[] = {
PAUSE_EYE_DIST * -PAUSE_MAP_X, // PAUSE_ITEM
PAUSE_EYE_DIST * -PAUSE_QUEST_X, // PAUSE_MAP
PAUSE_EYE_DIST * -PAUSE_EQUIP_X, // PAUSE_QUEST
PAUSE_EYE_DIST * -PAUSE_ITEM_X, // PAUSE_EQUIP
};
f32 sKaleidoSetupRightPageEyeZ[] = {
PAUSE_EYE_DIST * -PAUSE_MAP_Z, // PAUSE_ITEM
PAUSE_EYE_DIST * -PAUSE_QUEST_Z, // PAUSE_MAP
@ -60,15 +76,17 @@ void KaleidoSetup_Update(PlayState* play) {
R_PAUSE_CURSOR_LEFT_X = -175;
R_PAUSE_CURSOR_RIGHT_X = 155;
pauseCtx->switchPageTimer = 0;
pauseCtx->pageSwitchTimer = 0;
// irrelevant, the initial page switch animation is handled by KaleidoScope_UpdateOpening
// and mainState is reset to idle before reaching the main state anyway (KaleidoScopeCall_Update)
// Setting mainState here is irrelevant, mainState is only used under PAUSE_STATE_MAIN,
// which isn't involved in the initial pause menu opening page scrolling animation.
// mainState is also overwritten later before being used.
pauseCtx->mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE;
//! @bug using an unrelated reg
//! @bug REG collision
if (R_START_LABEL_DD(0) == 0) {
// Never reached, unused, and the data would be wrong anyway
// (scrolling left from this would not bring to the initial page)
pauseCtx->eye.x = sKaleidoSetupUnusedEyeX[pauseCtx->pageIndex];
pauseCtx->eye.z = sKaleidoSetupUnusedEyeZ[pauseCtx->pageIndex];
pauseCtx->pageIndex = sKaleidoSetupUnusedPageIndex[pauseCtx->pageIndex];
@ -117,7 +135,7 @@ void KaleidoSetup_Init(PlayState* play) {
pauseCtx->alpha = 0;
// mainState = PAUSE_MAIN_STATE_IDLE , pageIndex = PAUSE_ITEM
pauseCtx->switchPageTimer = pauseCtx->mainState = pauseCtx->nextPageMode = pauseCtx->pageIndex = 0;
pauseCtx->pageSwitchTimer = pauseCtx->mainState = pauseCtx->nextPageMode = pauseCtx->pageIndex = 0;
pauseCtx->rollRotSavePrompt_ = -314.0f;