Changeset 11206
- Timestamp:
- May 26, 2016, 4:15:54 PM (8 years ago)
- Location:
- code/branches/presentationFS16
- Files:
-
- 11 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationFS16
- Property svn:mergeinfo changed
/code/branches/bindermFS16 (added) merged: 11139,11149-11150,11162,11173,11180-11181,11186,11188,11191,11194
- Property svn:mergeinfo changed
-
code/branches/presentationFS16/data/gui/layouts/CampaignMenu.layout
r11052 r11206 8 8 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1.0,0},{1.0,0}}" /> 9 9 <Property Name="BackgroundEnabled" Value="False" /> 10 10 11 <Window Type="MenuWidgets/Button" Name="orxonox/Mission1Button" > 11 12 <Property Name="Text" Value="Mission One" /> 12 13 <Property Name="Visible" Value="False"/> 13 14 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 14 <Property Name="UnifiedAreaRect" Value="{{0. 35,0},{0.1,0},{0.65,0},{0.15,0}}" />15 <Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.34,0},{0.3,0},{0.39,0}}" /> 15 16 <Event Name="Clicked" Function="CampaignMenu.Mission1Button_clicked"/> 16 17 </Window> 18 17 19 <Window Type="MenuWidgets/Button" Name="orxonox/Mission2Button" > 18 20 <Property Name="Text" Value="Fight in our Back" /> 19 21 <Property Name="Visible" Value="False"/> 20 22 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 21 <Property Name="UnifiedAreaRect" Value="{{0. 35,0},{0.18,0},{0.65,0},{0.23,0}}" />22 <Property Name="Disabled" Value="True" 23 <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.26,0},{0.4,0},{0.31,0}}" /> 24 <Property Name="Disabled" Value="True"/> 23 25 <Event Name="Clicked" Function="CampaignMenu.Mission2Button_clicked"/> 24 26 </Window> 27 25 28 <Window Type="MenuWidgets/Button" Name="orxonox/Mission3Button" > 26 29 <Property Name="Text" Value="Pirate Attack" /> 27 30 <Property Name="Visible" Value="False"/> 28 31 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 29 <Property Name="UnifiedAreaRect" Value="{{0. 35,0},{0.26,0},{0.65,0},{0.31,0}}" />32 <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.42,0},{0.4,0},{0.47,0}}" /> 30 33 <Property Name="Disabled" Value="True" /> 31 34 <Event Name="Clicked" Function="CampaignMenu.Mission3Button_clicked"/> 32 35 </Window> 36 33 37 <Window Type="MenuWidgets/Button" Name="orxonox/Mission4Button" > 34 38 <Property Name="Text" Value="Trip to Area 51" /> 35 39 <Property Name="Visible" Value="False"/> 36 40 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 37 <Property Name="UnifiedAreaRect" Value="{{0. 35,0},{0.34,0},{0.65,0},{0.39,0}}" />41 <Property Name="UnifiedAreaRect" Value="{{0.41,0},{0.26,0},{0.71,0},{0.31,0}}" /> 38 42 <Property Name="Disabled" Value="True" /> 39 43 <Event Name="Clicked" Function="CampaignMenu.Mission4Button_clicked"/> 40 44 </Window> 45 41 46 <Window Type="MenuWidgets/Button" Name="orxonox/Mission5Button" > 42 47 <Property Name="Text" Value="Area 51 under Fire" /> 43 48 <Property Name="Visible" Value="False"/> 44 49 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 45 <Property Name="UnifiedAreaRect" Value="{{0. 35,0},{0.42,0},{0.65,0},{0.47,0}}" />50 <Property Name="UnifiedAreaRect" Value="{{0.41,0},{0.42,0},{0.71,0},{0.47,0}}" /> 46 51 <Property Name="Disabled" Value="True" /> 47 52 <Event Name="Clicked" Function="CampaignMenu.Mission5Button_clicked"/> 48 53 </Window> 54 49 55 <Window Type="MenuWidgets/Button" Name="orxonox/Mission6Button" > 50 56 <Property Name="Text" Value="Escape the Bastards" /> 51 57 <Property Name="Visible" Value="False"/> 52 58 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 53 <Property Name="UnifiedAreaRect" Value="{{0. 35,0},{0.50,0},{0.65,0},{0.55,0}}" />59 <Property Name="UnifiedAreaRect" Value="{{0.72,0},{0.10,0},{0.99,0},{0.15,0}}" /> 54 60 <Property Name="Disabled" Value="True" /> 55 61 <Event Name="Clicked" Function="CampaignMenu.Mission6Button_clicked"/> 56 62 </Window> 63 57 64 <Window Type="MenuWidgets/Button" Name="orxonox/Mission7Button" > 58 65 <Property Name="Text" Value="Expedition to Sector 5C" /> 59 66 <Property Name="Visible" Value="False"/> 60 67 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 61 <Property Name="UnifiedAreaRect" Value="{{0. 35,0},{0.58,0},{0.65,0},{0.63,0}}" />68 <Property Name="UnifiedAreaRect" Value="{{0.72,0},{0.18,0},{0.99,0},{0.23,0}}" /> 62 69 <Property Name="Disabled" Value="True" /> 63 70 <Event Name="Clicked" Function="CampaignMenu.Mission7Button_clicked"/> 64 71 </Window> 72 65 73 <Window Type="MenuWidgets/Button" Name="orxonox/Mission8Button" > 66 74 <Property Name="Text" Value="Shuttle under Attack" /> 67 75 <Property Name="Visible" Value="False"/> 68 76 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 69 <Property Name="UnifiedAreaRect" Value="{{0. 35,0},{0.66,0},{0.65,0},{0.71,0}}" />77 <Property Name="UnifiedAreaRect" Value="{{0.72,0},{0.50,0},{0.99,0},{0.55,0}}" /> 70 78 <Property Name="Disabled" Value="True" /> 71 79 <Event Name="Clicked" Function="CampaignMenu.Mission8Button_clicked"/> 72 80 </Window> 81 73 82 <Window Type="MenuWidgets/Button" Name="orxonox/Mission9Button" > 74 83 <Property Name="Text" Value="Retaliation" /> 75 84 <Property Name="Visible" Value="False"/> 76 85 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 77 <Property Name="UnifiedAreaRect" Value="{{0. 35,0},{0.74,0},{0.65,0},{0.79,0}}" />86 <Property Name="UnifiedAreaRect" Value="{{0.72,0},{0.58,0},{0.99,0},{0.63,0}}" /> 78 87 <Property Name="Disabled" Value="True" /> 79 88 <Event Name="Clicked" Function="CampaignMenu.Mission9Button_clicked"/> 80 89 </Window> 81 90 82 83 91 <Window Type="MenuWidgets/Button" Name="orxonox/CampaignMenuBackButton" > 84 92 <Property Name="Text" Value="Back" /> 93 <Property Name="Visible" Value="False"/> 85 94 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 86 95 <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.85,0},{0.65,0},{0.9,0}}" /> 96 <Property Name="Visible" Value="True"/> 97 <Property Name="Disabled" Value="False"/> 87 98 <Event Name="Clicked" Function="CampaignMenu.CampaignMenuBackButton_clicked"/> 88 99 </Window> 100 89 101 <Window Type="MenuWidgets/StaticText" Name="orxonox/CampaignMenuCongratulation" > 90 102 <Property Name="Text" Value="Campaign Completed!!!" /> -
code/branches/presentationFS16/data/gui/scripts/CampaignMenu.lua
r11052 r11206 17 17 P.updateButton(7, winMgr:getWindow("orxonox/Mission8Button")) 18 18 P.updateButton(8, winMgr:getWindow("orxonox/Mission9Button")) 19 end 19 20 20 21 21 if (P.getIndexOfLastFinishedMission() == orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() - 1) then 22 local label = winMgr:getWindow("orxonox/CampaignMenuCongratulation") 23 label:setProperty("Visible","True") 22 function P.updateButton(index, button) 23 local lastMission = orxonox.LevelManager:getInstance():getLastWonMission() 24 if (lastMission == "") then 25 else 26 local lastwon =P.getIndexOfLastFinishedMission() 27 orxonox.LevelManager:getInstance():updatewon(lastwon) 28 end 29 30 local test =orxonox.LevelManager:getInstance():missionactivate(index) 31 32 if (test==1) then 33 button:setProperty("Visible", "True") 34 button:setProperty("Disabled", "False") 35 elseif (test==2) then 36 button:setProperty("Visible", "True") 37 button:setProperty("Disabled", "True") 38 else 39 button:setProperty("Visible", "False") 40 button:setProperty("Disabled", "True") 24 41 end 25 42 end 26 43 27 function P.updateButton(index, button)28 if (P.shouldDisplayButton(index)) then29 button:setProperty("Visible", "True")30 31 if (P.shouldEnableButton(index)) then32 button:setProperty("Disabled", "False")33 end34 end35 end36 37 function P.shouldDisplayButton(index)38 local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions()39 return index < size40 end41 42 function P.shouldEnableButton(index)43 return index <= P.getIndexOfLastFinishedMission() + 144 end45 46 44 function P.getIndexOfLastFinishedMission() 47 local lastMission = orxonox.LevelManager:getInstance():getLast FinishedCampaignMission()45 local lastMission = orxonox.LevelManager:getInstance():getLastWonMission() 48 46 if (lastMission and lastMission ~= "") then 49 47 local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() -
code/branches/presentationFS16/data/gui/scripts/SingleplayerMenu.lua
r10258 r11206 172 172 173 173 function P.CampaignButton_clicked(e) 174 -- P.test() 174 175 showMenuSheet("CampaignMenu", true) 175 176 end 176 177 178 --function P.test() 179 -- orxonox.CampaignMenu:test() 180 --end 181 177 182 return P -
code/branches/presentationFS16/src/orxonox/CMakeLists.txt
r11080 r11206 26 26 Level.cc 27 27 LevelInfo.cc 28 LevelStatus.cc 28 29 LevelManager.cc 29 30 Main.cc … … 58 59 TOLUA_FILES 59 60 chat/ChatInputHandler.h 61 overlays/CampaignMenu.h 60 62 LevelInfo.h 61 63 LevelManager.h … … 65 67 sound/SoundManager.h 66 68 controllers/ScriptController.h 69 overlays/CampaignMenu.h 67 70 PCH_FILE 68 71 OrxonoxPrecompiledHeaders.h -
code/branches/presentationFS16/src/orxonox/LevelManager.cc
r11071 r11206 24 24 * Co-authors: 25 25 * Damian 'Mozork' Frick 26 * Matthias Binder 26 27 * 27 28 */ … … 33 34 34 35 #include "LevelManager.h" 36 #include "LevelStatus.h" 35 37 36 38 #include <map> … … 47 49 #include "PlayerManager.h" 48 50 51 49 52 namespace orxonox 50 53 { 54 55 56 57 51 58 SetCommandLineArgument(level, "").shortcut("l").information("Default level file (overrides LevelManager::defaultLevelName_ configValue)"); 52 59 … … 63 70 RegisterObject(LevelManager); 64 71 this->setConfigValues(); 72 73 65 74 66 75 // check override … … 73 82 this->nextIndex_ = 0; 74 83 this->nextLevel_ = this->availableLevels_.begin(); 75 } 84 85 buildallLevelStatus(); 86 } 87 76 88 77 89 LevelManager::~LevelManager() … … 80 92 for (LevelInfoItem* info : availableLevels_) 81 93 info->destroy(); 94 for(unsigned int i = 0; i<allLevelStatus_.size();++i) 95 { 96 allLevelStatus_[i]->destroy(); 97 } 82 98 } 83 99 … … 88 104 void LevelManager::setConfigValues() 89 105 { 106 90 107 SetConfigValue(defaultLevelName_, "missionOne.oxw") 91 108 .description("Sets the pre selection of the level in the main menu."); 92 SetConfigValue(last FinishedCampaignMission_, "")109 SetConfigValue(lastWonMission_, "") 93 110 .description("The last finished mission of a campaign"); 94 111 SetConfigValue(campaignMissions_, std::vector<std::string>()) … … 96 113 } 97 114 98 /**99 * @brief Stores the argument in the corresponding config value.100 */101 void LevelManager::setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission)102 {103 ModifyConfigValue(lastFinishedCampaignMission_, set, lastFinishedCampaignMission);104 }105 115 106 116 /** … … 169 179 void LevelManager::activateNextLevel() 170 180 { 181 171 182 if (this->levels_.size() > 0) 172 183 { … … 317 328 //TODO: Implement some kind of update? 318 329 } 330 331 332 333 /** 334 @brief 335 first updates allLevelStatus and then check if the level with index i is activated 336 */ 337 int LevelManager::missionactivate(int index) 338 { 339 updateAllLevelStatus(); 340 int activated = allLevelStatus_[index]->activated; 341 return activated; 342 } 343 /** 344 @brief 345 update the last won mission to won=true 346 */ 347 348 void LevelManager::updatewon(int lastwon) 349 { 350 allLevelStatus_[lastwon]->won=true; 351 352 } 353 354 /** 355 @brief 356 checks if a level is won 357 if a level is won, the other levels should be shown as saved in 'nextLevels' of the won level 358 therefore 'activated' of all other levels will be updated to the correct value 359 if more than one level is won, the level with the highes index decides which other levels will be shown, activated or not activated 360 */ 361 362 void LevelManager::updateAllLevelStatus() 363 { 364 for(unsigned int i =0;i<allLevelStatus_.size();i++) 365 { 366 if(allLevelStatus_[i]->won) 367 { 368 allLevelStatus_[i]->activated=1; 369 std::vector<int> nextLevels=allLevelStatus_[i]->nextLevels; 370 for(unsigned int j=0;j<allLevelStatus_.size();j++) 371 { 372 allLevelStatus_[j]->activated=nextLevels[j]; 373 } 374 } 375 } 376 } 377 378 /** 379 @brief 380 the name of the last won mission is saved in the config file 381 */ 382 383 void LevelManager::setLevelStatus(const std::string& LevelWon) 384 { 385 386 387 ModifyConfigValue(lastWonMission_, set, LevelWon); 388 389 /** 390 TODO: save allLevelWon_ into the config file 391 */ 392 } 393 394 395 /** 396 @brief 397 build up allLevelStatus_ 398 has to be done once per game (not per level) 399 all connections between the levels are saved in the allLevelStatus_ 400 also the won variable of the LevelStatus have to be set to the corresponding allLevelWon_ values 401 */ 402 void LevelManager::buildallLevelStatus() 403 { 404 for(unsigned int i =0;i<campaignMissions_.size();++i) 405 { 406 LevelStatus* level= new LevelStatus(this->getContext()); 407 allLevelStatus_.push_back(level); 408 } 409 410 /** 411 TODO: allLevelWon_ should be loaded into the allLevelSatus_ such that the progress of the campaign can be saved 412 */ 413 414 allLevelStatus_[0]->activated=1; 415 416 417 std::vector<int> v={1,1,1,0,0,0,0,0,0}; 418 allLevelStatus_[0]->nextLevels=v; 419 420 v={1,1,2,1,0,0,0,0,0}; 421 allLevelStatus_[1]->nextLevels=v; 422 423 v={1,2,1,0,1,0,0,0,0}; 424 allLevelStatus_[2]->nextLevels=v; 425 426 v={1,1,2,1,0,1,1,0,0}; 427 allLevelStatus_[3]->nextLevels=v; 428 429 v={1,2,1,0,1,0,0,1,1}; 430 allLevelStatus_[4]->nextLevels=v; 431 432 v={1,1,2,1,0,1,2,0,0}; 433 allLevelStatus_[5]->nextLevels=v; 434 435 v={1,1,2,1,0,2,1,0,0}; 436 allLevelStatus_[6]->nextLevels=v; 437 438 v={1,2,1,0,1,0,0,1,2}; 439 allLevelStatus_[7]->nextLevels=v; 440 441 v={1,2,1,0,1,0,0,2,1}; 442 allLevelStatus_[8]->nextLevels=v; 443 444 } 319 445 } -
code/branches/presentationFS16/src/orxonox/LevelManager.h
r11071 r11206 24 24 * Co-authors: 25 25 * Damian 'Mozork' Frick 26 * Matthias Binder 26 27 * 27 28 */ … … 47 48 #include "util/Singleton.h" 48 49 #include "core/config/Configurable.h" 50 #include "LevelStatus.h" 51 49 52 50 53 // tolua_begin … … 63 66 Damian 'Mozork' Frick 64 67 65 @ingroup Orxonox 68 69 @ingroup Orxonox1 66 70 */ 71 72 73 74 67 75 class _OrxonoxExport LevelManager 68 76 // tolua_end … … 74 82 virtual ~LevelManager(); 75 83 84 void buildallLevelStatus(); 85 void updateAllLevelStatus(); 86 void setLevelStatus(const std::string& LevelWon); 87 88 76 89 void setConfigValues(); //!< Set the config values for this object. 77 90 78 91 void requestActivity(Level* level); //!< Request activity for the input Level. 79 92 void releaseActivity(Level* level); //!< Release activity for the input Level. 93 80 94 Level* getActiveLevel(); //!< Get the currently active Level. 81 95 82 96 // tolua_begin 97 void updatewon(int lastwon); 98 int missionactivate(int index); 83 99 void setDefaultLevel(const std::string& levelName); //!< Set the default Level. 84 100 /** … … 91 107 LevelInfoItem* getAvailableLevelListItem(unsigned int index); //!< Get the LevelInfoItem at the given index in the list of available Levels. 92 108 93 void setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission); 94 inline const std::string& getLastFinishedCampaignMission() const 95 { return this->lastFinishedCampaignMission_; } 109 inline const std::string& getLastWonMission() const 110 { return this->lastWonMission_; } 96 111 97 112 inline unsigned int getNumberOfCampaignMissions() 98 113 { return this->campaignMissions_.size(); } 114 99 115 inline const std::string& getCampaignMission(unsigned int index) 100 116 { return this->campaignMissions_[index]; } 117 101 118 102 119 /** … … 127 144 // config values 128 145 std::string defaultLevelName_; 129 std::string last FinishedCampaignMission_;146 std::string lastWonMission_; 130 147 std::vector<std::string> campaignMissions_; 148 std::vector<int> allLevelWon_; //level i is won if allLevelWon_[i]=1 149 std::vector<LevelStatus*> allLevelStatus_; 150 151 131 152 132 153 static LevelManager* singletonPtr_s; -
code/branches/presentationFS16/src/orxonox/gametypes/Mission.cc
r11071 r11206 91 91 this->gtinfo_->sendAnnounceMessage("Mission accomplished!"); 92 92 93 LevelManager::getInstance().setLastFinishedCampaignMission(this->getFilename()); 93 //LevelManager::getInstance().setLastFinishedCampaignMission(this->getFilename()); 94 95 //gibt index von bestandenem level weiter 96 LevelManager::getInstance().setLevelStatus(this->getFilename()); 94 97 } 95 98 else if (!this->gtinfo_->hasEnded()) -
code/branches/presentationFS16/src/orxonox/gametypes/Mission.h
r11071 r11206 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 -
code/branches/presentationFS16/src/orxonox/overlays/CMakeLists.txt
r7163 r11206 3 3 OrxonoxOverlay.cc 4 4 OverlayGroup.cc 5 CampaignMenu.cc 5 6 6 7 #COMPILATION_BEGIN OverlayCompilation.cc -
code/branches/presentationFS16/src/orxonox/overlays/GUISheet.cc
r9667 r11206 33 33 #include "core/XMLPort.h" 34 34 #include "core/GameMode.h" 35 #include "core/command/ConsoleCommandIncludes.h" 35 36 36 37 namespace orxonox 37 38 { 39 40 38 41 RegisterClass(GUISheet); 42 39 43 40 44 GUISheet::GUISheet(Context* context) … … 95 99 // Note: This call has no effect when already showing! 96 100 } 101 97 102 }
Note: See TracChangeset
for help on using the changeset viewer.