- Timestamp:
- Apr 21, 2016, 4:05:15 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note: See TracChangeset
for help on using the changeset viewer.