diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-01-06 00:23:55 -0500 |
|---|---|---|
| committer | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-01-06 00:23:55 -0500 |
| commit | 37dbfd75de367d41e5a2edffa00b1b6027b1bd8e (patch) | |
| tree | 6525c7b1e2086d4cbffd97c0c15df1391bec5b1a /include/d | |
| parent | 4a0a89501d765c5682e76ed5e05cd45648977614 (diff) | |
Add item button enum and talk button enum
Diffstat (limited to 'include/d')
| -rw-r--r-- | include/d/actor/d_a_npc_roten.h | 2 | ||||
| -rw-r--r-- | include/d/actor/d_a_player_main.h | 2 | ||||
| -rw-r--r-- | include/d/d_com_inf_game.h | 66 | ||||
| -rw-r--r-- | include/d/d_event.h | 14 |
4 files changed, 54 insertions, 30 deletions
diff --git a/include/d/actor/d_a_npc_roten.h b/include/d/actor/d_a_npc_roten.h index e0103602..aed59cec 100644 --- a/include/d/actor/d_a_npc_roten.h +++ b/include/d/actor/d_a_npc_roten.h @@ -132,7 +132,7 @@ public: /* 0x9C2 */ s8 field_0x9C2; /* 0x9C3 */ s8 field_0x9C3; /* 0x9C4 */ s8 field_0x9C4; - /* 0x9C5 */ u8 field_0x9C5; + /* 0x9C5 */ u8 mShownItemBtn; /* 0x9C6 */ u8 field_0x9C6; /* 0x9C7 */ u8 field_0x9C7; /* 0x9C8 */ u8 field_0x9C8; diff --git a/include/d/actor/d_a_player_main.h b/include/d/actor/d_a_player_main.h index 908b84f4..04120b64 100644 --- a/include/d/actor/d_a_player_main.h +++ b/include/d/actor/d_a_player_main.h @@ -1997,7 +1997,7 @@ public: /* 0x34BA */ u8 m34BA; /* 0x34BB */ u8 mCurrItemHeapIdx; /* 0x34BC */ u8 m34BC; - /* 0x34BD */ u8 mReadyItemIdx; // Which of the three item buttons the player last used. + /* 0x34BD */ u8 mReadyItemBtn; // Which of the three item buttons the player last used. /* 0x34BE */ u8 m34BE; /* 0x34BF */ s8 mReverb; /* 0x34C0 */ u8 mLeftHandIdx; diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 1b9fea2b..2660f32d 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -867,7 +867,7 @@ inline OSTime dComIfGs_getDateIpl() { return g_dComIfG_gameInfo.save.getPlayer().getPlayerStatusB().getDateIpl(); } -// The inventory slot for items. Also known as "select item" +// The inventory slot for items. Also known as "select item". enum dInventorySlot_e { dInvSlot_ItemFirst_e = 0, dInvSlot_TELESCOPE_e = 0, @@ -888,6 +888,7 @@ enum dInventorySlot_e { dInvSlot_BOTTLE1_e = 15, dInvSlot_BOTTLE2_e = 16, dInvSlot_BOTTLE3_e = 17, + dInvSlot_BOTTLE_COUNT_e = dInvSlot_BOTTLE3_e + 1 - dInvSlot_BOTTLE0_e, dInvSlot_DELIVERY_BAG_e = 18, dInvSlot_HOOKSHOT_e = 19, dInvSlot_SKULL_HAMMER_e = 20, @@ -905,6 +906,15 @@ enum dInventorySlot_e { dInvSlot_NONE_e = 0xFF, }; +// The index of a button that can have an item assigned to it. +enum dItemButton_e { + dItemBtn_X_e = 0, + dItemBtn_Y_e = 1, + dItemBtn_Z_e = 2, + dItemBtn_NONE_e = 3, + dItemBtn_COUNT_e = 3, +}; + /** * Returns which item is in a specific inventory slot. * @param i_invIdx The index of the inventory slot. @@ -1087,8 +1097,8 @@ inline void dComIfGs_setReserveNum(int i_idx, u8 num) { g_dComIfG_gameInfo.save.getPlayer().getBagItemRecord().setReserveNum(i_idx, num); } -inline void dComIfGs_setReserveItemChange(u8 idx, u8 no) { - g_dComIfG_gameInfo.save.getPlayer().getBagItem().setReserveItemChange(idx, no); +inline void dComIfGs_setReserveItemChange(u8 i_itemBtn, u8 no) { + g_dComIfG_gameInfo.save.getPlayer().getBagItem().setReserveItemChange(i_itemBtn, no); } inline u8 dComIfGs_checkReserveItemEmpty() { @@ -1099,8 +1109,8 @@ inline void dComIfGs_setReserveItemEmpty() { g_dComIfG_gameInfo.save.getPlayer().getBagItem().setReserveItemEmpty(); } -inline void dComIfGs_setReserveBaitEmpty(u8 i_btnIdx) { - g_dComIfG_gameInfo.save.getPlayer().getBagItem().setBaitItemEmpty(i_btnIdx); +inline void dComIfGs_setReserveBaitEmpty(u8 i_itemBtn) { + g_dComIfG_gameInfo.save.getPlayer().getBagItem().setBaitItemEmpty(i_itemBtn); } inline void dComIfGs_setEventReg(u16 i_reg, u8 i_no) { @@ -1502,20 +1512,20 @@ inline BOOL dComIfGs_isActor(int i_no, int i_roomNo) { /** * Returns which inventory slot the item equipped on a specific button is located in. - * @param i_btnIdx The index of the button. 0 for X, 1 for Y, 2 for Z. + * @param i_itemBtn The dItemButton_e of the button. * @return The index of the inventory slot for the item equipped on that button, or 0xFF for no item. */ -inline u8 dComIfGs_getSelectItem(int i_btnIdx) { - return g_dComIfG_gameInfo.save.getPlayer().getPlayerStatusA().getSelectItem(i_btnIdx); +inline u8 dComIfGs_getSelectItem(int i_itemBtn) { + return g_dComIfG_gameInfo.save.getPlayer().getPlayerStatusA().getSelectItem(i_itemBtn); } /** * Sets which inventory slot the item equipped on a specific button is located in. - * @param i_btnIdx The index of the button. 0 for X, 1 for Y, 2 for Z. + * @param i_itemBtn The dItemButton_e of the button. * @param i_invIdx The index of the inventory slot, or 0xFF for no item. */ -inline void dComIfGs_setSelectItem(int i_btnIdx, u8 i_invIdx) { - g_dComIfG_gameInfo.save.getPlayer().getPlayerStatusA().setSelectItem(i_btnIdx, i_invIdx); +inline void dComIfGs_setSelectItem(int i_itemBtn, u8 i_invIdx) { + g_dComIfG_gameInfo.save.getPlayer().getPlayerStatusA().setSelectItem(i_itemBtn, i_invIdx); } inline u16 dComIfGs_getDate() { @@ -1578,12 +1588,12 @@ inline void dComIfGs_setEmptyBottle() { g_dComIfG_gameInfo.save.getPlayer().getItem().setEmptyBottle(); } -inline void dComIfGs_setEquipBottleItemIn(u8 i_btnIdx, u8 i_itemNo) { - g_dComIfG_gameInfo.save.getPlayer().getItem().setEquipBottleItemIn(i_btnIdx, i_itemNo); +inline void dComIfGs_setEquipBottleItemIn(u8 i_itemBtn, u8 i_itemNo) { + g_dComIfG_gameInfo.save.getPlayer().getItem().setEquipBottleItemIn(i_itemBtn, i_itemNo); } -inline void dComIfGs_setEquipBottleItemEmpty(u8 i_btnIdx) { - g_dComIfG_gameInfo.save.getPlayer().getItem().setEquipBottleItemEmpty(i_btnIdx); +inline void dComIfGs_setEquipBottleItemEmpty(u8 i_itemBtn) { + g_dComIfG_gameInfo.save.getPlayer().getItem().setEquipBottleItemEmpty(i_itemBtn); } inline void dComIfGs_setEquipBottleItemEmpty() { @@ -2471,30 +2481,30 @@ inline void dComIfGp_setAStatusForce(u8 value) { /** * Returns which item is on a specific button. - * @param i_btnIdx The index of the button. 0 for X, 1 for Y, 2 for Z. + * @param i_itemBtn The dItemButton_e of the button. * @return The item number of the item in that slot, or 0xFF for no item. */ -inline u8 dComIfGp_getSelectItem(int i_btnIdx) { - return g_dComIfG_gameInfo.play.getSelectItem(i_btnIdx); +inline u8 dComIfGp_getSelectItem(int i_itemBtn) { + return g_dComIfG_gameInfo.play.getSelectItem(i_itemBtn); } /** * Updates which item is on a specific button to match which item is in the inventory slot correspond to that button. - * @param i_btnIdx The index of the button. 0 for X, 1 for Y, 2 for Z. + * @param i_itemBtn The dItemButton_e of the button. */ -inline void dComIfGp_setSelectItem(int i_btnIdx) { - if (dComIfGs_getSelectItem(i_btnIdx) != dInvSlot_NONE_e) { - int invIdx = dComIfGs_getSelectItem(i_btnIdx); +inline void dComIfGp_setSelectItem(int i_itemBtn) { + if (dComIfGs_getSelectItem(i_itemBtn) != dInvSlot_NONE_e) { + int invIdx = dComIfGs_getSelectItem(i_itemBtn); u8 itemNo = dComIfGs_getItem(invIdx); - g_dComIfG_gameInfo.play.setSelectItem(i_btnIdx, itemNo); + g_dComIfG_gameInfo.play.setSelectItem(i_itemBtn, itemNo); - invIdx = dComIfGs_getSelectItem(i_btnIdx); + invIdx = dComIfGs_getSelectItem(i_itemBtn); itemNo = dComIfGs_getItem(invIdx); if (itemNo == dItem_NONE_e) { - dComIfGs_setSelectItem(i_btnIdx, dInvSlot_NONE_e); + dComIfGs_setSelectItem(i_itemBtn, dInvSlot_NONE_e); } } else { - g_dComIfG_gameInfo.play.setSelectItem(i_btnIdx, dItem_NONE_e); + g_dComIfG_gameInfo.play.setSelectItem(i_itemBtn, dItem_NONE_e); } } @@ -2741,6 +2751,10 @@ inline BOOL dComIfGp_event_runCheck() { return g_dComIfG_gameInfo.play.getEvent().runCheck(); } +/** + * Returns the button (X Y or Z) that was used to start this event. + * @return The dTalkXYButton_e of the button the player used to initiate this event. + */ inline u8 dComIfGp_event_getTalkXYBtn() { return g_dComIfG_gameInfo.play.getEvent().getTalkXYBtn(); } diff --git a/include/d/d_event.h b/include/d/d_event.h index d222f668..70a2355a 100644 --- a/include/d/d_event.h +++ b/include/d/d_event.h @@ -2,7 +2,6 @@ #define D_EVENT_D_EVENT_H #include "f_pc/f_pc_base.h" -#include "global.h" class fopAc_ac_c; @@ -59,6 +58,13 @@ public: class dStage_Event_dt_c; +enum dTalkXYButton_e { + dTalkBtn_NONE_e = 0, + dTalkBtn_X_e = 1, + dTalkBtn_Y_e = 2, + dTalkBtn_Z_e = 3, +}; + class dEvt_control_c { public: dEvt_control_c(); @@ -98,7 +104,11 @@ public: bool giveItemCut(u8); u8 getTalkXYBtn() { return mTalkButton; } - bool chkTalkXY() { return mTalkButton == 1 || mTalkButton == 2 || mTalkButton == 3; } + bool chkTalkXY() { + return mTalkButton == dTalkBtn_X_e || + mTalkButton == dTalkBtn_Y_e || + mTalkButton == dTalkBtn_Z_e; + } void setPtI_Id(fpc_ProcID id) { mPtItem = id; } void setPtI(void* actor) { mPtItem = getPId(actor); } fopAc_ac_c* getPtI() { return convPId(mPtItem); } |
