summaryrefslogtreecommitdiff
path: root/mm/src/code
diff options
context:
space:
mode:
authormckinlee <mckinlee@ymail.com>2026-03-19 21:41:24 -0400
committerGitHub <noreply@github.com>2026-03-19 21:41:24 -0400
commitcfd5cc483ae2da52ccc8e00082ef2f8e3d969863 (patch)
tree7f949e637b9627975e6e08bfdec8bbfb32df5565 /mm/src/code
parentf7ccda83aab44cf532798aba306b2cf12a3ea8fb (diff)
[Enhancement] Song Items (#1566)
* equip songs * feedback
Diffstat (limited to 'mm/src/code')
-rw-r--r--mm/src/code/z_message.c33
-rw-r--r--mm/src/code/z_parameter.c74
-rw-r--r--mm/src/code/z_player_lib.c19
3 files changed, 82 insertions, 44 deletions
diff --git a/mm/src/code/z_message.c b/mm/src/code/z_message.c
index 04efc6f8c..1e0a6eed6 100644
--- a/mm/src/code/z_message.c
+++ b/mm/src/code/z_message.c
@@ -4298,6 +4298,10 @@ void Message_DrawOcarinaButtons(PlayState* play, Gfx** gfxP) {
}
void Message_DrawText(PlayState* play, Gfx** gfxP) {
+ if (!GameInteractor_Should(VB_DRAW_OCARINA_STAFF, true)) {
+ return;
+ }
+
if ((gSaveContext.options.language == LANGUAGE_JPN) && !play->msgCtx.textIsCredits) {
Message_DrawTextDefault(play, gfxP);
} else if (play->msgCtx.textIsCredits) {
@@ -4424,7 +4428,9 @@ void Message_DrawMain(PlayState* play, Gfx** gfxP) {
(((msgCtx->msgMode >= MSGMODE_TEXT_BOX_GROWING) && (msgCtx->msgMode <= MSGMODE_TEXT_DONE)) ||
((msgCtx->msgMode >= MSGMODE_NEW_CYCLE_0) && (msgCtx->msgMode <= MSGMODE_OWL_SAVE_2))) &&
(D_801CFC78[msgCtx->textBoxType] != 0xE)) {
- Message_DrawTextBox(play, &gfx);
+ if (GameInteractor_Should(VB_DRAW_OCARINA_STAFF, true)) {
+ Message_DrawTextBox(play, &gfx);
+ }
}
}
}
@@ -4495,8 +4501,10 @@ void Message_DrawMain(PlayState* play, Gfx** gfxP) {
case MSGMODE_TEXT_AWAIT_INPUT:
case MSGMODE_TEXT_AWAIT_NEXT:
Message_DrawText(play, &gfx);
- Message_DrawTextboxIcon(play, &gfx, 158,
- (s16)(D_801D03A8[msgCtx->textBoxType] + msgCtx->textboxYTarget));
+ if (GameInteractor_Should(VB_DRAW_OCARINA_STAFF, true)) {
+ Message_DrawTextboxIcon(play, &gfx, 158,
+ (s16)(D_801D03A8[msgCtx->textBoxType] + msgCtx->textboxYTarget));
+ }
break;
case MSGMODE_OCARINA_STARTING:
@@ -4611,6 +4619,8 @@ void Message_DrawMain(PlayState* play, Gfx** gfxP) {
msgCtx->songPlayed = msgCtx->ocarinaStaff->state;
+ GameInteractor_Should(VB_OVERRIDE_OCARINA_STAFF_STATE, false, msgCtx->ocarinaStaff);
+
bool vanillaOwnedSongCheck = (msgCtx->ocarinaStaff->state == OCARINA_SONG_SCARECROW_SPAWN) ||
(msgCtx->ocarinaStaff->state == OCARINA_SONG_INVERTED_TIME) ||
(msgCtx->ocarinaStaff->state == OCARINA_SONG_DOUBLE_TIME) ||
@@ -5317,13 +5327,17 @@ void Message_DrawMain(PlayState* play, Gfx** gfxP) {
case TEXTBOX_ENDTYPE_INPUT_BANK:
case TEXTBOX_ENDTYPE_INPUT_DOGGY_RACETRACK_BET:
default:
- Message_DrawTextboxIcon(play, &gfx, 158,
- (s16)(D_801D03A8[msgCtx->textBoxType] + msgCtx->textboxYTarget));
+ if (GameInteractor_Should(VB_DRAW_OCARINA_STAFF, true)) {
+ Message_DrawTextboxIcon(play, &gfx, 158,
+ (s16)(D_801D03A8[msgCtx->textBoxType] + msgCtx->textboxYTarget));
+ }
break;
case TEXTBOX_ENDTYPE_EVENT2:
- Message_DrawTextboxIcon(play, &gfx, 158,
- (s16)(D_801D03A8[msgCtx->textBoxType] + msgCtx->textboxYTarget));
+ if (GameInteractor_Should(VB_DRAW_OCARINA_STAFF, true)) {
+ Message_DrawTextboxIcon(play, &gfx, 158,
+ (s16)(D_801D03A8[msgCtx->textBoxType] + msgCtx->textboxYTarget));
+ }
break;
}
break;
@@ -5354,7 +5368,10 @@ void Message_DrawMain(PlayState* play, Gfx** gfxP) {
break;
}
}
- Message_DrawOcarinaButtons(play, &gfx);
+ if (GameInteractor_Should(VB_DRAW_OCARINA_STAFF, true)) {
+ Message_DrawOcarinaButtons(play, &gfx);
+ }
+
*gfxP = gfx;
}
diff --git a/mm/src/code/z_parameter.c b/mm/src/code/z_parameter.c
index 534d9bb33..8cd3ea70c 100644
--- a/mm/src/code/z_parameter.c
+++ b/mm/src/code/z_parameter.c
@@ -4028,6 +4028,10 @@ void Interface_InitMinigame(PlayState* play) {
void Interface_Dpad_LoadItemIconImpl(PlayState* play, u8 btn) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
+ if (!GameInteractor_Should(VB_INTERFACE_LOAD_DPAD_ITEM_ICON, true, btn)) {
+ return;
+ }
+
if (DPAD_GET_CUR_FORM_BTN_ITEM(btn) < ARRAY_COUNT(gItemIcons)) {
interfaceCtx->iconItemSegment[DPAD_BUTTON(btn) + EQUIP_SLOT_MAX] = gItemIcons[DPAD_GET_CUR_FORM_BTN_ITEM(btn)];
} else {
@@ -4065,6 +4069,10 @@ void Interface_DrawAutosaveIcon(PlayState* play, uint16_t opacity) {
void Interface_LoadItemIconImpl(PlayState* play, u8 btn) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
+ if (!GameInteractor_Should(VB_INTERFACE_LOAD_ITEM_ICON, true, btn)) {
+ return;
+ }
+
// #region 2S2H [Port]
// CmpDma_LoadFile(SEGMENT_ROM_START(icon_item_static_yar), GET_CUR_FORM_BTN_ITEM(btn),
// &interfaceCtx->iconItemSegment[(u32)btn * ICON_ITEM_TEX_SIZE], ICON_ITEM_TEX_SIZE);
@@ -6684,38 +6692,42 @@ void Interface_DrawPauseMenuEquippingIcons(PlayState* play) {
pauseCtx->cursorVtx[18].v.ob[1] = pauseCtx->cursorVtx[19].v.ob[1] =
pauseCtx->cursorVtx[16].v.ob[1] - (pauseCtx->equipAnimScale / 10);
- if (pauseCtx->equipTargetItem < 0xB5) {
- // Normal Equip (icon goes from the inventory slot to the C button when equipping it)
- gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, pauseCtx->equipAnimAlpha);
- gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0);
- gDPLoadTextureBlock(OVERLAY_DISP++, gItemIcons[pauseCtx->equipTargetItem], G_IM_FMT_RGBA, G_IM_SIZ_32b,
- ICON_ITEM_TEX_WIDTH, ICON_ITEM_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
- } else {
- // Magic Arrow Equip Effect
- temp = pauseCtx->equipTargetItem - 0xB5;
- gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sMagicArrowEffectsR[temp], sMagicArrowEffectsG[temp],
- sMagicArrowEffectsB[temp], pauseCtx->equipAnimAlpha);
-
- if ((pauseCtx->equipAnimAlpha > 0) && (pauseCtx->equipAnimAlpha < 255)) {
- temp = (pauseCtx->equipAnimAlpha / 8) / 2;
- pauseCtx->cursorVtx[16].v.ob[0] = pauseCtx->cursorVtx[18].v.ob[0] =
- pauseCtx->cursorVtx[16].v.ob[0] - temp;
- pauseCtx->cursorVtx[17].v.ob[0] = pauseCtx->cursorVtx[19].v.ob[0] =
- pauseCtx->cursorVtx[16].v.ob[0] + temp * 2 + 32;
- pauseCtx->cursorVtx[16].v.ob[1] = pauseCtx->cursorVtx[17].v.ob[1] =
- pauseCtx->cursorVtx[16].v.ob[1] + temp;
- pauseCtx->cursorVtx[18].v.ob[1] = pauseCtx->cursorVtx[19].v.ob[1] =
- pauseCtx->cursorVtx[16].v.ob[1] - temp * 2 - 32;
- }
-
- gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0);
- gDPLoadTextureBlock(OVERLAY_DISP++, gMagicArrowEquipEffectTex, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
- G_TX_NOLOD, G_TX_NOLOD);
- }
+ ItemId equipAnimDrawItem = pauseCtx->equipTargetItem;
+ if (GameInteractor_Should(VB_KALEIDO_DRAW_EQUIP_ANIM_ICON, true, &equipAnimDrawItem)) {
- gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0);
+ if (pauseCtx->equipTargetItem < 0xB5) {
+ // Normal Equip (icon goes from the inventory slot to the C button when equipping it)
+ gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, pauseCtx->equipAnimAlpha);
+ gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0);
+ gDPLoadTextureBlock(OVERLAY_DISP++, gItemIcons[equipAnimDrawItem], G_IM_FMT_RGBA, G_IM_SIZ_32b,
+ ICON_ITEM_TEX_WIDTH, ICON_ITEM_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
+ } else {
+ // Magic Arrow Equip Effect
+ temp = pauseCtx->equipTargetItem - 0xB5;
+ gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sMagicArrowEffectsR[temp], sMagicArrowEffectsG[temp],
+ sMagicArrowEffectsB[temp], pauseCtx->equipAnimAlpha);
+
+ if ((pauseCtx->equipAnimAlpha > 0) && (pauseCtx->equipAnimAlpha < 255)) {
+ temp = (pauseCtx->equipAnimAlpha / 8) / 2;
+ pauseCtx->cursorVtx[16].v.ob[0] = pauseCtx->cursorVtx[18].v.ob[0] =
+ pauseCtx->cursorVtx[16].v.ob[0] - temp;
+ pauseCtx->cursorVtx[17].v.ob[0] = pauseCtx->cursorVtx[19].v.ob[0] =
+ pauseCtx->cursorVtx[16].v.ob[0] + temp * 2 + 32;
+ pauseCtx->cursorVtx[16].v.ob[1] = pauseCtx->cursorVtx[17].v.ob[1] =
+ pauseCtx->cursorVtx[16].v.ob[1] + temp;
+ pauseCtx->cursorVtx[18].v.ob[1] = pauseCtx->cursorVtx[19].v.ob[1] =
+ pauseCtx->cursorVtx[16].v.ob[1] - temp * 2 - 32;
+ }
+
+ gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0);
+ gDPLoadTextureBlock(OVERLAY_DISP++, gMagicArrowEquipEffectTex, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
+ G_TX_NOLOD, G_TX_NOLOD);
+ }
+
+ gSP1Quadrangle(OVERLAY_DISP++, 0, 2, 3, 1, 0);
+ }
}
CLOSE_DISPS(play->state.gfxCtx);
diff --git a/mm/src/code/z_player_lib.c b/mm/src/code/z_player_lib.c
index 5ba73fc3f..3ab319529 100644
--- a/mm/src/code/z_player_lib.c
+++ b/mm/src/code/z_player_lib.c
@@ -760,7 +760,9 @@ ItemId Player_Dpad_GetItemOnButton(PlayState* play, Player* player, DpadEquipSlo
return ITEM_NONE;
}
- return DPAD_BTN_ITEM(slot);
+ ItemId item = DPAD_BTN_ITEM(slot);
+ GameInteractor_Should(VB_GET_ITEM_ON_BUTTON, item, slot, &item);
+ return item;
}
// #endregion
@@ -797,16 +799,23 @@ ItemId Player_GetItemOnButton(PlayState* play, Player* player, EquipSlot slot) {
}
if (slot == EQUIP_SLOT_C_LEFT) {
- return C_BTN_ITEM(EQUIP_SLOT_C_LEFT);
+ ItemId item = C_BTN_ITEM(EQUIP_SLOT_C_LEFT);
+ GameInteractor_Should(VB_GET_ITEM_ON_BUTTON, item, slot, &item);
+ return item;
}
if (slot == EQUIP_SLOT_C_DOWN) {
- return C_BTN_ITEM(EQUIP_SLOT_C_DOWN);
+ ItemId item = C_BTN_ITEM(EQUIP_SLOT_C_DOWN);
+ GameInteractor_Should(VB_GET_ITEM_ON_BUTTON, item, slot, &item);
+ return item;
}
// EQUIP_SLOT_C_RIGHT
-
- return C_BTN_ITEM(EQUIP_SLOT_C_RIGHT);
+ {
+ ItemId item = C_BTN_ITEM(EQUIP_SLOT_C_RIGHT);
+ GameInteractor_Should(VB_GET_ITEM_ON_BUTTON, item, slot, &item);
+ return item;
+ }
}
// #region 2S2H [Dpad]