Changeset 6839 in orxonox.OLD for trunk/src/story_entities/simple_game_menu.cc
- Timestamp:
- Jan 30, 2006, 12:52:08 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/simple_game_menu.cc
r6837 r6839 56 56 this->cameraVector = Vector(50.0, 0.0, 0.0); 57 57 this->menuLayer.push_back(new MenuLayer()); 58 this->menuLayer.push_back(new MenuLayer()); 58 59 this->layerIndex = 0; 59 60 … … 150 151 this->menuSelected = this->menuLayer[0]->menuList[this->menuSelectedIndex]; 151 152 this->menuSelector->setAbsCoor(this->menuSelected->getAbsCoor()); 153 154 155 // loading the storyentities submenu (singleplayer) 156 const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY); 157 std::list<BaseObject*>::const_iterator it; 158 for( it = storyEntities->begin(); it != storyEntities->end(); it++) 159 { 160 StoryEntity* se = dynamic_cast<StoryEntity*>(*it); 161 if( se->isContainedInMenu()) 162 { 163 this->menuLayer[1]->storyList.push_back(se); 164 PRINTF(0)("Got a new menu entry |%s|\n", se->getName()); 165 } 166 } 152 167 } 153 168 … … 217 232 void SimpleGameMenu::process(const Event &event) 218 233 { 234 /* ----------------- LAYER 1 ---------------*/ 219 235 if( this->layerIndex == 0) 220 236 { … … 230 246 //this->stop(); 231 247 // switch to first submenu 232 if( this->menuLayer[1] == NULL)248 if( this->menuLayer[1]->menuList.size() == 0) 233 249 { 234 PRINTF(1)("Haven't got any Story 250 PRINTF(1)("Haven't got any StoryEntities to play!\n"); 235 251 return; 236 252 } … … 257 273 } 258 274 } 259 } 275 } /* ----------------- LAYER 2 ---------------*/ 260 276 else if( this->layerIndex == 1) 261 277 {
Note: See TracChangeset
for help on using the changeset viewer.