Changeset 11191 for code/branches
- Timestamp:
- May 19, 2016, 5:37:05 PM (9 years ago)
- Location:
- code/branches/bindermFS16
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/bindermFS16/data/gui/scripts/CampaignMenu.lua
r11186 r11191 17 17 P.updateButton(7, winMgr:getWindow("orxonox/Mission8Button")) 18 18 P.updateButton(8, winMgr:getWindow("orxonox/Mission9Button")) 19 end 19 20 20 21 -- if (P.getIndexOfLastFinishedMission() == orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() - 1) then22 -- local label = winMgr:getWindow("orxonox/CampaignMenuCongratulation")23 -- label:setProperty("Visible","True")24 -- end25 end26 21 27 22 function P.updateButton(index, button) … … 46 41 end 47 42 end 48 49 --function P.shouldDisplayButton(index)50 -- local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions()51 -- return index < size52 --end53 54 --function P.shouldActivateButton(index) --checks if button should be activated or not55 -- return index <= P.getIndexOfLastFinishedMission() + 156 --end57 43 58 44 function P.getIndexOfLastFinishedMission() -
code/branches/bindermFS16/src/orxonox/CMakeLists.txt
r11186 r11191 62 62 LevelInfo.h 63 63 LevelManager.h 64 LevelStatus.h65 64 MoodManager.h 66 65 controllers/HumanController.h -
code/branches/bindermFS16/src/orxonox/LevelManager.cc
r11188 r11191 99 99 void LevelManager::setConfigValues() 100 100 { 101 101 102 SetConfigValue(defaultLevelName_, "missionOne.oxw") 102 103 .description("Sets the pre selection of the level in the main menu."); … … 105 106 SetConfigValue(campaignMissions_, std::vector<std::string>()) 106 107 .description("The list of missions in the campaign"); 107 // SetConfigValue(test_, std::vector<int>())108 // .description("The list of missions and their statuses");109 108 //std::vector<int> v (allLevelStatus_.size(),0); 109 //SetConfigValue(allLevelWon_, v) 110 // .description("The list of all won missions"); 110 111 } 111 112 … … 185 186 void LevelManager::activateNextLevel() 186 187 { 188 187 189 if (this->levels_.size() > 0) 188 190 { … … 358 360 allLevelStatus_[i].activated=1; 359 361 std::vector<int> nextLevels=allLevelStatus_[i].nextLevels; 360 for(unsigned int j= i+1;j<allLevelStatus_.size();j++)362 for(unsigned int j=0;j<allLevelStatus_.size();j++) 361 363 { 362 364 allLevelStatus_[j].activated=nextLevels[j]; … … 366 368 } 367 369 368 //updates the won variable of the corresponding LevelStatus in allLevelStatus_ 370 369 371 void LevelManager::setLevelStatus(const std::string& LevelWon) 370 372 { 371 ModifyConfigValue(lastWonMission_, set, LevelWon); 372 } 373 374 375 //build up allLevelStatus 373 374 375 ModifyConfigValue(lastWonMission_, set, LevelWon); 376 377 std::vector<int> v (allLevelStatus_.size(),0); 378 for(unsigned int i = 0;i<allLevelStatus_.size();i++) 379 { 380 if(allLevelStatus_[i].won) 381 v[i] =1; 382 } 383 384 SetConfigValue(allLevelWon_, v) 385 .description("The list of all won missions"); 386 387 for (unsigned int i = 0; i < allLevelWon_.size(); ++i) 388 { 389 ModifyConfigValue(allLevelWon_[i], set, v[i]); 390 } 391 392 } 393 394 395 //build up allLevelStatus_ 376 396 //has to be done once per game (not per level) 377 //all connections between the levels are saved in here 397 //all connections between the levels are saved in the allLevelStatus_ 398 //also the won variable of the LevelStatus is set to the corresponding allLevelWon_ value 378 399 void LevelManager::buildallLevelStatus() 379 400 { 380 LevelStatus* level = new LevelStatus(this->getContext()); 381 382 /*LevelStatus level; 383 allLevelStatus_.assign (campaignMissions_.size(),level); 401 LevelStatus* level=new LevelStatus(this->getContext()); 402 allLevelStatus_.assign (campaignMissions_.size(),*level); 384 403 allLevelStatus_[0].activated=1; 385 //allLevelStatus_[0].won=true; 386 387 388 allLevelStatus_[0].nextLevels .push_back(1);389 allLevelStatus_[0].nextLevels.push_back(1); 390 allLevelStatus_[0].nextLevels.push_back(0);391 allLevelStatus_[ 0].nextLevels.push_back(0);392 allLevelStatus_[0].nextLevels.push_back(0); 393 allLevelStatus_[0].nextLevels.push_back(0);394 allLevelStatus_[ 0].nextLevels.push_back(0);395 396 allLevelStatus_[1].nextLevels.push_back(1);397 allLevelStatus_[ 1].nextLevels.push_back(2);398 allLevelStatus_[1].nextLevels.push_back(1); 399 allLevelStatus_[1].nextLevels.push_back(0);400 allLevelStatus_[ 1].nextLevels.push_back(0);401 allLevelStatus_[1].nextLevels.push_back(0); 402 allLevelStatus_[1].nextLevels.push_back(0);403 404 allLevelStatus_[2].nextLevels.push_back(2); 405 allLevelStatus_[2].nextLevels.push_back(1);406 allLevelStatus_[ 2].nextLevels.push_back(0);407 allLevelStatus_[2].nextLevels.push_back(0); 408 allLevelStatus_[2].nextLevels.push_back(1);409 allLevelStatus_[ 2].nextLevels.push_back(0);410 allLevelStatus_[2].nextLevels.push_back(0);*/ 411 412 404 405 406 std::vector<int> v={1,1,1,0,0,0,0,0,0}; 407 allLevelStatus_[0].nextLevels=v; 408 409 v={1,1,2,1,0,0,0,0,0}; 410 allLevelStatus_[1].nextLevels=v; 411 412 v={1,2,1,0,1,0,0,0,0}; 413 allLevelStatus_[2].nextLevels=v; 414 415 v={1,1,2,1,0,1,1,0,0}; 416 allLevelStatus_[3].nextLevels=v; 417 418 v={1,2,1,0,1,0,0,1,1}; 419 allLevelStatus_[4].nextLevels=v; 420 421 v={1,1,2,1,0,1,2,0,0}; 422 allLevelStatus_[5].nextLevels=v; 423 424 v={1,1,2,1,0,2,1,0,0}; 425 allLevelStatus_[6].nextLevels=v; 426 427 v={1,2,1,0,1,0,0,1,2}; 428 allLevelStatus_[7].nextLevels=v; 429 430 v={1,2,1,0,1,0,0,2,1}; 431 allLevelStatus_[8].nextLevels=v; 413 432 414 433 } -
code/branches/bindermFS16/src/orxonox/LevelManager.h
r11186 r11191 24 24 * Co-authors: 25 25 * Damian 'Mozork' Frick 26 * Matthias Binder 26 27 * 27 28 */ … … 147 148 std::string lastWonMission_; 148 149 std::vector<std::string> campaignMissions_; 149 std::vector<int> test_;150 std::vector<int> allLevelWon_; 150 151 std::vector<LevelStatus> allLevelStatus_; 151 152 -
code/branches/bindermFS16/src/orxonox/LevelStatus.h
r11188 r11191 21 21 * 22 22 * Author: 23 * Fabian 'x3n' Landau 24 * Co-authors: 25 * Damian 'Mozork' Frick 23 * Matthias Binder 26 24 * 27 25 */ 28 26 29 /** 30 @file LevelManager.h 31 @brief Definition of the LevelManager singleton. 32 @ingroup Orxonox 33 */ 27 34 28 #ifndef _LevelStatus_H__ 35 29 #define _LevelStatus_H__ … … 52 46 { 53 47 48 /** 49 @brief 50 LevelStatus: 51 In the LevelStatus class all necessary information off a mission in the campaign can be saved. 52 It is only used in the LevelManager to steer the campaign menu. It is now possible to have a treelike campaign menu structure. 53 54 */ 55 54 56 55 57 class _OrxonoxExport LevelStatus : public BaseObject … … 60 62 61 63 bool won; //if the Level is won or not 62 std::vector<int> nextLevels; //i n this vector at the index i is saved if the ith level should be activated =1, visible but not activated =2, or not activated =064 std::vector<int> nextLevels; //if this Level is won, the ith element of this vector shows, what to do with the other leves 63 65 int activated; //0 not activated, 1 activated, 2 visible 64 66 }; -
code/branches/bindermFS16/src/orxonox/gametypes/Mission.h
r11071 r11191 45 45 46 46 virtual void start() override; 47 virtual void end() override; 47 virtual void end() override; //checks if the mission was accomplished and sends the name of the won mission to the LevelManager 48 48 virtual void setTeams(); 49 49 virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
Note: See TracChangeset
for help on using the changeset viewer.