Changeset 11173 for code/branches/bindermFS16/data/gui
- Timestamp:
- Apr 21, 2016, 4:05:15 PM (9 years ago)
- Location:
- code/branches/bindermFS16/data/gui
- Files:
-
- 3 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
Note: See TracChangeset
for help on using the changeset viewer.