void MenuScreen::refresh_key_menu() { Menu::Titles titles; for(int i=0;i<Keys::NBKEYS;i++) { titles.push_back(Keys::name(Keys::KEY(i))+" PI:"+string(SDL_GetKeyName(Options::player1keys.keys[i]))+" PII:"+string(SDL_GetKeyName(Options::player2keys.keys[i]))); } if(key_menu) delete key_menu; key_menu=new Menu(titles,ttf_path,&ids[20]); }
MenuScreen::MenuScreen(const SpriteCollection *spr_coll,const std::string &ttf_path,TextureIds ids) { this->spr_coll=spr_coll; //main menu Menu::Titles titles; //titles.push_back("human versus cpu"); titles.push_back("Human versus human"); titles.push_back("Survival mode"); titles.push_back("Patterns"); titles.push_back("Options"); titles.push_back("Quit"); main_menu=new Menu(titles,ttf_path,&ids[10]); //option menu titles.clear(); ai_level=NORMAL; titles.push_back("AI Level: Knight"); titles.push_back("Keys"); titles.push_back(Options::soundOn()?"Sound: on":"Sound: off"); titles.push_back("Fullscreen"); titles.push_back("Return"); option_menu=new Menu(titles,ttf_path,&ids[0]); titles.clear(); titles.push_back("select swap PI:a PII:o"); titles.push_back("validate PI:z PII:p"); titles.push_back("up PI:e PII:UP"); titles.push_back("down PI:d PII:DOWN"); titles.push_back("right PI:f PII:RIGHT"); titles.push_back("left PI:s PII:LEFT"); key_menu=new Menu(titles,ttf_path,&ids[20]); menus.push(main_menu); }
MenuScreen::MenuScreen(const SpriteCollection *spr_coll,const string &ttf_path,TextureIds ids) { this->spr_coll=spr_coll; this->ttf_path=ttf_path; this->ids=ids; //main menu Menu::Titles titles; //titles.push_back("human versus cpu"); titles.push_back("Human versus human"); titles.push_back("Survival mode"); titles.push_back("Demo"); titles.push_back("Patterns"); titles.push_back("Options"); titles.push_back("Quit"); main_menu=new Menu(titles,ttf_path,&ids[10]); //option menu titles.clear(); ai_level=NORMAL; titles.push_back("AI Level: Knight"); titles.push_back("Keys"); titles.push_back(Options::soundOn()?"Sound: on":"Sound: off"); titles.push_back(Options::fullscreenOn()?"Fullscreen":"Windowed"); titles.push_back("Return"); option_menu=new Menu(titles,ttf_path,&ids[0]); key_menu=NULL; refresh_key_menu(); menus.push(main_menu); }