Skip to content

Commit

Permalink
Clean up + document menu.c
Browse files Browse the repository at this point in the history
  • Loading branch information
lhearachel committed Oct 26, 2024
1 parent 03f85a6 commit 4b4f4a9
Show file tree
Hide file tree
Showing 4 changed files with 274 additions and 247 deletions.
53 changes: 36 additions & 17 deletions include/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,29 @@
#include "colored_arrow.h"
#include "string_list.h"

#define MENU_DUMMY -3
#define MENU_NOTHING_CHOSEN -1
#define MENU_CANCELED -2
#define MENU_DUMMY -3

enum MenuAction {
MENU_ACTION_NONE = 0,
MENU_ACTION_MOVE_UP,
MENU_ACTION_MOVE_DOWN,
MENU_ACTION_MOVE_LEFT,
MENU_ACTION_MOVE_RIGHT,
};

enum MenuExternalInput {
MENU_INPUT_CONFIRM = 0,
MENU_INPUT_CANCEL,
MENU_INPUT_MOVE_UP,
MENU_INPUT_MOVE_DOWN,
MENU_INPUT_MOVE_LEFT,
MENU_INPUT_MOVE_RIGHT,
};

typedef struct MenuTemplate {
const StringList *choices;
StringList *choices;
Window *window;
u8 fontID;
u8 xSize;
Expand All @@ -33,20 +52,20 @@ typedef struct Menu {
u8 heapID;
} Menu;

Menu *Menu_New(const MenuTemplate *param0, u8 param1, u8 param2, u8 param3, u8 param4, u32 param5);
Menu *Menu_NewAndCopyToVRAM(const MenuTemplate *param0, u8 param1, u8 param2, u8 param3, u8 param4, u32 param5);
Menu *Menu_NewSimple(const MenuTemplate *param0, u8 param1, u8 param2);
void Menu_Free(Menu *param0, u8 *param1);
u32 Menu_ProcessInput(Menu *param0);
u32 Menu_ProcessInputWithSound(Menu *param0, u16 param1);
u32 Menu_ProcessExternalInput(Menu *param0, u8 param1);
u8 Menu_GetCursorPos(Menu *param0);
u8 Menu_GetLastAction(Menu *param0);
Menu *Menu_MakeYesNoChoiceWithCursorAt(BgConfig *param0, const WindowTemplate *param1, u16 param2, u8 param3, u8 param4, u32 param5);
Menu *Menu_MakeYesNoChoice(BgConfig *param0, const WindowTemplate *param1, u16 param2, u8 param3, u32 param4);
u32 Menu_ProcessInputAndHandleExit(Menu *param0, u32 param1);
u32 Menu_ProcessExternalInputAndHandleExit(Menu *param0, u8 param1, u32 param2);
void Menu_DestroyForExit(Menu *param0, u32 param1);
void Menu_DrawCursorBitmap(Window *param0, u32 param1, u32 param2);
Menu *Menu_New(const MenuTemplate *template, u8 xOffset, u8 yOffset, u8 cursorStart, u8 heapID, u32 cancelKeys);
Menu *Menu_NewAndCopyToVRAM(const MenuTemplate *template, u8 xOffset, u8 yOffset, u8 cursorStart, u8 heapID, u32 cancelKeys);
Menu *Menu_NewSimple(const MenuTemplate *template, u8 cursorStart, u8 heapID);
void Menu_Free(Menu *menu, u8 *outCursorPos);
u32 Menu_ProcessInput(Menu *menu);
u32 Menu_ProcessInputWithSound(Menu *menu, u16 sdatID);
u32 Menu_ProcessExternalInput(Menu *menu, u8 input);
u8 Menu_GetCursorPos(Menu *menu);
u8 Menu_GetLastAction(Menu *menu);
Menu *Menu_MakeYesNoChoiceWithCursorAt(BgConfig *bgConfig, const WindowTemplate *winTemplate, u16 borderTileStart, u8 borderPalette, u8 cursorStart, u32 heapID);
Menu *Menu_MakeYesNoChoice(BgConfig *bgConfig, const WindowTemplate *winTemplate, u16 borderTileStart, u8 borderPalette, u32 heapID);
u32 Menu_ProcessInputAndHandleExit(Menu *menu, u32 heapID);
u32 Menu_ProcessExternalInputAndHandleExit(Menu *menu, u8 input, u32 heapID);
void Menu_DestroyForExit(Menu *menu, u32 heapID);
void Window_DrawMenuCursor(Window *window, u32 x, u32 y);

#endif // POKEPLATINUM_MENU_H
Loading

0 comments on commit 4b4f4a9

Please sign in to comment.