Changeset 11206 for code/branches/presentationFS16/data/gui/scripts
- Timestamp:
- May 26, 2016, 4:15:54 PM (9 years ago)
- Location:
- code/branches/presentationFS16
- Files:
-
- 3 edited
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/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
Note: See TracChangeset
for help on using the changeset viewer.