Changeset 8677 in orxonox.OLD for branches/gui/src/story_entities/game_menu.cc
- Timestamp:
- Jun 21, 2006, 4:49:06 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/story_entities/game_menu.cc
r8674 r8677 68 68 69 69 State::setMenuID(this->getNextStoryID()); 70 }71 72 /// HACK only for testing.73 void GameMenu::enterGui()74 {75 70 } 76 71 … … 126 121 GraphicsEngine::getInstance()->displayFPS(false); 127 122 123 return ErrorMessage(); 128 124 } 129 125 … … 134 130 ErrorMessage GameMenu::loadData() 135 131 { 136 this->mainMenuBox = new OrxGui::GLGuiBox(); 132 this->mainMenuBox = NULL; 133 134 this->levelsBox = NULL; 135 this->networkBox = NULL; 136 137 this->optionsBox = NULL; 138 this->audioBox = NULL; 139 this->videoBox = NULL; 140 this->controlBox = NULL; 141 this->levelsBox = NULL; 142 143 return GameWorld::loadData(); 144 } 145 146 147 void GameMenu::showMainMenu() 148 { 149 if (mainMenuBox == NULL) 137 150 { 138 OrxGui::GLGuiButton* startButton = new OrxGui::GLGuiPushButton("Play"); 139 this->mainMenuBox->pack(startButton); 140 141 142 OrxGui::GLGuiButton* quitButton = new OrxGui::GLGuiPushButton("Quit"); 143 this->mainMenuBox->pack(quitButton); 144 quitButton->connect(SIGNAL(quitButton, released), this, SLOT(GameMenu, quitMenu)); 145 146 151 this->mainMenuBox = new OrxGui::GLGuiBox(); 152 { 153 OrxGui::GLGuiButton* startButton = new OrxGui::GLGuiPushButton("Play"); 154 startButton->connect(SIGNAL(startButton, released), this, SLOT(GameMenu, showCampaigns)); 155 this->mainMenuBox->pack(startButton); 156 157 OrxGui::GLGuiButton* networkButton = new OrxGui::GLGuiPushButton("MultiPlayer"); 158 networkButton->connect(SIGNAL(networkButton, released), this, SLOT(GameMenu, showMultiPlayer)); 159 this->mainMenuBox->pack(networkButton); 160 161 OrxGui::GLGuiButton* optionsButton = new OrxGui::GLGuiPushButton("Options"); 162 optionsButton->connect(SIGNAL(optionsButton, released), this, SLOT(GameMenu, showOptionsMenu)); 163 this->mainMenuBox->pack(optionsButton); 164 165 166 OrxGui::GLGuiButton* quitButton = new OrxGui::GLGuiPushButton("Quit"); 167 this->mainMenuBox->pack(quitButton); 168 quitButton->connect(SIGNAL(quitButton, released), this, SLOT(GameMenu, quitMenu)); 169 } 147 170 } 148 149 150 GameWorld::loadData(); 151 } 171 this->mainMenuBox->showAll(); 172 173 this->mainMenuBox->setRelCoor2D(200, 100); 174 } 175 176 void GameMenu::showCampaigns() 177 { 178 179 if (this->levelsBox == NULL) 180 { 181 this->levelsBox = new OrxGui::GLGuiBox(); 182 { 183 const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY); 184 std::list<BaseObject*>::const_iterator it; 185 for( it = storyEntities->begin(); it != storyEntities->end(); it++) 186 { 187 StoryEntity* se = dynamic_cast<StoryEntity*>(*it); 188 if( se->isContainedInMenu()) 189 { 190 OrxGui::GLGuiWidget* button = new OrxGui::GLGuiPushButton(se->getName()); 191 levelsBox->pack(button); 192 193 // generating screenshoot item 194 /* 195 ImageEntity* ie = new ImageEntity(); 196 ie->setVisibility(false); 197 ie->setBindNode((const PNode*)NULL); 198 ie->setTexture(se->getMenuScreenshoot()); 199 ie->setRelCoor2D(State::getResX() / 2.0f + 250.0f, State::getResY() / 2.0f); 200 ie->setSize2D(140.0f, 105.0f); 201 this->menuLayers[1].screenshootList.push_back(ie); 202 */ 203 } 204 } 205 } 206 } 207 208 this->levelsBox->showAll(); 209 this->levelsBox->setRelCoor2D(200, 100); 210 this->mainMenuBox->setRelCoorSoft2D(50, 100, 5); 211 212 } 213 214 void GameMenu::showMultiPlayer() 215 { 216 217 } 218 219 void GameMenu::showOptionsMenu() 220 { 221 if (this->optionsBox == NULL) 222 { 223 this->optionsBox = new OrxGui::GLGuiBox(); 224 { 225 OrxGui::GLGuiButton* generalButton = new OrxGui::GLGuiPushButton("General"); 226 optionsBox->pack(generalButton); 227 228 OrxGui::GLGuiButton* audioButton = new OrxGui::GLGuiPushButton("Audio"); 229 optionsBox->pack(audioButton); 230 231 OrxGui::GLGuiButton* videoButton = new OrxGui::GLGuiPushButton("Video"); 232 optionsBox->pack(videoButton); 233 234 OrxGui::GLGuiButton* controlButton = new OrxGui::GLGuiPushButton("Control"); 235 optionsBox->pack(controlButton); 236 237 238 // for (unsigned int i = 0; i < 239 //OrxGui::GLGuiButton* 240 241 } 242 } 243 this->optionsBox->showAll(); 244 this->optionsBox->setRelCoor2D(200, 100); 245 246 this->mainMenuBox->setRelCoorSoft2D(50, 100, 5); 247 248 } 249 250 251 252 253 254 255 256 257 152 258 153 259 /** … … 164 270 this->unsubscribeEvents(ES_MENU); 165 271 166 GameWorld::unloadData();272 return GameWorld::unloadData(); 167 273 } 168 274 … … 175 281 EventHandler::getInstance()->pushState(ES_MENU); 176 282 177 this-> mainMenuBox->showAll();283 this->showMainMenu(); 178 284 179 285 /* now call the underlying*/ 180 GameWorld::start();286 return GameWorld::start(); 181 287 } 182 288 … … 191 297 192 298 /* now call the underlying*/ 193 GameWorld::stop();299 return GameWorld::stop(); 194 300 } 195 301 … … 276 382 { 277 383 /* call underlying function */ 278 GameWorldData::init();384 return GameWorldData::init(); 279 385 } 280 386 … … 287 393 { 288 394 /* call underlying function */ 289 GameWorldData::loadGUI(root);395 return GameWorldData::loadGUI(root); 290 396 } 291 397 … … 297 403 { 298 404 /* call underlying function */ 299 GameWorldData::unloadGUI();405 return GameWorldData::unloadGUI(); 300 406 } 301 407 … … 307 413 ErrorMessage GameMenuData::loadWorldEntities(const TiXmlElement* root) 308 414 { 309 GameWorldData::loadWorldEntities(root);415 return GameWorldData::loadWorldEntities(root); 310 416 } 311 417 … … 317 423 { 318 424 /* call underlying function */ 319 GameWorldData::unloadWorldEntities();425 return GameWorldData::unloadWorldEntities(); 320 426 } 321 427 … … 328 434 { 329 435 /* call underlying function */ 330 GameWorldData::loadScene(root);436 return GameWorldData::loadScene(root); 331 437 } 332 438 … … 338 444 { 339 445 /* call underlying function */ 340 GameWorldData::unloadScene();341 } 342 343 344 446 return GameWorldData::unloadScene(); 447 } 448 449 450
Note: See TracChangeset
for help on using the changeset viewer.