summaryrefslogtreecommitdiff
path: root/include/list_menu.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/list_menu.h')
-rw-r--r--include/list_menu.h121
1 files changed, 92 insertions, 29 deletions
diff --git a/include/list_menu.h b/include/list_menu.h
index 0249b06af..d38980213 100644
--- a/include/list_menu.h
+++ b/include/list_menu.h
@@ -1,56 +1,119 @@
#ifndef GUARD_LIST_MENU_H
#define GUARD_LIST_MENU_H
-// Exported type declarations
+#define LIST_NOTHING_CHOSEN -1
+#define LIST_B_PRESSED -2
+#define LIST_HEADER -3
-// Exported RAM declarations
+#define LIST_NO_MULTIPLE_SCROLL 0
+#define LIST_MULTIPLE_SCROLL_DPAD 1
+#define LIST_MULTIPLE_SCROLL_L_R 2
-struct ListMenuItem
-{
- const u8 *unk_00;
- s32 unk_04;
+enum {
+ SCROLL_ARROW_LEFT,
+ SCROLL_ARROW_RIGHT,
+ SCROLL_ARROW_UP,
+ SCROLL_ARROW_DOWN
};
struct ListMenu;
+struct ListMenuItem
+{
+ const u8 *name;
+ s32 id;
+};
+
struct ListMenuTemplate
{
const struct ListMenuItem *items;
- void (* unk_04)(u32, bool8, struct ListMenu *);
- void (* unk_08)(u8, s32, u8);
+ void (* moveCursorFunc)(s32 itemIndex, bool8 onInit, struct ListMenu *list);
+ void (* itemPrintFunc)(u8 windowId, s32 itemId, u8 y);
u16 totalItems;
u16 maxShowed;
- u8 unk_10;
- u8 unk_11;
- u8 unk_12;
- u8 cursor_Y;
- u32 upText_Y:4; // x1, x2, x4, x8 = xF
- u32 cursorColor:4; // x10, x20, x40, x80 = xF0
- u32 fillColor:4; // x100, x200, x400, x800 = xF00
- u32 cursorShadowColor:4; // x1000, x2000, x4000, x8000 = xF000
- u32 unk_16_0:1; // x10000
- u32 spaceBetweenItems:6; // x20000, x40000, x80000, x100000, x200000, x400000 = x7E0000
- u32 unk_16_7:1; // x800000
- u32 unk_17_0:6; // x1000000, x2000000, x4000000, x8000000, x10000000, x20000000 = x3F000000
+ u8 windowId;
+ u8 header_X;
+ u8 item_X;
+ u8 cursor_X;
+ u8 upText_Y:4; // x1, x2, x4, x8 = xF
+ u8 cursorPal:4; // x10, x20, x40, x80 = xF0
+ u8 fillValue:4; // x1, x2, x4, x8 = xF
+ u8 cursorShadowPal:4; // x10, x20, x40, x80 = xF0
+ u8 lettersSpacing:3;
+ u8 itemVerticalPadding:3;
+ u8 scrollMultiple:2; // x40, x80 = xC0
+ u8 fontId:6; // x1, x2, x4, x8, x10, x20 = x3F
+ u8 cursorKind:2; // x40, x80
};
-struct ListMenu {
- struct ListMenuTemplate _template;
+struct ListMenu
+{
+ struct ListMenuTemplate template;
u16 scrollOffset;
u16 selectedRow;
u8 unk_1C;
u8 unk_1D;
- u8 unk_1E;
+ u8 taskId;
u8 unk_1F;
};
-extern struct ListMenuTemplate gUnknown_03006310;
+struct ListMenuWindowRect
+{
+ u8 x;
+ u8 y;
+ u8 width;
+ u8 height;
+ u8 palNum;
+};
+
+struct ScrollArrowsTemplate
+{
+ u8 firstArrowType;
+ u8 firstX;
+ u8 firstY;
+ u8 secondArrowType;
+ u8 secondX;
+ u8 secondY;
+ u16 fullyUpThreshold;
+ u16 fullyDownThreshold;
+ u16 tileTag;
+ u16 palTag;
+ u8 palNum;
+};
+
+struct CursorStruct
+{
+ u8 left;
+ u8 top;
+ u16 rowWidth;
+ u16 rowHeight;
+ u16 tileTag;
+ u16 palTag;
+ u8 palNum;
+};
-// Exported ROM declarations
+extern struct ScrollArrowsTemplate gTempScrollArrowTemplate;
+extern struct ListMenuTemplate gMultiuseListMenuTemplate;
-u8 ListMenuInit(struct ListMenuTemplate *template, u16 a1, u16 a2);
-s32 ListMenuHandleInput(u8 id);
-void get_coro_args_x18_x1A(u8 a0, u16 *a1, u16 *a2);
-void sub_81AE6C8(u8 a0, u16 *a1, u16 *a2);
+s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum);
+u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow);
+u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *arg1, u16 scrollOffset, u16 selectedRow);
+s32 ListMenuHandleInputGetItemId(u8 listTaskId);
+void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow);
+void RedrawListMenu(u8 listTaskId);
+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);
+u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId);
+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);
+void RemoveScrollIndicatorArrowPair(u8 taskId);
+void Task_ScrollIndicatorArrowPairOnMainMenu(u8 taskId);
#endif //GUARD_LIST_MENU_H