2021-08-03 06:17:01 +00:00
|
|
|
#ifndef GUARD_ITEM_MENU_H
|
|
|
|
#define GUARD_ITEM_MENU_H
|
2017-09-20 01:47:15 +00:00
|
|
|
|
2018-12-10 09:32:00 +00:00
|
|
|
#include "item.h"
|
2019-03-02 07:44:02 +00:00
|
|
|
#include "menu_helpers.h"
|
2018-12-10 09:32:00 +00:00
|
|
|
|
2021-08-03 06:17:01 +00:00
|
|
|
enum {
|
|
|
|
ITEMMENULOCATION_FIELD,
|
|
|
|
ITEMMENULOCATION_BATTLE,
|
|
|
|
ITEMMENULOCATION_PARTY,
|
|
|
|
ITEMMENULOCATION_SHOP,
|
|
|
|
ITEMMENULOCATION_BERRY_TREE,
|
|
|
|
ITEMMENULOCATION_BERRY_BLENDER_CRUSH,
|
|
|
|
ITEMMENULOCATION_ITEMPC,
|
|
|
|
ITEMMENULOCATION_FAVOR_LADY,
|
|
|
|
ITEMMENULOCATION_QUIZ_LADY,
|
|
|
|
ITEMMENULOCATION_APPRENTICE,
|
|
|
|
ITEMMENULOCATION_WALLY,
|
|
|
|
ITEMMENULOCATION_PCBOX,
|
|
|
|
ITEMMENULOCATION_LAST,
|
|
|
|
};
|
2020-05-14 08:37:09 +00:00
|
|
|
|
2021-08-03 06:17:01 +00:00
|
|
|
// Window IDs for the item menu
|
|
|
|
enum {
|
|
|
|
ITEMWIN_1x1,
|
|
|
|
ITEMWIN_1x2,
|
|
|
|
ITEMWIN_2x2,
|
|
|
|
ITEMWIN_2x3,
|
|
|
|
ITEMWIN_MESSAGE,
|
|
|
|
ITEMWIN_YESNO_LOW,
|
|
|
|
ITEMWIN_YESNO_HIGH,
|
|
|
|
ITEMWIN_QUANTITY,
|
|
|
|
ITEMWIN_QUANTITY_WIDE,
|
|
|
|
ITEMWIN_MONEY,
|
|
|
|
ITEMWIN_COUNT
|
|
|
|
};
|
2018-12-10 16:39:57 +00:00
|
|
|
|
2021-08-03 06:17:01 +00:00
|
|
|
#define ITEMMENU_SWAP_LINE_LENGTH 8 // Swap line is 8 sprites long
|
|
|
|
enum {
|
|
|
|
ITEMMENUSPRITE_BAG,
|
|
|
|
ITEMMENUSPRITE_BALL,
|
|
|
|
ITEMMENUSPRITE_ITEM,
|
|
|
|
ITEMMENUSPRITE_ITEM_ALT, // Need two when selecting new item
|
|
|
|
ITEMMENUSPRITE_SWAP_LINE,
|
|
|
|
ITEMMENUSPRITE_COUNT = ITEMMENUSPRITE_SWAP_LINE + ITEMMENU_SWAP_LINE_LENGTH,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct BagPosition
|
2018-02-02 13:03:48 +00:00
|
|
|
{
|
2021-08-03 06:17:01 +00:00
|
|
|
void (*exitCallback)(void);
|
2018-03-04 17:41:07 +00:00
|
|
|
u8 location;
|
2018-02-02 13:03:48 +00:00
|
|
|
u8 pocket;
|
2021-08-03 06:17:01 +00:00
|
|
|
u16 pocketSwitchArrowPos;
|
2018-12-10 09:32:00 +00:00
|
|
|
u16 cursorPosition[POCKETS_COUNT];
|
|
|
|
u16 scrollPosition[POCKETS_COUNT];
|
2018-02-02 13:03:48 +00:00
|
|
|
};
|
|
|
|
|
2021-08-03 06:17:01 +00:00
|
|
|
extern struct BagPosition gBagPosition;
|
2017-09-20 01:47:15 +00:00
|
|
|
|
2021-08-03 06:17:01 +00:00
|
|
|
struct BagMenu
|
2018-03-04 17:41:07 +00:00
|
|
|
{
|
2021-08-03 06:17:01 +00:00
|
|
|
void (*newScreenCallback)(void);
|
|
|
|
u8 tilemapBuffer[BG_SCREEN_SIZE];
|
|
|
|
u8 spriteIds[ITEMMENUSPRITE_COUNT];
|
|
|
|
u8 windowIds[ITEMWIN_COUNT];
|
|
|
|
u8 toSwapPos;
|
2020-05-14 08:37:09 +00:00
|
|
|
u8 pocketSwitchDisabled:4;
|
|
|
|
u8 itemIconSlot:2;
|
|
|
|
u8 inhibitItemDescriptionPrint:1;
|
2018-12-15 18:08:13 +00:00
|
|
|
u8 hideCloseBagText:1;
|
2021-08-03 06:17:01 +00:00
|
|
|
u8 unused1[2];
|
2020-05-14 08:37:09 +00:00
|
|
|
u8 pocketScrollArrowsTask;
|
|
|
|
u8 pocketSwitchArrowsTask;
|
|
|
|
const u8* contextMenuItemsPtr;
|
|
|
|
u8 contextMenuItemsBuffer[4];
|
|
|
|
u8 contextMenuNumItems;
|
2018-12-15 18:08:13 +00:00
|
|
|
u8 numItemStacks[POCKETS_COUNT];
|
2021-08-03 06:17:01 +00:00
|
|
|
u8 numShownItems[POCKETS_COUNT];
|
2020-05-14 08:37:09 +00:00
|
|
|
s16 graphicsLoadState;
|
2021-08-03 06:17:01 +00:00
|
|
|
u8 unused2[14];
|
2018-12-15 18:08:13 +00:00
|
|
|
u8 pocketNameBuffer[32][32];
|
2021-08-03 06:17:01 +00:00
|
|
|
u8 unused3[4];
|
2018-03-04 17:41:07 +00:00
|
|
|
};
|
|
|
|
|
2021-08-03 06:17:01 +00:00
|
|
|
extern struct BagMenu *gBagMenu;
|
2017-11-16 13:36:51 +00:00
|
|
|
extern u16 gSpecialVar_ItemId;
|
2017-11-10 02:48:27 +00:00
|
|
|
|
2020-05-14 08:37:09 +00:00
|
|
|
void CB2_GoToItemDepositMenu(void);
|
2019-08-06 00:37:09 +00:00
|
|
|
void FavorLadyOpenBagMenu(void);
|
|
|
|
void QuizLadyOpenBagMenu(void);
|
2019-11-19 16:36:38 +00:00
|
|
|
void ApprenticeOpenBagMenu(void);
|
2020-05-14 08:37:09 +00:00
|
|
|
void CB2_BagMenuFromBattle(void);
|
2021-08-03 06:17:01 +00:00
|
|
|
void UpdatePocketListPosition(u8 pocketId);
|
2019-12-22 00:01:38 +00:00
|
|
|
void CB2_ReturnToBagMenuPocket(void);
|
2018-03-27 22:33:08 +00:00
|
|
|
void CB2_BagMenuFromStartMenu(void);
|
2018-12-15 18:08:13 +00:00
|
|
|
u8 GetItemListPosition(u8 pocketId);
|
2018-10-17 02:47:08 +00:00
|
|
|
bool8 UseRegisteredKeyItemOnField(void);
|
2018-10-18 17:05:02 +00:00
|
|
|
void CB2_GoToSellMenu(void);
|
2021-08-03 06:17:01 +00:00
|
|
|
void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *exitCallback)());
|
2018-12-23 23:20:38 +00:00
|
|
|
void DoWallyTutorialBagMenu(void);
|
2019-02-15 08:40:57 +00:00
|
|
|
void ResetBagScrollPositions(void);
|
2020-08-22 22:20:22 +00:00
|
|
|
void ChooseBerryForMachine(void (*exitCallback)(void));
|
2019-03-02 03:32:50 +00:00
|
|
|
void CB2_ChooseBerry(void);
|
2019-12-22 00:01:38 +00:00
|
|
|
void Task_FadeAndCloseBagMenu(u8 taskId);
|
2021-08-03 06:17:01 +00:00
|
|
|
void BagMenu_YesNo(u8 taskId, u8 windowType, const struct YesNoFuncTable* funcTable);
|
2019-12-22 00:01:38 +00:00
|
|
|
void UpdatePocketItemList(u8 pocketId);
|
|
|
|
void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void ( *callback)(u8 taskId));
|
|
|
|
void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback);
|
2021-08-03 06:17:01 +00:00
|
|
|
void CloseItemMessage(u8 taskId);
|
2019-12-22 00:01:38 +00:00
|
|
|
|
2021-08-03 06:17:01 +00:00
|
|
|
#endif //GUARD_ITEM_MENU_H
|