z_parameter.c: remaining functions, do action documentation, gfx cleanup (#1652)

* Parameter last functions

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* Documentation for do actions and various gfx

* Suggested changes

* f prefix for texture scale numbers

* Player_SetBButtonAmmo

---------

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
Tharo
2024-07-02 22:47:37 +01:00
committed by GitHub
parent eccbbd47dc
commit 6629597f82
27 changed files with 644 additions and 442 deletions
+4 -4
View File
@@ -478,10 +478,10 @@ s32 Inventory_GetBtnBItem(PlayState* play) {
} else if (gSaveContext.bButtonStatus == BTN_DISABLED) {
return ITEM_NONE;
} else if (CUR_FORM_EQUIP(EQUIP_SLOT_B) == ITEM_NONE) {
if (play->interfaceCtx.unk_21C != 0) {
if (play->interfaceCtx.bButtonDoAction != 0) {
return play->interfaceCtx.bButtonDoAction;
}
//! @bug "Weird B": If the B button is empty and there's a B do action text displaying, pressing B will use the
//! item with the same id as the current do action. It's unclear what this code was originally intended for.
if (play->interfaceCtx.bButtonPlayerDoActionActive && play->interfaceCtx.bButtonPlayerDoAction != 0) {
return play->interfaceCtx.bButtonPlayerDoAction;
}
return ITEM_NONE;
} else {
+1 -1
View File
@@ -106,7 +106,7 @@ void KaleidoSetup_Update(PlayState* play) {
}
if (!Play_InCsMode(play) || ((msgCtx->msgMode != MSGMODE_NONE) && (msgCtx->currentTextId == 0xFF))) {
if (play->unk_1887C >= 2) {
if (play->bButtonAmmoPlusOne >= 2) {
return;
}
+12 -12
View File
@@ -1266,7 +1266,7 @@ void Message_DrawTextDefault(PlayState* play, Gfx** gfxP) {
msgCtx->stateTimer = msgCtx->decodedBuffer.wchar[++i];
Font_LoadMessageBoxEndIcon(&play->msgCtx.font, 1);
if (play->csCtx.state == CS_STATE_IDLE) {
func_8011552C(play, DO_ACTION_RETURN);
Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
}
*gfxP = gfx;
@@ -1279,7 +1279,7 @@ void Message_DrawTextDefault(PlayState* play, Gfx** gfxP) {
msgCtx->stateTimer = msgCtx->decodedBuffer.wchar[++i];
Font_LoadMessageBoxEndIcon(&play->msgCtx.font, 1);
if (play->csCtx.state == CS_STATE_IDLE) {
func_8011552C(play, DO_ACTION_RETURN);
Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
}
*gfxP = gfx;
@@ -1437,7 +1437,7 @@ void Message_DrawTextDefault(PlayState* play, Gfx** gfxP) {
Font_LoadMessageBoxEndIcon(font, 0);
}
if (play->csCtx.state == CS_STATE_IDLE) {
func_8011552C(play, DO_ACTION_RETURN);
Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
} else {
Audio_PlaySfx(NA_SE_NONE);
@@ -3112,7 +3112,7 @@ void Message_OpenText(PlayState* play, u16 textId) {
}
if (textId == 0xFF) {
func_80115844(play, DO_ACTION_STOP);
Interface_SetBButtonInterfaceDoAction(play, DO_ACTION_STOP);
play->msgCtx.hudVisibility = gSaveContext.hudVisibility;
Interface_SetHudVisibility(HUD_VISIBILITY_A_B_C);
gSaveContext.save.unk_06 = 20;
@@ -3341,11 +3341,11 @@ void Message_ContinueTextbox(PlayState* play, u16 textId) {
msgCtx->stateTimer = 8;
msgCtx->textDelayTimer = 0;
if (interfaceCtx->unk_222 == 0) {
if (!interfaceCtx->bButtonInterfaceDoActionActive) {
if (textId != 0x1B93) {
func_8011552C(play, DO_ACTION_NEXT);
Interface_SetAButtonDoAction(play, DO_ACTION_NEXT);
} else if (textId != 0xF8) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
}
}
msgCtx->textboxColorAlphaCurrent = msgCtx->textboxColorAlphaTarget;
@@ -3572,7 +3572,7 @@ void Message_DisplayOcarinaStaffImpl(PlayState* play, u16 ocarinaAction) {
msgCtx->textboxColorAlphaCurrent = msgCtx->textboxColorAlphaTarget;
if (!noStop) {
func_80115844(play, DO_ACTION_STOP);
Interface_SetBButtonInterfaceDoAction(play, DO_ACTION_STOP);
noStop = gSaveContext.hudVisibility;
Interface_SetHudVisibility(HUD_VISIBILITY_B_ALT);
gSaveContext.hudVisibility = noStop;
@@ -5410,9 +5410,9 @@ void Message_Update(PlayState* play) {
msgCtx->msgMode = MSGMODE_TEXT_NEXT_MSG;
if (!pauseCtx->itemDescriptionOn) {
if (msgCtx->currentTextId == 0xFF) {
func_8011552C(play, DO_ACTION_STOP);
Interface_SetAButtonDoAction(play, DO_ACTION_STOP);
} else if (msgCtx->currentTextId != 0xF8) {
func_8011552C(play, DO_ACTION_NEXT);
Interface_SetAButtonDoAction(play, DO_ACTION_NEXT);
}
}
break;
@@ -5706,7 +5706,7 @@ void Message_Update(PlayState* play) {
Message_CloseTextbox(play);
play->msgCtx.ocarinaMode = OCARINA_MODE_END;
gSaveContext.prevHudVisibility = HUD_VISIBILITY_A_B;
func_80115844(play, DO_ACTION_STOP);
Interface_SetBButtonInterfaceDoAction(play, DO_ACTION_STOP);
GameState_SetFramerateDivisor(&play->state, 2);
if (ShrinkWindow_Letterbox_GetSizeTarget() != 0) {
ShrinkWindow_Letterbox_SetSizeTarget(0);
@@ -5767,7 +5767,7 @@ void Message_Update(PlayState* play) {
XREG(31) = 0;
if (pauseCtx->itemDescriptionOn) {
func_8011552C(play, DO_ACTION_INFO);
Interface_SetAButtonDoAction(play, DO_ACTION_INFO);
pauseCtx->itemDescriptionOn = false;
}
+3 -3
View File
@@ -632,7 +632,7 @@ void Message_DrawTextNES(PlayState* play, Gfx** gfxP, u16 textDrawPos) {
msgCtx->stateTimer = stateTimerHi;
Font_LoadMessageBoxEndIcon(font, 1);
if (play->csCtx.state == CS_STATE_IDLE) {
func_8011552C(play, DO_ACTION_RETURN);
Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
}
*gfxP = gfx;
@@ -647,7 +647,7 @@ void Message_DrawTextNES(PlayState* play, Gfx** gfxP, u16 textDrawPos) {
msgCtx->stateTimer = stateTimerHi;
Font_LoadMessageBoxEndIcon(font, 1);
if (play->csCtx.state == CS_STATE_IDLE) {
func_8011552C(play, DO_ACTION_RETURN);
Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
}
*gfxP = gfx;
@@ -827,7 +827,7 @@ void Message_DrawTextNES(PlayState* play, Gfx** gfxP, u16 textDrawPos) {
Font_LoadMessageBoxEndIcon(font, 0);
}
if (play->csCtx.state == CS_STATE_IDLE) {
func_8011552C(play, DO_ACTION_RETURN);
Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
} else {
Audio_PlaySfx(NA_SE_NONE);
+2 -2
View File
@@ -259,7 +259,7 @@ void Message_DrawTextCredits(PlayState* play, Gfx** gfxP) {
Audio_PlaySfx(NA_SE_SY_MESSAGE_END);
Font_LoadMessageBoxEndIcon(font, 1);
if (play->csCtx.state == CS_STATE_IDLE) {
func_8011552C(play, DO_ACTION_RETURN);
Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
}
}
@@ -281,7 +281,7 @@ void Message_DrawTextCredits(PlayState* play, Gfx** gfxP) {
msgCtx->stateTimer = msgCtx->decodedBuffer.schar[++i];
Font_LoadMessageBoxEndIcon(font, 1);
if (play->csCtx.state == CS_STATE_IDLE) {
func_8011552C(play, DO_ACTION_RETURN);
Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
}
*gfxP = gfx;
+382 -231
View File
File diff suppressed because it is too large Load Diff
+12 -9
View File
@@ -581,15 +581,18 @@ ItemId Player_GetItemOnButton(PlayState* play, Player* player, EquipSlot slot) {
return item;
}
if ((player->currentMask == PLAYER_MASK_BLAST) && (play->interfaceCtx.bButtonDoAction == DO_ACTION_EXPLODE)) {
if ((player->currentMask == PLAYER_MASK_BLAST) &&
(play->interfaceCtx.bButtonPlayerDoAction == DO_ACTION_EXPLODE)) {
return ITEM_F0;
}
if ((player->currentMask == PLAYER_MASK_BREMEN) && (play->interfaceCtx.bButtonDoAction == DO_ACTION_MARCH)) {
if ((player->currentMask == PLAYER_MASK_BREMEN) &&
(play->interfaceCtx.bButtonPlayerDoAction == DO_ACTION_MARCH)) {
return ITEM_F1;
}
if ((player->currentMask == PLAYER_MASK_KAMARO) && (play->interfaceCtx.bButtonDoAction == DO_ACTION_DANCE)) {
if ((player->currentMask == PLAYER_MASK_KAMARO) &&
(play->interfaceCtx.bButtonPlayerDoAction == DO_ACTION_DANCE)) {
return ITEM_F2;
}
@@ -623,8 +626,8 @@ PlayerItemAction func_80123810(PlayState* play) {
if (gSaveContext.save.unk_06 == 0) {
if (CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button, BTN_A | BTN_B)) {
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.unk_224 = 0;
play->interfaceCtx.bButtonInterfaceDoActionActive = false;
play->interfaceCtx.bButtonInterfaceDoAction = 0;
Interface_SetHudVisibility(play->msgCtx.hudVisibility);
return PLAYER_IA_MINUS1;
}
@@ -637,8 +640,8 @@ PlayerItemAction func_80123810(PlayState* play) {
i++;
itemId = Player_GetItemOnButton(play, player, i);
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.unk_224 = 0;
play->interfaceCtx.bButtonInterfaceDoActionActive = false;
play->interfaceCtx.bButtonInterfaceDoAction = 0;
Interface_SetHudVisibility(play->msgCtx.hudVisibility);
if ((itemId >= ITEM_FD) || ((itemAction = play->unk_18794(play, player, itemId)) <= PLAYER_IA_MINUS1)) {
@@ -1360,8 +1363,8 @@ bool func_80123F14(PlayState* play) {
return player->stateFlags1 & PLAYER_STATE1_800000;
}
s32 func_80123F2C(PlayState* play, s32 ammo) {
play->unk_1887C = ammo + 1;
s32 Player_SetBButtonAmmo(PlayState* play, s32 ammo) {
play->bButtonAmmoPlusOne = ammo + 1;
return 1;
}
@@ -133,7 +133,7 @@ s32 func_80953DA8(BgIngate* this, PlayState* play) {
SET_EVENTINF(EVENTINF_41);
}
Camera_ChangeSetting(mainCam, CAM_SET_BOAT_CRUISE);
play->unk_1887C = 0x63;
play->bButtonAmmoPlusOne = 99;
return false;
}
@@ -145,7 +145,7 @@ void func_80953E38(PlayState* play) {
CLEAR_EVENTINF(EVENTINF_41);
}
play->unk_1887C = -1;
play->bButtonAmmoPlusOne = -1;
}
void func_80953EA4(BgIngate* this, PlayState* play) {
@@ -4796,7 +4796,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
Message_CloseTextbox(play);
play->interfaceCtx.unk_27E = 1;
play->interfaceCtx.fishingHUDControl = 1;
play->startPlayerFishing(play);
D_809171FC = 1;
D_8090CD04 = 20;
@@ -5022,7 +5022,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, PlayState* play) {
D_8090CD0C = false;
}
D_809171FC = 0;
play->interfaceCtx.unk_27E = 0;
play->interfaceCtx.fishingHUDControl = 0;
}
break;
+9 -9
View File
@@ -417,8 +417,8 @@ void EnFsn_EndInteraction(EnFsn* this, PlayState* play) {
this->drawCursor = 0;
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.unk_224 = 0;
play->interfaceCtx.bButtonInterfaceDoActionActive = false;
play->interfaceCtx.bButtonInterfaceDoAction = 0;
this->actor.textId = 0;
this->actionFunc = EnFsn_Idle;
}
@@ -826,7 +826,7 @@ void EnFsn_BeginInteraction(EnFsn* this, PlayState* play) {
CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor);
this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING;
if (Player_GetMask(play) == PLAYER_MASK_NONE) {
func_8011552C(play, DO_ACTION_NEXT);
Interface_SetAButtonDoAction(play, DO_ACTION_NEXT);
if (EnFsn_HasItemsToSell()) {
this->actionFunc = EnFsn_AskBuyOrSell;
} else {
@@ -917,7 +917,7 @@ void EnFsn_AskBuyOrSell(EnFsn* this, PlayState* play) {
}
}
} else if (talkState == TEXT_STATE_CHOICE) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnFsn_TestEndInteraction(this, play, CONTROLLER1(&play->state)) && Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0:
@@ -1101,7 +1101,7 @@ void EnFsn_ResumeShoppingInteraction(EnFsn* this, PlayState* play) {
} else if (this->actor.textId != 0x29D6) {
this->actionFunc = EnFsn_AskCanBuyAterRunningOutOfItems;
} else {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = true;
this->actionFunc = EnFsn_FaceShopkeeperSelling;
@@ -1152,7 +1152,7 @@ void EnFsn_BrowseShelf(EnFsn* this, PlayState* play) {
this->stickLeftPrompt.isEnabled = true;
EnFsn_UpdateCursorPos(this, play);
if (talkstate == TEXT_STATE_EVENT) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnFsn_HasPlayerSelectedItem(this, play, CONTROLLER1(&play->state))) {
EnFsn_CursorLeftRight(this);
if (this->cursorIndex != prevCursorIdx) {
@@ -1260,7 +1260,7 @@ void EnFsn_SelectItem(EnFsn* this, PlayState* play) {
u8 talkState = Message_GetState(&play->msgCtx);
if (EnFsn_TakeItemOffShelf(this) && (talkState == TEXT_STATE_CHOICE)) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnFsn_TestCancelOption(this, play, CONTROLLER1(&play->state)) && Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0:
@@ -1393,7 +1393,7 @@ void EnFsn_FaceShopkeeperSelling(EnFsn* this, PlayState* play) {
u8 cursorIndex;
if (talkState == TEXT_STATE_CHOICE) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnFsn_TestEndInteraction(this, play, CONTROLLER1(&play->state)) &&
(!Message_ShouldAdvance(play) || !EnFsn_FacingShopkeeperDialogResult(this, play)) &&
this->stickAccumX > 0) {
@@ -1401,7 +1401,7 @@ void EnFsn_FaceShopkeeperSelling(EnFsn* this, PlayState* play) {
if (cursorIndex != CURSOR_INVALID) {
this->cursorIndex = cursorIndex;
this->actionFunc = EnFsn_LookToShelf;
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickRightPrompt.isEnabled = false;
Audio_PlaySfx(NA_SE_SY_CURSOR);
}
@@ -4018,7 +4018,7 @@ void func_80886C00(EnHorse* this, PlayState* play) {
if (((this->action == ENHORSE_ACTION_MOUNTED_WALK) || (this->action == ENHORSE_ACTION_MOUNTED_TROT) ||
(this->action == ENHORSE_ACTION_MOUNTED_GALLOP)) &&
(CHECK_BTN_ALL(input->press.button, BTN_A) || (AudioVoice_GetWord() == VOICE_WORD_ID_HIYA)) &&
(play->interfaceCtx.unk_212 == DO_ACTION_FASTER) && !(this->stateFlags & ENHORSE_BOOST) &&
(play->interfaceCtx.aButtonDoActionDelayed == DO_ACTION_FASTER) && !(this->stateFlags & ENHORSE_BOOST) &&
!(this->stateFlags & ENHORSE_FLAG_8) && !(this->stateFlags & ENHORSE_FLAG_9)) {
if (this->numBoosts > 0) {
Rumble_Request(0.0f, 180, 20, 100);
@@ -328,7 +328,7 @@ void EnOkuta_WaitToAppear(EnOkuta* this, PlayState* play) {
if (EN_OKUTA_GET_TYPE(&this->actor) == EN_OKUTA_TYPE_RED_OCTOROK) {
EnOkuta_SetupAppear(this, play);
} else if (ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.world.rot.y)) < 0x4000 &&
play->unk_1887C == 0) {
play->bButtonAmmoPlusOne == 0) {
EnOkuta_SetupAppear(this, play);
}
}
+12 -12
View File
@@ -310,8 +310,8 @@ void EnOssan_EndInteraction(PlayState* play, EnOssan* this) {
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
player->stateFlags2 &= ~PLAYER_STATE2_20000000;
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.unk_224 = 0;
play->interfaceCtx.bButtonInterfaceDoActionActive = false;
play->interfaceCtx.bButtonInterfaceDoAction = 0;
if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_PLAYING) {
CutsceneManager_Stop(this->csId);
this->cutsceneState = ENOSSAN_CUTSCENESTATE_STOPPED;
@@ -342,7 +342,7 @@ s32 EnOssan_TestCancelOption(EnOssan* this, PlayState* play, Input* input) {
}
void EnOssan_SetupStartShopping(PlayState* play, EnOssan* this, u8 skipHello) {
func_8011552C(play, DO_ACTION_NEXT);
Interface_SetAButtonDoAction(play, DO_ACTION_NEXT);
if (!skipHello) {
EnOssan_SetupAction(this, EnOssan_Hello);
} else {
@@ -353,7 +353,7 @@ void EnOssan_SetupStartShopping(PlayState* play, EnOssan* this, u8 skipHello) {
void EnOssan_StartShopping(PlayState* play, EnOssan* this) {
EnOssan_SetupAction(this, EnOssan_FaceShopkeeper);
Message_ContinueTextbox(play, 0x640);
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickRightPrompt.isEnabled = true;
this->stickLeftPrompt.isEnabled = true;
}
@@ -611,7 +611,7 @@ s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, PlayState* play) {
}
EnOssan_SetupAction(this, EnOssan_TalkToShopkeeper);
Message_ContinueTextbox(play, sTalkOptionTextIds[this->actor.params]);
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
return true;
@@ -641,7 +641,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) {
this->cutsceneState = ENOSSAN_CUTSCENESTATE_WAITING;
} else {
if (talkState == TEXT_STATE_CHOICE) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (EnOssan_TestEndInteraction(this, play, CONTROLLER1(&play->state))) {
return;
}
@@ -655,7 +655,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) {
if (cursorIndex != CURSOR_INVALID) {
this->cursorIndex = cursorIndex;
EnOssan_SetupAction(this, EnOssan_LookToLeftShelf);
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickLeftPrompt.isEnabled = false;
Audio_PlaySfx(NA_SE_SY_CURSOR);
}
@@ -664,7 +664,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) {
if (cursorIndex != CURSOR_INVALID) {
this->cursorIndex = cursorIndex;
EnOssan_SetupAction(this, EnOssan_LookToRightShelf);
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickRightPrompt.isEnabled = false;
Audio_PlaySfx(NA_SE_SY_CURSOR);
}
@@ -867,7 +867,7 @@ void EnOssan_BrowseLeftShelf(EnOssan* this, PlayState* play) {
this->stickRightPrompt.isEnabled = true;
EnOssan_UpdateCursorPos(play, this);
if (talkState == TEXT_STATE_EVENT) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnOssan_HasPlayerSelectedItem(play, this, CONTROLLER1(&play->state))) {
if (this->moveHorizontal) {
if (this->stickAccumX > 0) {
@@ -925,7 +925,7 @@ void EnOssan_BrowseRightShelf(EnOssan* this, PlayState* play) {
this->stickLeftPrompt.isEnabled = true;
EnOssan_UpdateCursorPos(play, this);
if (talkState == TEXT_STATE_EVENT) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnOssan_HasPlayerSelectedItem(play, this, CONTROLLER1(&play->state))) {
if (this->moveHorizontal != 0) {
if (this->stickAccumX < 0) {
@@ -1075,7 +1075,7 @@ void EnOssan_SelectItem(EnOssan* this, PlayState* play) {
u8 talkState = Message_GetState(&play->msgCtx);
if (EnOssan_TakeItemOffShelf(this) && (talkState == TEXT_STATE_CHOICE)) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnOssan_TestCancelOption(this, play, CONTROLLER1(&play->state)) && Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0:
@@ -1146,7 +1146,7 @@ void EnOssan_ContinueShopping(EnOssan* this, PlayState* play) {
EnGirlA* item;
if (talkState == TEXT_STATE_CHOICE) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (Message_ShouldAdvance(play)) {
EnOssan_ResetItemPosition(this);
item = this->items[this->cursorIndex];
+9 -9
View File
@@ -477,8 +477,8 @@ void EnSob1_EndInteraction(PlayState* play, EnSob1* this) {
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
player->stateFlags2 &= ~PLAYER_STATE2_20000000;
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.unk_224 = 0;
play->interfaceCtx.bButtonInterfaceDoActionActive = false;
play->interfaceCtx.bButtonInterfaceDoAction = 0;
EnSob1_SetupAction(this, EnSob1_Idle);
}
@@ -504,7 +504,7 @@ s32 EnSob1_TestCancelOption(EnSob1* this, PlayState* play, Input* input) {
}
void EnSob1_SetupStartShopping(PlayState* play, EnSob1* this, u8 skipHello) {
func_8011552C(play, DO_ACTION_NEXT);
Interface_SetAButtonDoAction(play, DO_ACTION_NEXT);
if (!skipHello) {
EnSob1_SetupAction(this, EnSob1_Hello);
} else {
@@ -515,7 +515,7 @@ void EnSob1_SetupStartShopping(PlayState* play, EnSob1* this, u8 skipHello) {
void EnSob1_StartShopping(PlayState* play, EnSob1* this) {
EnSob1_SetupAction(this, EnSob1_FaceShopkeeper);
Message_ContinueTextbox(play, sFacingShopkeeperTextIds[this->shopType]);
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = true;
}
@@ -524,7 +524,7 @@ void EnSob1_TalkToShopkeeper(PlayState* play, EnSob1* this) {
EnSob1_SetupAction(this, EnSob1_TalkingToShopkeeper);
this->talkOptionTextId = EnSob1_GetTalkOption(this, play);
Message_ContinueTextbox(play, this->talkOptionTextId);
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
}
@@ -691,7 +691,7 @@ void EnSob1_FaceShopkeeper(EnSob1* this, PlayState* play) {
this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING;
} else {
if (talkState == TEXT_STATE_CHOICE) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnSob1_TestEndInteraction(this, play, CONTROLLER1(&play->state))) {
if (!Message_ShouldAdvance(play) || !EnSob1_FacingShopkeeperDialogResult(this, play)) {
if (this->stickAccumX > 0) {
@@ -699,7 +699,7 @@ void EnSob1_FaceShopkeeper(EnSob1* this, PlayState* play) {
if (cursorIndex != CURSOR_INVALID) {
this->cursorIndex = cursorIndex;
EnSob1_SetupAction(this, EnSob1_LookToShelf);
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickRightPrompt.isEnabled = false;
Audio_PlaySfx(NA_SE_SY_CURSOR);
}
@@ -945,7 +945,7 @@ void EnSob1_BrowseShelf(EnSob1* this, PlayState* play) {
this->stickLeftPrompt.isEnabled = true;
EnSob1_UpdateCursorPos(play, this);
if (talkState == TEXT_STATE_EVENT) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnSob1_HasPlayerSelectedItem(play, this, CONTROLLER1(&play->state))) {
EnSob1_CursorLeftRight(play, this);
cursorIndex = this->cursorIndex;
@@ -1065,7 +1065,7 @@ void EnSob1_SelectItem(EnSob1* this, PlayState* play) {
u8 talkState = Message_GetState(&play->msgCtx);
if (EnSob1_TakeItemOffShelf(this) && (talkState == TEXT_STATE_CHOICE)) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnSob1_TestCancelOption(this, play, CONTROLLER1(&play->state)) && Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0:
@@ -422,7 +422,7 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
player->actor.freezeTimer = 0;
Interface_InitMinigame(play);
play->interfaceCtx.minigameAmmo = 80;
func_80123F2C(play, 80);
Player_SetBButtonAmmo(play, 80);
this->shootingGameState = SG_GAME_STATE_RUNNING;
this->actionFunc = EnSyatekiMan_Swamp_StartGame;
Audio_PlaySubBgm(NA_BGM_TIMED_MINI_GAME);
@@ -784,7 +784,7 @@ void EnSyatekiMan_Town_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
player->actor.freezeTimer = 0;
this->flagsIndex = 0;
Interface_InitMinigame(play);
func_80123F2C(play, 0x63);
Player_SetBButtonAmmo(play, 99);
this->shootingGameState = SG_GAME_STATE_RUNNING;
Audio_PlaySubBgm(NA_BGM_TIMED_MINI_GAME);
this->actionFunc = EnSyatekiMan_Town_StartGame;
@@ -1182,7 +1182,7 @@ void EnSyatekiMan_Swamp_EndGame(EnSyatekiMan* this, PlayState* play) {
}
if (this->talkWaitTimer < 5) {
play->unk_1887C = -10;
play->bButtonAmmoPlusOne = -10;
}
}
@@ -1455,7 +1455,7 @@ void EnSyatekiMan_Town_EndGame(EnSyatekiMan* this, PlayState* play) {
}
if (this->talkWaitTimer < 5) {
play->unk_1887C = -10;
play->bButtonAmmoPlusOne = -10;
}
}
+12 -12
View File
@@ -228,8 +228,8 @@ void EnTrt_EndInteraction(PlayState* play, EnTrt* this) {
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
player->stateFlags2 &= ~PLAYER_STATE2_20000000;
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.unk_224 = 0;
play->interfaceCtx.bButtonInterfaceDoActionActive = false;
play->interfaceCtx.bButtonInterfaceDoAction = 0;
this->textId = 0x834;
this->timer = 80;
this->flags |= ENTRT_FULLY_AWAKE;
@@ -257,7 +257,7 @@ s32 EnTrt_TestCancelOption(EnTrt* this, PlayState* play, Input* input) {
}
void EnTrt_SetupStartShopping(PlayState* play, EnTrt* this, u8 skipHello) {
func_8011552C(play, DO_ACTION_NEXT);
Interface_SetAButtonDoAction(play, DO_ACTION_NEXT);
if (!skipHello) {
this->actionFunc = EnTrt_Hello;
} else {
@@ -267,7 +267,7 @@ void EnTrt_SetupStartShopping(PlayState* play, EnTrt* this, u8 skipHello) {
void EnTrt_StartShopping(PlayState* play, EnTrt* this) {
Message_ContinueTextbox(play, 0x83E);
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = true;
this->actionFunc = EnTrt_FaceShopkeeper;
@@ -546,7 +546,7 @@ void EnTrt_FaceShopkeeper(EnTrt* this, PlayState* play) {
CutsceneManager_Queue(this->csId);
this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING;
} else if (talkState == TEXT_STATE_CHOICE) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnTrt_TestEndInteraction(this, play, CONTROLLER1(&play->state))) {
if ((!Message_ShouldAdvance(play) || !EnTrt_FacingShopkeeperDialogResult(this, play)) &&
(this->stickAccumX > 0)) {
@@ -554,7 +554,7 @@ void EnTrt_FaceShopkeeper(EnTrt* this, PlayState* play) {
if (cursorIndex != CURSOR_INVALID) {
this->cursorIndex = cursorIndex;
this->actionFunc = EnTrt_LookToShelf;
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickRightPrompt.isEnabled = false;
Audio_PlaySfx(NA_SE_SY_CURSOR);
}
@@ -648,7 +648,7 @@ void EnTrt_BrowseShelf(EnTrt* this, PlayState* play) {
this->stickLeftPrompt.isEnabled = true;
EnTrt_UpdateCursorPos(play, this);
if (talkState == TEXT_STATE_EVENT) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnTrt_HasPlayerSelectedItem(play, this, CONTROLLER1(&play->state))) {
EnTrt_CursorLeftRight(play, this);
if (this->cursorIndex != prevCursorIdx) {
@@ -741,7 +741,7 @@ void EnTrt_SelectItem(EnTrt* this, PlayState* play) {
if (EnTrt_TakeItemOffShelf(this)) {
if (talkState == TEXT_STATE_CHOICE) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (!EnTrt_TestCancelOption(this, play, CONTROLLER1(&play->state)) && Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0:
@@ -917,7 +917,7 @@ void EnTrt_BeginInteraction(EnTrt* this, PlayState* play) {
!CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_RED_POTION_FOR_KOUME) &&
!CHECK_WEEKEVENTREG(WEEKEVENTREG_TALKED_KOUME_INJURED) &&
!CHECK_WEEKEVENTREG(WEEKEVENTREG_TALKED_KOUME_KIOSK_EMPTY)) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = true;
this->actionFunc = EnTrt_Hello;
@@ -927,7 +927,7 @@ void EnTrt_BeginInteraction(EnTrt* this, PlayState* play) {
break;
case 0x83E:
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = true;
this->actionFunc = EnTrt_FaceShopkeeper;
@@ -1145,7 +1145,7 @@ void EnTrt_ContinueShopping(EnTrt* this, PlayState* play) {
EnGirlA* item;
if (talkState == TEXT_STATE_CHOICE) {
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
if (Message_ShouldAdvance(play)) {
EnTrt_ResetItemPosition(this);
item = this->items[this->cursorIndex];
@@ -1459,7 +1459,7 @@ void EnTrt_TalkToShopkeeper(EnTrt* this, PlayState* play) {
void EnTrt_SetupTalkToShopkeeper(PlayState* play, EnTrt* this) {
this->actionFunc = EnTrt_TalkToShopkeeper;
Message_ContinueTextbox(play, this->talkOptionTextId);
func_8011552C(play, DO_ACTION_DECIDE);
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
}
+2 -2
View File
@@ -1722,10 +1722,10 @@ void ObjUm_Update(Actor* thisx, PlayState* play) {
}
if (this->flags & OBJ_UM_FLAG_0010) {
func_80123F2C(play, 0x63);
Player_SetBButtonAmmo(play, 99);
this->flags &= ~OBJ_UM_FLAG_0010;
} else if (this->flags & OBJ_UM_FLAG_0004) {
func_80123F2C(play, -3);
Player_SetBButtonAmmo(play, -3);
this->flags &= ~OBJ_UM_FLAG_0004;
}
+43 -42
View File
@@ -3801,7 +3801,7 @@ void Player_UpdateItems(Player* this, PlayState* play) {
if ((this->actor.id == ACTOR_PLAYER) && !(this->stateFlags3 & PLAYER_STATE3_START_CHANGING_HELD_ITEM)) {
if ((this->heldItemAction == this->itemAction) || (this->stateFlags1 & PLAYER_STATE1_400000)) {
if ((gSaveContext.save.saveInfo.playerData.health != 0) && (play->csCtx.state == CS_STATE_IDLE)) {
if ((this->csAction == PLAYER_CSACTION_NONE) && (play->unk_1887C == 0) &&
if ((this->csAction == PLAYER_CSACTION_NONE) && (play->bButtonAmmoPlusOne == 0) &&
(play->activeCamId == CAM_ID_MAIN)) {
if (!func_8082DA90(play) && (gSaveContext.timerStates[TIMER_ID_MINIGAME_2] != TIMER_STATE_STOP)) {
Player_ProcessItemButtons(this, play);
@@ -3840,8 +3840,8 @@ s32 func_808305BC(PlayState* play, Player* this, ItemId* item, ArrowType* typePa
if (gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE) {
return play->interfaceCtx.minigameAmmo;
}
if (play->unk_1887C != 0) {
return play->unk_1887C;
if (play->bButtonAmmoPlusOne != 0) {
return play->bButtonAmmoPlusOne;
}
return AMMO(*item);
@@ -4002,7 +4002,7 @@ s32 func_80830B88(PlayState* play, Player* this) {
if (!(this->stateFlags1 & (PLAYER_STATE1_400000 | PLAYER_STATE1_800000 | PLAYER_STATE1_20000000))) {
if (!(this->stateFlags1 & PLAYER_STATE1_8000000) || ((this->currentBoots >= PLAYER_BOOTS_ZORA_UNDERWATER) &&
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND))) {
if ((play->unk_1887C == 0) && (this->heldItemAction == this->itemAction)) {
if ((play->bButtonAmmoPlusOne == 0) && (this->heldItemAction == this->itemAction)) {
if ((this->transformation == PLAYER_FORM_FIERCE_DEITY) ||
(!Player_IsGoronOrDeku(this) &&
((((this->transformation == PLAYER_FORM_ZORA)) &&
@@ -4094,13 +4094,14 @@ s32 func_80830E30(Player* this, PlayState* play) {
}
bool func_80830F9C(PlayState* play) {
return (play->unk_1887C > 0) && CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_B);
return (play->bButtonAmmoPlusOne > 0) && CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_B);
}
bool func_80830FD4(PlayState* play) {
return (play->unk_1887C != 0) &&
((play->unk_1887C < 0) || CHECK_BTN_ANY(sPlayerControlInput->cur.button,
BTN_CRIGHT | BTN_CLEFT | BTN_CDOWN | BTN_CUP | BTN_B | BTN_A));
return (play->bButtonAmmoPlusOne != 0) &&
((play->bButtonAmmoPlusOne < 0) ||
CHECK_BTN_ANY(sPlayerControlInput->cur.button,
BTN_CRIGHT | BTN_CLEFT | BTN_CDOWN | BTN_CUP | BTN_B | BTN_A));
}
bool func_80831010(Player* this, PlayState* play) {
@@ -4150,15 +4151,15 @@ bool func_80831194(PlayState* play, Player* this) {
(play->sceneId != SCENE_SYATEKI_MORI)) {
play->interfaceCtx.minigameAmmo--;
}
} else if (play->unk_1887C != 0) {
play->unk_1887C--;
} else if (play->bButtonAmmoPlusOne != 0) {
play->bButtonAmmoPlusOne--;
} else {
Inventory_ChangeAmmo(item, -1);
}
}
if (play->unk_1887C == 1) {
play->unk_1887C = -10;
if (play->bButtonAmmoPlusOne == 1) {
play->bButtonAmmoPlusOne = -10;
}
Player_RequestRumble(play, this, 150, 10, 150, SQ(0));
@@ -8019,7 +8020,7 @@ s32 Player_ActionChange_6(Player* this, PlayState* play) {
s32 Player_ActionChange_11(Player* this, PlayState* play) {
if (CHECK_BTN_ALL(sPlayerControlInput->cur.button, BTN_R) && (this->unk_AA5 == PLAYER_UNKAA5_0) &&
(play->unk_1887C == 0)) {
(play->bButtonAmmoPlusOne == 0)) {
if (Player_IsGoronOrDeku(this) ||
((((this->transformation == PLAYER_FORM_ZORA) && !(this->stateFlags1 & PLAYER_STATE1_2000000)) ||
((this->transformation == PLAYER_FORM_HUMAN) && (this->currentShield != PLAYER_SHIELD_NONE))) &&
@@ -10808,7 +10809,7 @@ void Player_Init(Actor* thisx, PlayState* play) {
return;
}
play->unk_1887C = 0;
play->bButtonAmmoPlusOne = 0;
play->unk_1887D = 0;
play->unk_1887E = 0;
this->giObjectSegment = ZeldaArena_Malloc(0x2000);
@@ -10998,10 +10999,10 @@ void Player_SetDoAction(PlayState* play, Player* this) {
}
if (doActionB > -1) {
func_801155B4(play, doActionB);
} else if (play->interfaceCtx.unk_21C != 0) {
play->interfaceCtx.unk_21C = 0;
play->interfaceCtx.bButtonDoAction = 0;
Interface_SetBButtonPlayerDoAction(play, doActionB);
} else if (play->interfaceCtx.bButtonPlayerDoActionActive) {
play->interfaceCtx.bButtonPlayerDoActionActive = false;
play->interfaceCtx.bButtonPlayerDoAction = 0;
}
// Set A do action
@@ -11142,19 +11143,19 @@ void Player_SetDoAction(PlayState* play, Player* this) {
this->putAwayCountdown--;
}
func_8011552C(play, doActionA);
Interface_SetAButtonDoAction(play, doActionA);
// Set Tatl state
if (!Play_InCsMode(play) && (this->stateFlags2 & PLAYER_STATE2_200000) &&
!(this->stateFlags3 & PLAYER_STATE3_100)) {
if (this->lockOnActor != NULL) {
func_80115764(play, 0x2B);
Interface_SetTatlCall(play, TATL_STATE_2B);
} else {
func_80115764(play, 0x2A);
Interface_SetTatlCall(play, TATL_STATE_2A);
}
CutsceneManager_Queue(CS_ID_GLOBAL_TALK);
} else {
func_80115764(play, 0x2C);
Interface_SetTatlCall(play, TATL_STATE_2C);
}
}
}
@@ -12831,7 +12832,7 @@ s32 func_80847190(PlayState* play, Player* this, s32 arg2) {
this->unk_AA6 |= 2;
return func_80832754(this, (play->unk_1887C != 0) || func_800B7128(this) || func_8082EF20(this));
return func_80832754(this, (play->bButtonAmmoPlusOne != 0) || func_800B7128(this) || func_8082EF20(this));
}
void func_8084748C(Player* this, f32* speed, f32 speedTarget, s16 yawTarget) {
@@ -12911,10 +12912,10 @@ void func_808477D0(PlayState* play, Player* this, Input* input, f32 arg3) {
}
s32 func_80847880(PlayState* play, Player* this) {
if (play->unk_1887C != 0) {
if (play->bButtonAmmoPlusOne != 0) {
if (play->sceneId == SCENE_20SICHITAI) {
Player_SetAction(play, this, Player_Action_80, 0);
play->unk_1887C = 0;
play->bButtonAmmoPlusOne = 0;
this->csAction = PLAYER_CSACTION_NONE;
return true;
}
@@ -13311,9 +13312,9 @@ s32 Player_UpperAction_1(Player* this, PlayState* play) {
s32 Player_UpperAction_ChangeHeldItem(Player* this, PlayState* play) {
if (PlayerAnimation_Update(play, &this->skelAnimeUpper) ||
((Player_ItemToItemAction(this, this->heldItemId) == this->heldItemAction) &&
(sPlayerUseHeldItem =
(sPlayerUseHeldItem || ((this->modelAnimType != PLAYER_ANIMTYPE_3) &&
(this->heldItemAction != PLAYER_IA_DEKU_STICK) && (play->unk_1887C == 0)))))) {
(sPlayerUseHeldItem = (sPlayerUseHeldItem || ((this->modelAnimType != PLAYER_ANIMTYPE_3) &&
(this->heldItemAction != PLAYER_IA_DEKU_STICK) &&
(play->bButtonAmmoPlusOne == 0)))))) {
Player_SetUpperAction(play, this, sPlayerUpperActionUpdateFuncs[this->heldItemAction]);
this->unk_ACC = 0;
this->unk_AA4 = 0;
@@ -15286,11 +15287,11 @@ void Player_Action_35(Player* this, PlayState* play) {
func_801226E0(play, ((void)0, gSaveContext.respawn[RESPAWN_MODE_DOWN].data));
}
if (play->unk_1887C != 0) {
if (play->bButtonAmmoPlusOne != 0) {
play->func_18780(this, play);
Player_SetAction(play, this, Player_Action_80, 0);
if (play->sceneId == SCENE_20SICHITAI) {
play->unk_1887C = 0;
play->bButtonAmmoPlusOne = 0;
}
} else if (!Player_ActionChange_4(this, play)) {
func_8083B2E4(this, play);
@@ -16882,7 +16883,7 @@ void Player_Action_63(Player* this, PlayState* play) {
}
} else if (this->av2.actionVar2 != 0) {
if (play->msgCtx.ocarinaMode == OCARINA_MODE_END) {
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.bButtonInterfaceDoActionActive = false;
CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_ITEM_OCARINA]);
this->actor.flags &= ~ACTOR_FLAG_20000000;
@@ -16919,7 +16920,7 @@ void Player_Action_63(Player* this, PlayState* play) {
} else {
Actor* actor;
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.bButtonInterfaceDoActionActive = false;
CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_ITEM_OCARINA]);
this->actor.flags &= ~ACTOR_FLAG_20000000;
@@ -16938,7 +16939,7 @@ void Player_Action_63(Player* this, PlayState* play) {
}
} else if ((play->msgCtx.ocarinaMode == OCARINA_MODE_EVENT) &&
(play->msgCtx.lastPlayedSong == OCARINA_SONG_ELEGY)) {
play->interfaceCtx.unk_222 = 0;
play->interfaceCtx.bButtonInterfaceDoActionActive = false;
CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_ITEM_OCARINA]);
this->actor.flags &= ~ACTOR_FLAG_20000000;
@@ -17645,17 +17646,17 @@ void Player_Action_79(Player* this, PlayState* play) {
}
void Player_Action_80(Player* this, PlayState* play) {
if (play->unk_1887C < 0) {
play->unk_1887C = 0;
if (play->bButtonAmmoPlusOne < 0) {
play->bButtonAmmoPlusOne = 0;
func_80839ED0(this, play);
} else if (this->av1.actionVar1 == 0) {
if ((play->sceneId != SCENE_20SICHITAI) && CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_B)) {
play->unk_1887C = 10;
play->bButtonAmmoPlusOne = 10;
func_80847880(play, this);
Player_SetAction(play, this, Player_Action_80, 1);
this->av1.actionVar1 = 1;
} else {
play->unk_1887C = 0;
play->bButtonAmmoPlusOne = 0;
func_80847190(play, this, 0);
if (play->actorCtx.flags & ACTORCTX_FLAG_PICTO_BOX_ON) {
@@ -17673,12 +17674,12 @@ void Player_Action_80(Player* this, PlayState* play) {
}
} else if (CHECK_BTN_ANY(sPlayerControlInput->press.button,
BTN_CRIGHT | BTN_CLEFT | BTN_CDOWN | BTN_CUP | BTN_R | BTN_A)) {
play->unk_1887C = -1;
play->bButtonAmmoPlusOne = -1;
Player_Action_81(this, play);
Player_SetAction(play, this, Player_Action_80, 0);
this->av1.actionVar1 = 0;
} else {
play->unk_1887C = 10;
play->bButtonAmmoPlusOne = 10;
Player_Action_81(this, play);
}
}
@@ -17691,9 +17692,9 @@ void Player_Action_81(Player* this, PlayState* play) {
this->upperLimbRot.y = func_80847190(play, this, 1) - this->actor.shape.rot.y;
this->unk_AA6 |= 0x80;
if (play->unk_1887C < 0) {
play->unk_1887C++;
if (play->unk_1887C == 0) {
if (play->bButtonAmmoPlusOne < 0) {
play->bButtonAmmoPlusOne++;
if (play->bButtonAmmoPlusOne == 0) {
func_80839ED0(this, play);
}
}
@@ -624,8 +624,8 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) {
if (nextCursorPoint == CURSOR_TO_LEFT) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE;
if (interfaceCtx->unk_212 == DO_ACTION_DECIDE) {
func_8011552C(play, DO_ACTION_INFO);
if (interfaceCtx->aButtonDoActionDelayed == DO_ACTION_DECIDE) {
Interface_SetAButtonDoAction(play, DO_ACTION_INFO);
}
return;
} else {
@@ -808,8 +808,8 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) {
pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG;
if (interfaceCtx->unk_212 != DO_ACTION_DECIDE) {
func_8011552C(play, DO_ACTION_DECIDE);
if (interfaceCtx->aButtonDoActionDelayed != DO_ACTION_DECIDE) {
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
}
// Stop receiving input to play a song as mentioned above
@@ -821,8 +821,8 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) {
Interface_SetHudVisibility(HUD_VISIBILITY_ALL);
}
} else {
if (interfaceCtx->unk_212 != DO_ACTION_DECIDE) {
func_8011552C(play, DO_ACTION_DECIDE);
if (interfaceCtx->aButtonDoActionDelayed != DO_ACTION_DECIDE) {
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
}
if (gSaveContext.buttonStatus[EQUIP_SLOT_A] != BTN_DISABLED) {
gSaveContext.buttonStatus[EQUIP_SLOT_A] = BTN_DISABLED;
@@ -832,12 +832,12 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) {
}
} else {
if ((cursor == QUEST_BOMBERS_NOTEBOOK) && (pauseCtx->cursorItem[PAUSE_QUEST] != PAUSE_ITEM_NONE)) {
if (interfaceCtx->unk_212 != DO_ACTION_DECIDE) {
func_8011552C(play, DO_ACTION_DECIDE);
if (interfaceCtx->aButtonDoActionDelayed != DO_ACTION_DECIDE) {
Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
}
pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_BLUE;
} else if (interfaceCtx->unk_212 == DO_ACTION_DECIDE) {
func_8011552C(play, DO_ACTION_INFO);
} else if (interfaceCtx->aButtonDoActionDelayed == DO_ACTION_DECIDE) {
Interface_SetAButtonDoAction(play, DO_ACTION_INFO);
}
if ((pauseCtx->cursorItem[PAUSE_QUEST] != PAUSE_ITEM_NONE) && (msgCtx->msgLength == 0)) {
@@ -357,8 +357,8 @@ void KaleidoScope_HandlePageToggles(PlayState* play, Input* input) {
if (CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT) || CHECK_BTN_ALL(input->press.button, BTN_R)) {
// Switch the page to the right regardless of where the cursor is
if (interfaceCtx->unk_212 == DO_ACTION_DECIDE) {
func_8011552C(play, DO_ACTION_INFO);
if (interfaceCtx->aButtonDoActionDelayed == DO_ACTION_DECIDE) {
Interface_SetAButtonDoAction(play, DO_ACTION_INFO);
}
KaleidoScope_SwitchPage(pauseCtx, SWITCH_PAGE_RIGHT);
return;
@@ -366,8 +366,8 @@ void KaleidoScope_HandlePageToggles(PlayState* play, Input* input) {
if (CHECK_BTN_ALL(input->cur.button, BTN_DLEFT) || CHECK_BTN_ALL(input->press.button, BTN_Z)) {
// Switch the page to the left regardless of where the cursor is
if (interfaceCtx->unk_212 == DO_ACTION_DECIDE) {
func_8011552C(play, DO_ACTION_INFO);
if (interfaceCtx->aButtonDoActionDelayed == DO_ACTION_DECIDE) {
Interface_SetAButtonDoAction(play, DO_ACTION_INFO);
}
KaleidoScope_SwitchPage(pauseCtx, SWITCH_PAGE_LEFT);
return;
@@ -2797,7 +2797,7 @@ void KaleidoScope_UpdateOpening(PlayState* play) {
pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE;
pauseCtx->state++; // PAUSE_STATE_MAIN
pauseCtx->alpha = 255;
func_80115844(play, DO_ACTION_RETURN);
Interface_SetBButtonInterfaceDoAction(play, DO_ACTION_RETURN);
} else if (pauseCtx->switchPageTimer == 64) {
pauseCtx->pageIndex = sPageSwitchNextPageIndex[pauseCtx->nextPageMode];
pauseCtx->nextPageMode = (pauseCtx->pageIndex * 2) + 1;
@@ -2871,7 +2871,8 @@ void KaleidoScope_Update(PlayState* play) {
for (itemId = 0; itemId <= ITEM_BOW_FIRE; itemId++) {
if (!gPlayerFormItemRestrictions[GET_PLAYER_FORM][(s32)itemId]) {
KaleidoScope_GrayOutTextureRGBA32(Lib_SegmentedToVirtual(gItemIcons[(s32)itemId]), 0x400);
KaleidoScope_GrayOutTextureRGBA32(Lib_SegmentedToVirtual(gItemIcons[(s32)itemId]),
ICON_ITEM_TEX_WIDTH * ICON_ITEM_TEX_HEIGHT);
}
}
@@ -2901,7 +2902,7 @@ void KaleidoScope_Update(PlayState* play) {
DmaMgr_RequestSync(pauseCtx->iconItemLangSegment, SEGMENT_ROM_START(icon_item_jpn_static), size2);
pauseCtx->nameSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemLangSegment + size2);
func_8011552C(play, DO_ACTION_INFO);
Interface_SetAButtonDoAction(play, DO_ACTION_INFO);
//! note: `worldMapArea` never set to a value other than 0
if (((void)0, gSaveContext.worldMapArea) < 22) {
@@ -2949,7 +2950,7 @@ void KaleidoScope_Update(PlayState* play) {
case PAUSE_MAIN_STATE_IDLE:
if (!pauseCtx->itemDescriptionOn &&
(CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B))) {
func_8011552C(play, DO_ACTION_NONE);
Interface_SetAButtonDoAction(play, DO_ACTION_NONE);
pauseCtx->state = PAUSE_STATE_UNPAUSE_SETUP;
sPauseMenuVerticalOffset = -6240.0f;
Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE);
@@ -2983,7 +2984,7 @@ void KaleidoScope_Update(PlayState* play) {
if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) {
// Abort having the player play the song and close the pause menu
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
func_8011552C(play, DO_ACTION_NONE);
Interface_SetAButtonDoAction(play, DO_ACTION_NONE);
pauseCtx->state = PAUSE_STATE_UNPAUSE_SETUP;
sPauseMenuVerticalOffset = -6240.0f;
Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE);
@@ -3019,7 +3020,7 @@ void KaleidoScope_Update(PlayState* play) {
case PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG:
if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) {
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
func_8011552C(play, DO_ACTION_NONE);
Interface_SetAButtonDoAction(play, DO_ACTION_NONE);
pauseCtx->state = PAUSE_STATE_UNPAUSE_SETUP;
sPauseMenuVerticalOffset = -6240.0f;
Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE);
@@ -3061,7 +3062,7 @@ void KaleidoScope_Update(PlayState* play) {
case PAUSE_SAVEPROMPT_STATE_1:
if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
if (pauseCtx->promptChoice != PAUSE_PROMPT_YES) {
func_8011552C(play, DO_ACTION_NONE);
Interface_SetAButtonDoAction(play, DO_ACTION_NONE);
pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_RETURN_TO_MENU;
} else {
Audio_PlaySfx(NA_SE_SY_PIECE_OF_HEART);
@@ -3079,13 +3080,13 @@ void KaleidoScope_Update(PlayState* play) {
sDelayTimer = 90;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_START)) {
func_8011552C(play, DO_ACTION_NONE);
Interface_SetAButtonDoAction(play, DO_ACTION_NONE);
pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_3;
sPauseMenuVerticalOffset = -6240.0f;
D_8082B90C = pauseCtx->roll;
Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE);
} else if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
func_8011552C(play, DO_ACTION_NONE);
Interface_SetAButtonDoAction(play, DO_ACTION_NONE);
pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_RETURN_TO_MENU;
D_8082B90C = pauseCtx->roll;
}
@@ -3100,7 +3101,7 @@ void KaleidoScope_Update(PlayState* play) {
case PAUSE_SAVEPROMPT_STATE_5:
if (CHECK_BTN_ALL(input->press.button, BTN_B) || CHECK_BTN_ALL(input->press.button, BTN_A) ||
CHECK_BTN_ALL(input->press.button, BTN_START) || (--sDelayTimer == 0)) {
func_8011552C(play, DO_ACTION_NONE);
Interface_SetAButtonDoAction(play, DO_ACTION_NONE);
pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_3;
sPauseMenuVerticalOffset = -6240.0f;
D_8082B90C = pauseCtx->roll;
@@ -3143,7 +3144,7 @@ void KaleidoScope_Update(PlayState* play) {
pauseCtx->roll = -314.0f;
pauseCtx->itemPageRoll = pauseCtx->mapPageRoll = pauseCtx->questPageRoll =
pauseCtx->maskPageRoll = 0.0f;
func_8011552C(play, DO_ACTION_INFO);
Interface_SetAButtonDoAction(play, DO_ACTION_INFO);
gSaveContext.buttonStatus[EQUIP_SLOT_B] =
gPageSwitchNextButtonStatus[pauseCtx->pageIndex + 1][0];
gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] =
@@ -3454,7 +3455,7 @@ void KaleidoScope_Update(PlayState* play) {
DmaMgr_RequestSync(pauseCtx->iconItemLangSegment, SEGMENT_ROM_START(icon_item_jpn_static), size2);
pauseCtx->nameSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemLangSegment + size2);
func_8011552C(play, DO_ACTION_WARP);
Interface_SetAButtonDoAction(play, DO_ACTION_WARP);
worldMapCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP];
Kaleido_LoadMapNameStatic(pauseCtx->nameSegment, worldMapCursorPoint);
@@ -3490,7 +3491,7 @@ void KaleidoScope_Update(PlayState* play) {
case PAUSE_STATE_OWL_WARP_SELECT:
if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) {
func_8011552C(play, DO_ACTION_NONE);
Interface_SetAButtonDoAction(play, DO_ACTION_NONE);
pauseCtx->state = PAUSE_STATE_OWL_WARP_6;
sPauseMenuVerticalOffset = -6240.0f;
Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE);
@@ -3510,7 +3511,7 @@ void KaleidoScope_Update(PlayState* play) {
msgCtx->msgLength = 0;
msgCtx->msgMode = MSGMODE_NONE;
if (msgCtx->choiceIndex == 0) {
func_8011552C(play, DO_ACTION_NONE);
Interface_SetAButtonDoAction(play, DO_ACTION_NONE);
pauseCtx->state = PAUSE_STATE_OWL_WARP_6;
sPauseMenuVerticalOffset = -6240.0f;
Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE);
@@ -3518,7 +3519,7 @@ void KaleidoScope_Update(PlayState* play) {
Audio_PlaySfx(NA_SE_SY_DECIDE);
} else {
pauseCtx->state = PAUSE_STATE_OWL_WARP_SELECT;
func_8011552C(play, DO_ACTION_WARP);
Interface_SetAButtonDoAction(play, DO_ACTION_WARP);
Audio_PlaySfx(NA_SE_SY_MESSAGE_PASS);
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
@@ -3529,7 +3530,7 @@ void KaleidoScope_Update(PlayState* play) {
} else if (CHECK_BTN_ALL(input->press.button, BTN_START)) {
msgCtx->msgLength = 0;
msgCtx->msgMode = MSGMODE_NONE;
func_8011552C(play, DO_ACTION_NONE);
Interface_SetAButtonDoAction(play, DO_ACTION_NONE);
pauseCtx->state = PAUSE_STATE_OWL_WARP_6;
sPauseMenuVerticalOffset = -6240.0f;
Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE);
@@ -3609,11 +3610,11 @@ void KaleidoScope_Update(PlayState* play) {
Skybox_Reload(play, &play->skyboxCtx, play->skyboxId);
if ((msgCtx->msgMode != MSGMODE_NONE) && (msgCtx->currentTextId == 0xFF)) {
func_80115844(play, DO_ACTION_STOP);
func_8011552C(play, DO_ACTION_STOP);
Interface_SetBButtonInterfaceDoAction(play, DO_ACTION_STOP);
Interface_SetAButtonDoAction(play, DO_ACTION_STOP);
Interface_SetHudVisibility(HUD_VISIBILITY_A_B_C);
} else {
interfaceCtx->unk_222 = interfaceCtx->unk_224 = 0;
interfaceCtx->bButtonInterfaceDoActionActive = interfaceCtx->bButtonInterfaceDoAction = 0;
}
gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE;
Interface_SetHudVisibility(sUnpausedHudVisibility);