2017-10-22 22:55:07 +00:00
|
|
|
#ifndef GUARD_LIST_MENU_H
|
|
|
|
#define GUARD_LIST_MENU_H
|
|
|
|
|
2018-08-12 19:54:07 +00:00
|
|
|
#include "window.h"
|
|
|
|
|
2017-12-15 23:08:23 +00:00
|
|
|
#define LIST_NOTHING_CHOSEN -1
|
|
|
|
#define LIST_B_PRESSED -2
|
2018-07-15 11:23:38 +00:00
|
|
|
#define LIST_HEADER -3
|
2017-12-15 23:08:23 +00:00
|
|
|
|
2018-03-02 15:34:31 +00:00
|
|
|
#define LIST_NO_MULTIPLE_SCROLL 0
|
|
|
|
#define LIST_MULTIPLE_SCROLL_DPAD 1
|
|
|
|
#define LIST_MULTIPLE_SCROLL_L_R 2
|
|
|
|
|
2018-08-30 13:01:07 +00:00
|
|
|
enum
|
|
|
|
{
|
2018-07-15 11:23:38 +00:00
|
|
|
SCROLL_ARROW_LEFT,
|
|
|
|
SCROLL_ARROW_RIGHT,
|
|
|
|
SCROLL_ARROW_UP,
|
|
|
|
SCROLL_ARROW_DOWN
|
|
|
|
};
|
|
|
|
|
2018-03-03 13:58:41 +00:00
|
|
|
struct ListMenu;
|
2017-10-22 22:55:07 +00:00
|
|
|
|
2017-11-15 21:12:18 +00:00
|
|
|
struct ListMenuItem
|
|
|
|
{
|
2017-12-15 23:08:23 +00:00
|
|
|
const u8 *name;
|
|
|
|
s32 id;
|
2017-10-22 22:55:07 +00:00
|
|
|
};
|
|
|
|
|
2017-11-15 21:12:18 +00:00
|
|
|
struct ListMenuTemplate
|
|
|
|
{
|
|
|
|
const struct ListMenuItem *items;
|
2018-07-15 11:23:38 +00:00
|
|
|
void (* moveCursorFunc)(s32 itemIndex, bool8 onInit, struct ListMenu *list);
|
|
|
|
void (* itemPrintFunc)(u8 windowId, s32 itemId, u8 y);
|
2017-11-15 21:12:18 +00:00
|
|
|
u16 totalItems;
|
|
|
|
u16 maxShowed;
|
2018-03-02 15:34:31 +00:00
|
|
|
u8 windowId;
|
2018-07-15 11:23:38 +00:00
|
|
|
u8 header_X;
|
|
|
|
u8 item_X;
|
2018-03-03 13:58:41 +00:00
|
|
|
u8 cursor_X;
|
2018-03-02 15:34:31 +00:00
|
|
|
u8 upText_Y:4; // x1, x2, x4, x8 = xF
|
|
|
|
u8 cursorPal:4; // x10, x20, x40, x80 = xF0
|
2018-03-03 13:58:41 +00:00
|
|
|
u8 fillValue:4; // x1, x2, x4, x8 = xF
|
2018-03-02 15:34:31 +00:00
|
|
|
u8 cursorShadowPal:4; // x10, x20, x40, x80 = xF0
|
|
|
|
u8 lettersSpacing:3;
|
2018-07-15 11:23:38 +00:00
|
|
|
u8 itemVerticalPadding:3;
|
2018-03-02 15:34:31 +00:00
|
|
|
u8 scrollMultiple:2; // x40, x80 = xC0
|
|
|
|
u8 fontId:6; // x1, x2, x4, x8, x10, x20 = x3F
|
|
|
|
u8 cursorKind:2; // x40, x80
|
2017-10-22 22:55:07 +00:00
|
|
|
};
|
|
|
|
|
2017-12-15 23:08:23 +00:00
|
|
|
struct ListMenu
|
|
|
|
{
|
2018-03-02 15:34:31 +00:00
|
|
|
struct ListMenuTemplate template;
|
2017-10-22 22:55:07 +00:00
|
|
|
u16 scrollOffset;
|
|
|
|
u16 selectedRow;
|
|
|
|
u8 unk_1C;
|
|
|
|
u8 unk_1D;
|
2018-07-15 11:23:38 +00:00
|
|
|
u8 taskId;
|
2017-10-22 22:55:07 +00:00
|
|
|
u8 unk_1F;
|
|
|
|
};
|
|
|
|
|
2018-07-15 11:23:38 +00:00
|
|
|
struct ListMenuWindowRect
|
2018-03-03 13:58:41 +00:00
|
|
|
{
|
|
|
|
u8 x;
|
|
|
|
u8 y;
|
|
|
|
u8 width;
|
|
|
|
u8 height;
|
|
|
|
u8 palNum;
|
|
|
|
};
|
2017-10-22 22:55:07 +00:00
|
|
|
|
2018-07-15 11:23:38 +00:00
|
|
|
struct ScrollArrowsTemplate
|
2018-05-19 09:36:31 +00:00
|
|
|
{
|
2018-07-15 11:23:38 +00:00
|
|
|
u8 firstArrowType;
|
|
|
|
u8 firstX;
|
|
|
|
u8 firstY;
|
|
|
|
u8 secondArrowType;
|
|
|
|
u8 secondX;
|
|
|
|
u8 secondY;
|
|
|
|
u16 fullyUpThreshold;
|
|
|
|
u16 fullyDownThreshold;
|
2018-05-19 09:36:31 +00:00
|
|
|
u16 tileTag;
|
|
|
|
u16 palTag;
|
|
|
|
u8 palNum;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CursorStruct
|
|
|
|
{
|
2018-07-15 11:23:38 +00:00
|
|
|
u8 left;
|
|
|
|
u8 top;
|
|
|
|
u16 rowWidth;
|
|
|
|
u16 rowHeight;
|
2018-05-19 09:36:31 +00:00
|
|
|
u16 tileTag;
|
|
|
|
u16 palTag;
|
|
|
|
u8 palNum;
|
|
|
|
};
|
|
|
|
|
2018-07-15 11:23:38 +00:00
|
|
|
extern struct ScrollArrowsTemplate gTempScrollArrowTemplate;
|
2018-03-03 13:58:41 +00:00
|
|
|
extern struct ListMenuTemplate gMultiuseListMenuTemplate;
|
2017-10-22 22:55:07 +00:00
|
|
|
|
2018-03-03 13:58:41 +00:00
|
|
|
s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum);
|
|
|
|
u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow);
|
2018-07-15 11:23:38 +00:00
|
|
|
u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *arg1, u16 scrollOffset, u16 selectedRow);
|
2019-02-02 10:04:38 +00:00
|
|
|
s32 ListMenu_ProcessInput(u8 listTaskId);
|
2018-03-02 15:34:31 +00:00
|
|
|
void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow);
|
2018-07-15 11:23:38 +00:00
|
|
|
void RedrawListMenu(u8 listTaskId);
|
2018-03-03 13:58:41 +00:00
|
|
|
void ChangeListMenuPals(u8 listTaskId, u8 cursorPal, u8 fillValue, u8 cursorShadowPal);
|
|
|
|
void ChangeListMenuCoords(u8 listTaskId, u8 x, u8 y);
|
|
|
|
s32 ListMenuTestInput(struct ListMenuTemplate *template, u32 scrollOffset, u32 selectedRow, u16 keys, u16 *newScrollOffset, u16 *newSelectedRow);
|
|
|
|
void ListMenuGetCurrentItemArrayId(u8 listTaskId, u16 *arrayId);
|
|
|
|
void ListMenuGetScrollAndRow(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow);
|
2018-03-02 15:34:31 +00:00
|
|
|
u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId);
|
2018-07-15 11:23:38 +00:00
|
|
|
void ListMenuOverrideSetColors(u8 cursorPal, u8 fillValue, u8 cursorShadowPal);
|
|
|
|
void ListMenuDefaultCursorMoveFunc(s32 arg0, u8 arg1, struct ListMenu *list);
|
|
|
|
s32 ListMenuGetUnkIndicatorsStructFields(u8 taskId, u8 field);
|
|
|
|
void ListMenuSetUnkIndicatorsStructField(u8 taskId, u8 field, s32 value);
|
|
|
|
u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate *arrowInfo, u16 *arg1);
|
|
|
|
u8 AddScrollIndicatorArrowPairParameterized(u32 arrowType, s32 commonPos, s32 firstPos, s32 secondPos, s32 fullyDownThreshold, s32 tileTag, s32 palTag, u16 *currItemPtr);
|
2018-05-19 09:36:31 +00:00
|
|
|
void RemoveScrollIndicatorArrowPair(u8 taskId);
|
|
|
|
void Task_ScrollIndicatorArrowPairOnMainMenu(u8 taskId);
|
2017-10-22 22:55:07 +00:00
|
|
|
|
|
|
|
#endif //GUARD_LIST_MENU_H
|