OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
menu.h
1#ifndef _MENU_H_
2#define _MENU_H_
3
4// various length defines
5#define MAX_CHOICE_STRING_LEN 32
6#define MAX_TOP_SCREEN_TEXT 32
7#define MAX_CHOICES 10
8#define MAX_LIST_STRINGS 16
9#define MAX_LIST_STRING_LEN 32
10#define MAX_KEYBOARD_TEXT_LEN 32
11#define MAX_EXTRA_TEXT_STRINGS 10
12#define MAX_EXTRA_TEXT_STRING_LEN 32
13
14// options for screens
15#define SCREEN_OPTION_ANIMATED 0x1
16#define SCREEN_OPTION_KEYBOARD 0x2
17#define SCREEN_OPTION_LIST 0x4
18#define SCREEN_OPTION_EXTRAS_CENTERED 0x8
19
20// options for screen choices
21#define CHOICE_OPTION_NEEDS_LIST_SELECTION 0x1
22#define CHOICE_OPTION_DISABLED 0x2
23
24// a single choice on a screen
25typedef struct MenuScreenChoice
26{
27 const char * text;
28 int options;
30
31// an instance of a screen
32typedef struct MenuScreen
33{
34 struct MenuScreenConfiguration * configuration;
35 char extraText[MAX_EXTRA_TEXT_STRINGS][MAX_EXTRA_TEXT_STRING_LEN + 1];
36 char list[MAX_LIST_STRINGS][MAX_LIST_STRING_LEN + 1];
37 int listSelection; // default -1, no selection
38 char keyboardText[MAX_KEYBOARD_TEXT_LEN + 1];
39 int numChoices;
41
42// the static configuration for a screen
44{
45 const char * topScreenText;
46 MenuScreenChoice choices[MAX_CHOICES];
47 void (* initFunc)(void);
48 void (* choseFunc)(const char * choice);
49 void (* thinkFunc)(void);
50 int options;
52
53// call this to start showing a menu, pass in the initial screen to show
54void StartMenuScreen(MenuScreenConfiguration * configuration);
55
56// call this from any of the configuration callback funcs to set the next screen to show
57void SetNextMenuScreen(MenuScreenConfiguration * configuration);
58
59// call this to exit the menu
60void ExitMenu(void);
61
62// gets the current menu screen
63MenuScreen * GetMenuScreen(void);
64
65#endif
Definition menu.h:26
Definition menu.h:44
Definition menu.h:33