2023-12-20 00:07:54 -05:00
|
|
|
#include "menu.h"
|
|
|
|
|
2023-12-21 14:20:00 -05:00
|
|
|
int menu_count = 0;
|
|
|
|
|
|
|
|
int menu_items [MENU_LIMIT];
|
|
|
|
int menu_show [MENU_LIMIT];
|
|
|
|
int menu_alpha [MENU_LIMIT];
|
|
|
|
|
|
|
|
char * menu_text [MENU_LIMIT] [MINIMENU_LIMIT];
|
|
|
|
int menu_icon [MENU_LIMIT] [MINIMENU_LIMIT];
|
|
|
|
void (* menu_action [MENU_LIMIT] [MINIMENU_LIMIT]) (void);
|
|
|
|
|
|
|
|
static void define_minimenu (int menu, char * text, int icon, void (* action) (void)) {
|
2023-12-20 06:52:13 -05:00
|
|
|
menu_text [menu] [menu_items [menu]] = text;
|
|
|
|
menu_icon [menu] [menu_items [menu]] = icon;
|
|
|
|
menu_action [menu] [menu_items [menu]] = action;
|
|
|
|
|
2023-12-21 14:20:00 -05:00
|
|
|
menu_items [menu]++;
|
2023-12-20 06:52:13 -05:00
|
|
|
}
|
|
|
|
|
2023-12-21 14:20:00 -05:00
|
|
|
static void define_menu (int alpha) {
|
2023-12-20 10:24:43 -05:00
|
|
|
menu_items [menu_count] = 0;
|
|
|
|
menu_show [menu_count] = 0;
|
|
|
|
menu_alpha [menu_count] = alpha;
|
|
|
|
|
2023-12-21 14:20:00 -05:00
|
|
|
menu_count++;
|
2023-12-20 10:24:43 -05:00
|
|
|
}
|
|
|
|
|
2023-12-20 00:07:54 -05:00
|
|
|
void menu_configure (void) {
|
|
|
|
int index;
|
|
|
|
|
2023-12-21 14:20:00 -05:00
|
|
|
define_menu (1);
|
|
|
|
define_menu (1);
|
|
|
|
define_menu (1);
|
|
|
|
define_menu (0);
|
2023-12-20 06:52:13 -05:00
|
|
|
|
2023-12-20 00:07:54 -05:00
|
|
|
for (index = 0; index < chad_trait_count; ++index) {
|
2023-12-21 14:20:00 -05:00
|
|
|
define_minimenu (menu_traits, chad_trait_name [index], index, 0);
|
2023-12-20 00:07:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
for (index = 0; index < chad_skill_count; ++index) {
|
2023-12-21 14:20:00 -05:00
|
|
|
define_minimenu (menu_skills, chad_skill_name [index], 3 + index, 0);
|
2023-12-20 00:07:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
for (index = 0; index < chad_value_count; ++index) {
|
2023-12-21 14:20:00 -05:00
|
|
|
define_minimenu (menu_values, chad_value_name [index], 27 + index, 0);
|
2023-12-20 00:07:54 -05:00
|
|
|
}
|
|
|
|
|
2023-12-21 14:20:00 -05:00
|
|
|
define_minimenu (menu_resources, "ABC", 1, 0);
|
|
|
|
define_minimenu (menu_resources, "DEF", 1, 0);
|
|
|
|
define_minimenu (menu_resources, "GHI", 1, 0);
|
2023-12-20 00:07:54 -05:00
|
|
|
}
|