funccall::funccall() // calls other functions... { intro(); wel(); pass(); mmenu(); }
void command_executor::show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool /*context_menu*/, display& gui) { std::vector<std::string> items = items_arg; if (items.empty()) return; std::vector<config> menu = get_menu_images(gui, items); int res = -1; { SDL_Rect pos = {xloc, yloc, 1, 1}; gui2::tdrop_down_list mmenu(pos, menu, -1, false); mmenu.show(gui.video()); if(mmenu.get_retval() == gui2::twindow::OK) { res = mmenu.selected_item(); } } // This will kill the dialog. if (res < 0 || size_t(res) >= items.size()) return; const theme::menu* submenu = gui.get_theme().get_menu_item(items[res]); if (submenu) { int y,x; SDL_GetMouseState(&x,&y); this->show_menu(submenu->items(), x, y, submenu->is_context(), gui); } else { const hotkey::hotkey_command& cmd = hotkey::get_hotkey_command(items[res]); hotkey::execute_command(cmd,this,res); set_button_state(); } }