- Timestamp:
- Jan 30, 2006, 11:03:30 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/campaign.cc
r6862 r6874 40 40 assert( root != NULL); 41 41 42 this->bReturnToMenu = false; 43 42 44 this->campaignData = new CampaignData(root); 43 45 this->loadParams(root); … … 77 79 78 80 this->isRunning = true; 81 this->bReturnToMenu = false; 79 82 this->run(); 80 83 } … … 106 109 { 107 110 PRINTF(4)("Stopping the current Campaign\n"); 108 //this->isRunning = false;111 this->bReturnToMenu = true; 109 112 if( this->currentEntity != NULL) 110 113 { 111 this->currentEntity->setNextStoryID(0);112 114 this->currentEntity->stop(); 113 115 } … … 129 131 PRINTF(0)("Campaign is starting StoryEntity nr:%i\n", this->currentEntity->getStoryID()); 130 132 133 // check if return to menu 134 if( this->bReturnToMenu) 135 { 136 this->currentEntity = this->campaignData->getLevel(WORLD_ID_MENU); 137 this->bReturnToMenu = false; 138 } 139 140 this->campaignData->setCurrentEntity(this->currentEntity); 141 131 142 this->currentEntity->init(); 132 133 143 this->currentEntity->loadData(); 134 144 this->currentEntity->start(); 135 145 this->currentEntity->unloadData(); 136 146 } 137 PRINTF(2)("There is no StoryEnity left to play, returning to Main Menu\n");147 PRINTF(2)("There is no StoryEnity left to play, quitting game\n"); 138 148 } 139 149 -
trunk/src/story_entities/campaign.h
r6512 r6874 37 37 StoryEntity* currentEntity; //!< reference to the current StoryEntity 38 38 CampaignData* campaignData; //!< reference to the CampaignData 39 40 bool bReturnToMenu; //!< is true, if the StoryEntity should return to the Mainmenu after termination 39 41 }; 40 42 -
trunk/src/story_entities/campaign_data.cc
r6834 r6874 139 139 140 140 141 /** 142 * @param storyID the story ID to look for 143 * @returns a pointer to a StoryEntity with the storyID 144 */ 145 StoryEntity* CampaignData::getLevel(int storyID) 146 { 147 list<StoryEntity*>::iterator it; 148 for( it = this->storyEntities.begin(); it != this->storyEntities.end(); it++) 149 { 150 if( storyID == (*it)->getStoryID()) 151 return (*it); 152 } 153 return NULL; 154 } 141 155 142 -
trunk/src/story_entities/campaign_data.h
r6512 r6874 29 29 StoryEntity* getFirstLevel(); 30 30 StoryEntity* getNextLevel(); 31 StoryEntity* getLevel(int storyID); 32 33 /** @param storyEntity the current entity to be set */ 34 inline void setCurrentEntity(StoryEntity* storyEntity) { this->currentEntity = storyEntity; } 35 /** @return the current StoryEntity played*/ 36 inline StoryEntity* getCurrentEntity() { return this->currentEntity; } 31 37 32 38 -
trunk/src/story_entities/simple_game_menu.cc
r6862 r6874 198 198 { 199 199 this->menuLayer[1]->storyList.push_back(se); 200 PRINTF(0)("Got a new menu entry |%s|\n", se->getName()); 200 201 // generating menu item 201 202 ImageEntity* ie = new ImageEntity(); 202 PRINTF(0)("setting texture to: |%s|\n", se->getMenuItemImage());203 203 ie->setTexture(se->getMenuItemImage()); 204 204 ie->setRelCoor(0.0f,20.0f - (this->menuLayer[1]->menuList.size() * 10.0f), 0.0f); 205 205 ie->setVisibility(false); 206 206 this->menuLayer[1]->menuList.push_back(ie); 207 208 // generating screenshoot item 209 // ie = new ImageEntity(); 210 // ie->setTexture(se->getMenuScreenshoot); 211 // ie->setRelCoor(.0f, 10.0f, 0.0f); 212 // this->menuLayer[1]->screenshootList.push_back(ie); 213 207 214 } 208 215 } -
trunk/src/story_entities/simple_game_menu.h
r6862 r6874 31 31 std::vector<ImageEntity*> menuList; //!< the list of the menu items 32 32 std::vector<StoryEntity*> storyList; //!< the list of the StoryEntities for the menu 33 std::vector<ImageEntity*> screenshootList; //!< list of the screen shoots FIXME: make a better structure for this stuff 33 34 }; 34 35 -
trunk/src/story_entities/story_def.h
r4597 r6874 12 12 #define DEBUG_WORLD_2 102 13 13 14 14 15 #define WORLD_ID_0 0 15 16 #define WORLD_ID_1 1 … … 18 19 #define WORLD_ID_4 4 19 20 #define WORLD_ID_5 5 21 22 #define WORLD_ID_MENU 0 20 23 #define WORLD_ID_GAMEEND 999 21 24 -
trunk/src/util/state.cc
r6695 r6874 43 43 bool State::bOnline = false; 44 44 45 bool State::bMenuMode = false; 46 47 45 48 /** 46 49 * sets camera and target of the current Camera -
trunk/src/util/state.h
r6695 r6874 82 82 83 83 84 //////////// 85 /// Menu /// 86 //////////// 87 /** sets the menu mode @param mode true if always exit to menu */ 88 static inline void setMenuMode(bool mode) { State::bMenuMode = mode; } 89 /** @returns the menu mode */ 90 static inline bool getMenuMode() { return State::bMenuMode;} 91 92 93 84 94 private: 85 95 State(); … … 97 107 98 108 static bool bOnline; //!< Is true if this node is in multiplayer mode (via network) 109 static bool bMenuMode; //!< True is orxonox is player in the menu mode (always returning to the menu after exit) 99 110 100 111 };
Note: See TracChangeset
for help on using the changeset viewer.