Changeset 11173
- Timestamp:
- Apr 21, 2016, 4:05:15 PM (9 years ago)
- Location:
- code/branches/bindermFS16
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/bindermFS16/data/gui/layouts/CampaignMenu.layout
r11052 r11173 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" /> … … 13 14 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 14 15 <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.1,0},{0.65,0},{0.15,0}}" /> 16 <Property Name="Disabled" Value="False" /> 15 17 <Event Name="Clicked" Function="CampaignMenu.Mission1Button_clicked"/> 16 18 </Window> 19 17 20 <Window Type="MenuWidgets/Button" Name="orxonox/Mission2Button" > 18 21 <Property Name="Text" Value="Fight in our Back" /> … … 23 26 <Event Name="Clicked" Function="CampaignMenu.Mission2Button_clicked"/> 24 27 </Window> 28 25 29 <Window Type="MenuWidgets/Button" Name="orxonox/Mission3Button" > 26 30 <Property Name="Text" Value="Pirate Attack" /> … … 31 35 <Event Name="Clicked" Function="CampaignMenu.Mission3Button_clicked"/> 32 36 </Window> 37 33 38 <Window Type="MenuWidgets/Button" Name="orxonox/Mission4Button" > 34 39 <Property Name="Text" Value="Trip to Area 51" /> … … 39 44 <Event Name="Clicked" Function="CampaignMenu.Mission4Button_clicked"/> 40 45 </Window> 46 41 47 <Window Type="MenuWidgets/Button" Name="orxonox/Mission5Button" > 42 48 <Property Name="Text" Value="Area 51 under Fire" /> … … 47 53 <Event Name="Clicked" Function="CampaignMenu.Mission5Button_clicked"/> 48 54 </Window> 55 49 56 <Window Type="MenuWidgets/Button" Name="orxonox/Mission6Button" > 50 57 <Property Name="Text" Value="Escape the Bastards" /> … … 55 62 <Event Name="Clicked" Function="CampaignMenu.Mission6Button_clicked"/> 56 63 </Window> 64 57 65 <Window Type="MenuWidgets/Button" Name="orxonox/Mission7Button" > 58 66 <Property Name="Text" Value="Expedition to Sector 5C" /> … … 63 71 <Event Name="Clicked" Function="CampaignMenu.Mission7Button_clicked"/> 64 72 </Window> 73 65 74 <Window Type="MenuWidgets/Button" Name="orxonox/Mission8Button" > 66 75 <Property Name="Text" Value="Shuttle under Attack" /> … … 71 80 <Event Name="Clicked" Function="CampaignMenu.Mission8Button_clicked"/> 72 81 </Window> 82 73 83 <Window Type="MenuWidgets/Button" Name="orxonox/Mission9Button" > 74 84 <Property Name="Text" Value="Retaliation" /> … … 80 90 </Window> 81 91 82 83 92 <Window Type="MenuWidgets/Button" Name="orxonox/CampaignMenuBackButton" > 84 93 <Property Name="Text" Value="Back" /> 94 <Property Name="Visible" Value="False"/> 85 95 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 86 96 <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.85,0},{0.65,0},{0.9,0}}" /> 97 <Property Name="Visible" Value="True"/> 98 <Property Name="Disabled" Value="False"/> 87 99 <Event Name="Clicked" Function="CampaignMenu.CampaignMenuBackButton_clicked"/> 88 100 </Window> 101 89 102 <Window Type="MenuWidgets/StaticText" Name="orxonox/CampaignMenuCongratulation" > 90 103 <Property Name="Text" Value="Campaign Completed!!!" /> -
code/branches/bindermFS16/data/gui/scripts/CampaignMenu.lua
r11052 r11173 19 19 20 20 21 if (P.getIndexOfLastFinishedMission() == orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() - 1) then 22 local label = winMgr:getWindow("orxonox/CampaignMenuCongratulation") 23 label:setProperty("Visible","True") 21 -- if (P.getIndexOfLastFinishedMission() == orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() - 1) then 22 -- local label = winMgr:getWindow("orxonox/CampaignMenuCongratulation") 23 -- label:setProperty("Visible","True") 24 -- end 25 end 26 27 function P.updateButton(index, button) 28 if (orxonox.LevelManager:getInstance():missionactivate(index)) then 29 button:setProperty("Visible", "True") 30 button:setProperty("Disabled", "False") 31 else 32 button:setProperty("Disabled", "True") 24 33 end 25 34 end 26 35 27 function P.updateButton(index, button) 28 if (P.shouldDisplayButton(index)) then 29 button:setProperty("Visible", "True") 36 --function P.shouldDisplayButton(index) 37 -- local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() 38 -- return index < size 39 --end 30 40 31 if (P.shouldEnableButton(index)) then 32 button:setProperty("Disabled", "False") 33 end 34 end 35 end 41 --function P.shouldActivateButton(index) --checks if button should be activated or not 42 -- return index <= P.getIndexOfLastFinishedMission() + 1 43 --end 36 44 37 function P.shouldDisplayButton(index) 38 local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() 39 return index < size 40 end 41 42 function P.shouldEnableButton(index) 43 return index <= P.getIndexOfLastFinishedMission() + 1 44 end 45 46 function P.getIndexOfLastFinishedMission() 47 local lastMission = orxonox.LevelManager:getInstance():getLastFinishedCampaignMission() 48 if (lastMission and lastMission ~= "") then 49 local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() 50 local index = 0 51 while index < size do 52 local mission = orxonox.LevelManager:getInstance():getCampaignMission(index) 53 if (mission == lastMission) then 54 return index 55 end 56 index = index + 1 57 end 58 end 59 return -1 60 end 45 --function P.getIndexOfLastFinishedMission() 46 -- local lastMission = orxonox.LevelManager:getInstance():getLastFinishedCampaignMission() 47 -- if (lastMission and lastMission ~= "") then 48 -- local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() 49 -- local index = 0 50 -- while index < size do 51 -- local mission = orxonox.LevelManager:getInstance():getCampaignMission(index) 52 -- if (mission == lastMission) then 53 -- return index 54 -- end 55 -- index = index + 1 56 -- end 57 -- end 58 -- return -1 59 --end 61 60 62 61 function P.Mission1Button_clicked(e) -
code/branches/bindermFS16/data/gui/scripts/SingleplayerMenu.lua
r11162 r11173 172 172 173 173 function P.CampaignButton_clicked(e) 174 orxonox.CampaignMenu:test()174 -- P.test() 175 175 showMenuSheet("CampaignMenu", true) 176 176 end 177 177 178 --function P.test() 179 -- orxonox.CampaignMenu:test() 180 --end 181 178 182 return P -
code/branches/bindermFS16/src/orxonox/CMakeLists.txt
r11162 r11173 58 58 TOLUA_FILES 59 59 chat/ChatInputHandler.h 60 overlays/CampaignMenu.h 60 61 LevelInfo.h 61 62 LevelManager.h -
code/branches/bindermFS16/src/orxonox/LevelManager.cc
r11071 r11173 49 49 namespace orxonox 50 50 { 51 52 LevelStatus::LevelStatus() 53 { 54 this->won = true; 55 } 56 57 LevelStatus::~LevelStatus() 58 {} 59 60 bool LevelManager::missionactivate(int index) 61 { 62 //check for index level activate... 63 return index-5; 64 } 65 66 void LevelManager::setLevelStatus(int completedLevel) 67 { 68 // allLevelStatus_[completedLevel]=new LevelStatus; 69 } 70 71 51 72 SetCommandLineArgument(level, "").shortcut("l").information("Default level file (overrides LevelManager::defaultLevelName_ configValue)"); 52 73 … … 63 84 RegisterObject(LevelManager); 64 85 this->setConfigValues(); 86 87 65 88 66 89 // check override … … 73 96 this->nextIndex_ = 0; 74 97 this->nextLevel_ = this->availableLevels_.begin(); 75 } 98 99 allLevelStatus_.reserve(1); 100 } 101 76 102 77 103 LevelManager::~LevelManager() … … 103 129 ModifyConfigValue(lastFinishedCampaignMission_, set, lastFinishedCampaignMission); 104 130 } 131 132 105 133 106 134 /** -
code/branches/bindermFS16/src/orxonox/LevelManager.h
r11071 r11173 48 48 #include "core/config/Configurable.h" 49 49 50 51 namespace orxonox 52 { 53 54 class LevelStatus 55 { 56 public: 57 LevelStatus(); 58 virtual ~LevelStatus(); 59 60 61 private: 62 bool won; 63 std::vector<int> nextLevels; 64 65 }; 66 } 67 50 68 // tolua_begin 51 69 namespace orxonox … … 63 81 Damian 'Mozork' Frick 64 82 65 @ingroup Orxonox 83 84 @ingroup Orxonox1 66 85 */ 86 87 88 89 67 90 class _OrxonoxExport LevelManager 68 91 // tolua_end … … 74 97 virtual ~LevelManager(); 75 98 99 void setLevelStatus(int integer); 100 101 76 102 void setConfigValues(); //!< Set the config values for this object. 77 103 78 104 void requestActivity(Level* level); //!< Request activity for the input Level. 79 105 void releaseActivity(Level* level); //!< Release activity for the input Level. 106 80 107 Level* getActiveLevel(); //!< Get the currently active Level. 81 108 82 109 // tolua_begin 110 bool missionactivate(int index); 83 111 void setDefaultLevel(const std::string& levelName); //!< Set the default Level. 84 112 /** … … 97 125 inline unsigned int getNumberOfCampaignMissions() 98 126 { return this->campaignMissions_.size(); } 127 99 128 inline const std::string& getCampaignMission(unsigned int index) 100 129 { return this->campaignMissions_[index]; } 130 101 131 102 132 /** … … 129 159 std::string lastFinishedCampaignMission_; 130 160 std::vector<std::string> campaignMissions_; 161 std::vector<LevelStatus> allLevelStatus_; 162 163 131 164 132 165 static LevelManager* singletonPtr_s; -
code/branches/bindermFS16/src/orxonox/gametypes/Mission.cc
r11071 r11173 92 92 93 93 LevelManager::getInstance().setLastFinishedCampaignMission(this->getFilename()); 94 //LevelManager::getInstance().setLevelStatus(7); 94 95 } 95 96 else if (!this->gtinfo_->hasEnded()) -
code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.cc
r11162 r11173 33 33 #include "core/GameMode.h" 34 34 35 35 36 namespace orxonox 36 37 { 38 39 37 40 RegisterClass(CampaignMenu); 38 41 … … 52 55 } 53 56 54 //loads the campaign menu 55 void CampaignMenu::loadNewMenu() 57 58 //loads the new campaign menu 59 void CampaignMenu::loadnewmenu() 56 60 { 57 61 -
code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.h
r11162 r11173 32 32 #include <string> 33 33 #include "core/BaseObject.h" 34 #include "util/Singleton.h" 34 35 35 36 namespace orxonox // tolua_export 37 { // tolua_export 38 39 class _OrxonoxExport CampaignMenu // tolua_export 40 : public BaseObject 41 { // tolua_export 36 //tolua_begin 37 namespace orxonox 38 { 39 //tolua_end 40 class _OrxonoxExport CampaignMenu : public BaseObject //tolua_export 41 { //tolua_export 42 42 public: 43 43 CampaignMenu(Context* context); 44 44 ~CampaignMenu(); 45 static void test(); // tolua_export 46 void loadNewMenu(); 47 };// tolua_export 48 } // tolua_export 45 static void test(); //tolua_export 46 void loadnewmenu(); 47 }; //tolua_export 48 49 50 51 } //tolua_export 49 52 50 53 #endif /* _CampaignMenu_H__ */
Note: See TracChangeset
for help on using the changeset viewer.