#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)) { menu_text [menu] [menu_items [menu]] = text; menu_icon [menu] [menu_items [menu]] = icon; menu_action [menu] [menu_items [menu]] = action; menu_items [menu]++; } static void define_menu (int alpha) { menu_items [menu_count] = 0; menu_show [menu_count] = 0; menu_alpha [menu_count] = alpha; menu_count++; } void menu_configure (void) { int index; define_menu (1); define_menu (1); define_menu (1); define_menu (0); 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); }