pokeemerald/include/item_menu.h

108 lines
3.1 KiB
C
Raw Normal View History

2017-09-20 03:47:15 +02:00
#ifndef GUARD_item_menu_H
#define GUARD_item_menu_H
2018-12-10 10:32:00 +01:00
#include "item.h"
2019-03-02 08:44:02 +01:00
#include "menu_helpers.h"
2018-12-10 10:32:00 +01:00
2020-05-14 10:37:09 +02:00
#define ITEMMENULOCATION_FIELD 0
#define ITEMMENULOCATION_BATTLE 1
#define ITEMMENULOCATION_PARTY 2
#define ITEMMENULOCATION_SHOP 3
#define ITEMMENULOCATION_BERRY_TREE 4
#define ITEMMENULOCATION_BERRY_BLENDER_CRUSH 5
#define ITEMMENULOCATION_ITEMPC 6
#define ITEMMENULOCATION_FAVOR_LADY 7
#define ITEMMENULOCATION_QUIZ_LADY 8
#define ITEMMENULOCATION_APPRENTICE 9
#define ITEMMENULOCATION_WALLY 10
#define ITEMMENULOCATION_PCBOX 11
#define ITEMMENULOCATION_LAST 12
#define ITEMMENUACTION_USE 0
#define ITEMMENUACTION_TOSS 1
#define ITEMMENUACTION_REGISTER 2
#define ITEMMENUACTION_GIVE 3
#define ITEMMENUACTION_CANCEL 4
#define ITEMMENUACTION_BATTLE_USE 5
#define ITEMMENUACTION_CHECK 6
#define ITEMMENUACTION_WALK 7
#define ITEMMENUACTION_DESELECT 8
#define ITEMMENUACTION_CHECK_TAG 9
#define ITEMMENUACTION_CONFIRM 10
#define ITEMMENUACTION_SHOW 11
#define ITEMMENUACTION_GIVE_2 12
#define ITEMMENUACTION_CONFIRM_2 13
#define ITEMMENUACTION_DUMMY 14
2018-12-10 17:39:57 +01:00
2017-09-20 03:47:15 +02:00
// Exported type declarations
2018-02-02 14:03:48 +01:00
struct BagStruct
{
2018-03-04 18:41:07 +01:00
void (*bagCallback)(void);
u8 location;
2018-02-02 14:03:48 +01:00
u8 pocket;
2018-05-19 11:36:31 +02:00
u16 unk6;
2018-12-10 10:32:00 +01:00
u16 cursorPosition[POCKETS_COUNT];
u16 scrollPosition[POCKETS_COUNT];
2018-02-02 14:03:48 +01:00
};
extern struct BagStruct gBagPositionStruct;
2017-09-20 03:47:15 +02:00
struct BagMenuStruct
2018-03-04 18:41:07 +01:00
{
2020-05-14 10:37:09 +02:00
void (*exitCallback)(void);
2018-12-15 19:08:13 +01:00
u8 tilemapBuffer[0x800];
u8 spriteId[12];
2020-07-11 16:22:34 +02:00
u8 windowPointers[10];
2020-05-14 10:37:09 +02:00
u8 itemOriginalLocation;
u8 pocketSwitchDisabled:4;
u8 itemIconSlot:2;
u8 inhibitItemDescriptionPrint:1;
2018-12-15 19:08:13 +01:00
u8 hideCloseBagText:1;
2018-03-04 18:41:07 +01:00
u8 filler3[2];
2020-05-14 10:37:09 +02:00
u8 pocketScrollArrowsTask;
u8 pocketSwitchArrowsTask;
const u8* contextMenuItemsPtr;
u8 contextMenuItemsBuffer[4];
u8 contextMenuNumItems;
2018-12-15 19:08:13 +01:00
u8 numItemStacks[POCKETS_COUNT];
u8 numShownItems[6];
2020-05-14 10:37:09 +02:00
s16 graphicsLoadState;
2018-03-04 18:41:07 +01:00
u8 filler4[0xE];
2018-12-15 19:08:13 +01:00
u8 pocketNameBuffer[32][32];
2018-03-04 18:41:07 +01:00
u8 filler2[4];
};
extern struct BagMenuStruct *gBagMenu;
2018-03-04 18:41:07 +01:00
2017-09-20 03:47:15 +02:00
// Exported RAM declarations
extern u16 gSpecialVar_ItemId;
2017-11-10 03:48:27 +01:00
2017-09-20 03:47:15 +02:00
// Exported ROM declarations
2020-05-14 10:37:09 +02:00
void CB2_GoToItemDepositMenu(void);
2019-08-06 02:37:09 +02:00
void FavorLadyOpenBagMenu(void);
void QuizLadyOpenBagMenu(void);
2019-11-19 17:36:38 +01:00
void ApprenticeOpenBagMenu(void);
2020-05-14 10:37:09 +02:00
void CB2_BagMenuFromBattle(void);
2018-12-15 19:08:13 +01:00
void SetInitialScrollAndCursorPositions(u8 pocketId);
2019-12-22 01:01:38 +01:00
void CB2_ReturnToBagMenuPocket(void);
2018-03-28 00:33:08 +02:00
void CB2_BagMenuFromStartMenu(void);
2018-12-15 19:08:13 +01:00
u8 GetItemListPosition(u8 pocketId);
2018-10-17 04:47:08 +02:00
bool8 UseRegisteredKeyItemOnField(void);
2018-10-18 19:05:02 +02:00
void CB2_GoToSellMenu(void);
2018-12-13 04:55:39 +01:00
void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *postExitMenuMainCallback2)());
2018-12-24 00:20:38 +01:00
void DoWallyTutorialBagMenu(void);
void ResetBagScrollPositions(void);
2020-08-23 00:20:22 +02:00
void ChooseBerryForMachine(void (*exitCallback)(void));
2019-03-02 04:32:50 +01:00
void CB2_ChooseBerry(void);
2019-12-22 01:01:38 +01:00
void Task_FadeAndCloseBagMenu(u8 taskId);
void BagMenu_YesNo(u8, u8, const struct YesNoFuncTable*);
2019-12-22 01:01:38 +01:00
void BagMenu_InitListsMenu(u8 taskId);
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);
2018-03-28 00:33:08 +02:00
2017-09-20 03:47:15 +02:00
#endif //GUARD_item_menu_H