umorna/source/menu.c

53 lines
1.3 KiB
C
Raw Normal View History

#include "menu.h"
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;
menu_items [menu]++;
2023-12-20 06:52:13 -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;
menu_count++;
2023-12-20 10:24:43 -05:00
}
void menu_configure (void) {
int index;
define_menu (1);
define_menu (1);
define_menu (1);
define_menu (0);
2023-12-20 06:52:13 -05:00
for (index = 0; index < chad_trait_count; ++index) {
define_minimenu (menu_traits, chad_trait_name [index], index, 0);
}
for (index = 0; index < chad_skill_count; ++index) {
define_minimenu (menu_skills, chad_skill_name [index], 3 + index, 0);
}
for (index = 0; index < chad_value_count; ++index) {
define_minimenu (menu_values, chad_value_name [index], 27 + index, 0);
}
define_minimenu (menu_resources, "ABC", 1, 0);
define_minimenu (menu_resources, "DEF", 1, 0);
define_minimenu (menu_resources, "GHI", 1, 0);
}