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;
}