ScoreMenu::ScoreMenu(SMenuConfig* menuConfig) : title("Score de la partie", TITLEFONT, 100), winner("Le joueur i a gagne !", TEXTFONT, 170), back("Retour au menu", 550, MAINMENU), menuConfig(menuConfig) { ISkin* skin = PolyBomberApp::getISkin(); title.setColor(skin->getColor(TITLECOLOR)); winner.setColor(skin->getColor(TEXTCOLOR)); back.setSelected(true); this->widgets.push_back(&title); this->widgets.push_back(&winner); this->widgets.push_back(&back); for (int i=0; i<4; i++) { this->pictures[i] = new ImageWidget(); this->pictures[i]->setPosition(300, 250 + 60*i); this->pictures[i]->setImage(skin->loadImage((EImage)(PLAYER1 + i))); this->names[i] = new TextWidget("", TEXTFONT, 250 + 60*i); this->names[i]->setColor(skin->getColor(TEXTCOLOR)); this->widgets.push_back(this->pictures[i]); this->widgets.push_back(this->names[i]); } }
void GameOptionsMenu::initBonus() { ISkin* skin = PolyBomberApp::getISkin(); EImage icones[18] = {EIMAGE_BOMBPLUS, EIMAGE_BOMBMOINS, EIMAGE_RANGEPLUS, EIMAGE_RANGEMOINS, EIMAGE_RANGEMAX, EIMAGE_MINEBONUS, EIMAGE_INFINITY, EIMAGE_ATOMIC, EIMAGE_VITESSEPLUS, EIMAGE_VITESSEMOINS, EIMAGE_BOMBLINE, EIMAGE_REMOTEBONUS, EIMAGE_CRANE, EIMAGE_HELL, EIMAGE_CONFUSION, EIMAGE_SPASME, EIMAGE_DILATATION, EIMAGE_RAGE}; int i; for (i=0; i<18; i++) { int j = i; if (i >= 12) j -= 12; else if (i >= 8) j -= 8; this->images[i] = new ImageWidget(); this->images[i]->setImage(skin->loadImage(icones[i])); this->images[i]->setPosition(300,200+40*j); this->bonus[i] = new SelectionWidget(TEXTFONT, 200 + 40*j); this->bonus[i]->push_back("0"); this->bonus[i]->push_back("1"); this->bonus[i]->push_back("2"); this->bonus[i]->push_back("3"); this->bonus[i]->push_back("4"); this->bonus[i]->push_back("5"); this->bonus[i]->push_back("6"); this->bonus[i]->push_back("7"); this->bonus[i]->push_back("8"); this->bonus[i]->push_back("9"); this->bonus[i]->push_back("10"); this->bonus[i]->setCurrentItem(this->menuConfig->gameConfig.nbBonus[i]); this->bonus[i]->move(70, 0); if (j > 0) this->bonus[i]->setPrevious(this->bonus[i-1]); else this->bonus[i]->setPrevious(&category); this->widgets.push_back(this->images[i]); this->widgets.push_back(this->bonus[i]); } for (i=0; i<7; i++) this->bonus[i]->setNext(this->bonus[i+1]); for (i=8; i<11; i++) this->bonus[i]->setNext(this->bonus[i+1]); for (i=12; i<17; i++) this->bonus[i]->setNext(this->bonus[i+1]); this->bonus[7]->setNext(&cancel); this->bonus[11]->setNext(&cancel); this->bonus[17]->setNext(&cancel); setCategory(); }
WaitingMenu::WaitingMenu(SMenuConfig* menuConfig) : title("Resume de la partie", TITLEFONT, 50), ip("Adresse IP du serveur : ", TEXTFONT, 150), cancel("Annuler", 500, GAMEMENU), start("Jouer !", 500, RUNGAME), menuConfig(menuConfig) { ISkin* skin = PolyBomberApp::getISkin(); title.setColor(skin->getColor(TITLECOLOR)); ip.setColor(skin->getColor(TEXTCOLOR)); this->network = PolyBomberApp::getINetworkToMenu(); ip.setString(ip.getString() + this->network->getIpAddress()); ip.move(-80, 0); cancel.move(-100, 0); start.move(100, 0); cancel.setSelected(true); cancel.setNext(&start); start.setNext(&cancel); this->widgets.push_back(&title); this->widgets.push_back(&ip); this->widgets.push_back(&cancel); this->widgets.push_back(&start); for (int i=0; i<4; i++) { this->pictures[i] = new ImageWidget(); this->pictures[i]->setPosition(300, 200 + 60*i); this->pictures[i]->setImage(skin->loadImage((EImage)(PLAYER1 + i))); this->names[i] = new TextWidget("...", TEXTFONT, 210 + 60*i); this->names[i]->setColor(skin->getColor(TEXTCOLOR)); this->names[i]->move(100, 0); this->widgets.push_back(this->pictures[i]); this->widgets.push_back(this->names[i]); } }
IMenuScreen::IMenuScreen() { ISkin* skin = PolyBomberApp::getISkin(); background.setImage(skin->loadImage(MENU_BACKGROUND)); this->widgets.push_back(&background); }