- Timestamp:
- Feb 1, 2015, 10:51:47 PM (11 years ago)
- Location:
- code/branches/storymodeHS14
- Files:
-
- 1 deleted
- 3 edited
-
cmake/LibraryConfig.cmake (modified) (1 diff)
-
data/gui/scripts/CampaignMenu.lua (modified) (2 diffs)
-
data/gui/scripts/SingleplayerMenu.lua (modified) (2 diffs)
-
data/gui/scripts/campaign.txt (deleted)
Legend:
- Unmodified
- Added
- Removed
-
code/branches/storymodeHS14/cmake/LibraryConfig.cmake
r9765 r10250 161 161 SET(Boost_ADDITIONAL_VERSIONS 1.40 1.40.0 1.41 1.41.0 1.42 1.42.0 1.43 1.43.0 162 162 1.44 1.44.0 1.45 1.45.0 1.46 1.46.0 1.46.1 1.49.0 163 1.53.0)163 1.53.0) 164 164 IF(NOT TARDIS) 165 165 FIND_PACKAGE(Boost 1.40 REQUIRED thread filesystem system date_time) -
code/branches/storymodeHS14/data/gui/scripts/CampaignMenu.lua
r10174 r10250 4 4 5 5 function P.onLoad() 6 7 local MissionTwoButton = winMgr:getWindow("orxonox/MissionTwoButton")8 if (P.CheckLevel("missionOne.oxw")) then9 MissionTwoButton:setProperty("Disabled", "False")10 end11 12 local MissionThreeButton = winMgr:getWindow("orxonox/MissionThreeButton")13 if (P.CheckLevel("fightInOurBack.oxw")) then14 MissionThreeButton:setProperty("Disabled", "False")15 end6 7 local MissionTwoButton = winMgr:getWindow("orxonox/MissionTwoButton") 8 if (P.CheckLevel("missionOne.oxw")) then 9 MissionTwoButton:setProperty("Disabled", "False") 10 end 11 12 local MissionThreeButton = winMgr:getWindow("orxonox/MissionThreeButton") 13 if (P.CheckLevel("fightInOurBack.oxw")) then 14 MissionThreeButton:setProperty("Disabled", "False") 15 end 16 16 17 local MissionFourButton = winMgr:getWindow("orxonox/MissionFourButton")18 if (P.CheckLevel("pirateAttack.oxw")) then19 MissionFourButton:setProperty("Disabled", "False")20 end21 22 local Completed = winMgr:getWindow("orxonox/CampaignMenuCongratulation")23 if (P.CheckLevel("iJohnVane_TriptoArea51.oxw")) then24 Completed:setProperty("Visible","True")25 end17 local MissionFourButton = winMgr:getWindow("orxonox/MissionFourButton") 18 if (P.CheckLevel("pirateAttack.oxw")) then 19 MissionFourButton:setProperty("Disabled", "False") 20 end 21 22 local Completed = winMgr:getWindow("orxonox/CampaignMenuCongratulation") 23 if (P.CheckLevel("iJohnVane_TriptoArea51.oxw")) then 24 Completed:setProperty("Visible","True") 25 end 26 26 end 27 27 28 28 function P.GenerateHelperString(number) 29 local string = ""30 while number > 1 do31 string = string.." "32 number = number-133 end34 string = string.."."35 return string29 local string = "" 30 while number > 1 do 31 string = string.." " 32 number = number-1 33 end 34 string = string.."." 35 return string 36 36 end 37 37 38 38 function P.FindLevel(filename) 39 local level = nil40 local templevel = nil41 local size = orxonox.LevelManager:getInstance():getNumberOfLevels()39 local level = nil 40 local templevel = nil 41 local size = orxonox.LevelManager:getInstance():getNumberOfLevels() 42 42 local index = 0 43 43 while index < size do 44 templevel = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)45 if(templevel:getXMLFilename()==filename) then46 level = templevel47 end44 templevel = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index) 45 if(templevel:getXMLFilename()==filename) then 46 level = templevel 47 end 48 48 index=index+1 49 49 end … … 52 52 53 53 function P.CheckLevel(filename) 54 local file = io.open("/home/pmao/pmao-extra-0/orxonox/storymode/campaign.txt", "r+")55 local index = 056 local returnvalue = false57 local numberoflines = 58-string.len(filename)58 local helpstringfalse = filename.." 0"..P.GenerateHelperString(numberoflines)59 local helpstringtrue = filename.." 1"..P.GenerateHelperString(numberoflines)60 while index < 100 do61 local line = file:read()62 if(line == helpstringfalse) then63 returnvalue = false64 break65 end66 if(line == helpstringtrue) then67 returnvalue = true68 break69 end70 index=index+171 end 72 io.close(file)73 return returnvalue54 local file = io.open("/home/pmao/pmao-extra-0/orxonox/storymode/campaign.txt", "r+") 55 local index = 0 56 local returnvalue = false 57 local numberoflines = 58-string.len(filename) 58 local helpstringfalse = filename.." 0"..P.GenerateHelperString(numberoflines) 59 local helpstringtrue = filename.." 1"..P.GenerateHelperString(numberoflines) 60 while index < 100 do 61 local line = file:read() 62 if(line == helpstringfalse) then 63 returnvalue = false 64 break 65 end 66 if(line == helpstringtrue) then 67 returnvalue = true 68 break 69 end 70 index=index+1 71 end 72 io.close(file) 73 return returnvalue 74 74 end 75 75 76 76 function P.MissionOneButton_clicked(e) 77 local level = P.FindLevel("missionOne.oxw")78 orxonox.execute("startGame " .. level:getXMLFilename())79 hideAllMenuSheets()77 local level = P.FindLevel("missionOne.oxw") 78 orxonox.execute("startGame " .. level:getXMLFilename()) 79 hideAllMenuSheets() 80 80 end 81 81 82 82 function P.MissionTwoButton_clicked(e) 83 local level = P.FindLevel("fightInOurBack.oxw")84 if (P.CheckLevel("missionOne.oxw")) then85 orxonox.execute("startGame " .. level:getXMLFilename())86 hideAllMenuSheets()87 end83 local level = P.FindLevel("fightInOurBack.oxw") 84 if (P.CheckLevel("missionOne.oxw")) then 85 orxonox.execute("startGame " .. level:getXMLFilename()) 86 hideAllMenuSheets() 87 end 88 88 end 89 89 90 90 function P.MissionThreeButton_clicked(e) 91 local level = P.FindLevel("pirateAttack.oxw")92 if (P.CheckLevel("fightInOurBack.oxw")) then93 orxonox.execute("startGame " .. level:getXMLFilename())94 hideAllMenuSheets()95 else96 hideMenuSheet(P.name)97 end91 local level = P.FindLevel("pirateAttack.oxw") 92 if (P.CheckLevel("fightInOurBack.oxw")) then 93 orxonox.execute("startGame " .. level:getXMLFilename()) 94 hideAllMenuSheets() 95 else 96 hideMenuSheet(P.name) 97 end 98 98 end 99 99 100 100 function P.MissionFourButton_clicked(e) 101 local level = P.FindLevel("iJohnVane_TriptoArea51.oxw")102 if (P.CheckLevel("pirateAttack.oxw")) then103 orxonox.execute("startGame " .. level:getXMLFilename())104 hideAllMenuSheets()105 else106 hideMenuSheet(P.name)107 end101 local level = P.FindLevel("iJohnVane_TriptoArea51.oxw") 102 if (P.CheckLevel("pirateAttack.oxw")) then 103 orxonox.execute("startGame " .. level:getXMLFilename()) 104 hideAllMenuSheets() 105 else 106 hideMenuSheet(P.name) 107 end 108 108 end 109 109 110 110 function P.CampaignMenuRefreshButton_clicked(e) 111 local MissionTwoButton = winMgr:getWindow("orxonox/MissionTwoButton")112 if (P.CheckLevel("missionOne.oxw")) then113 MissionTwoButton:setProperty("Disabled", "False")114 end115 116 local MissionThreeButton = winMgr:getWindow("orxonox/MissionThreeButton")117 if (P.CheckLevel("fightInOurBack.oxw")) then118 MissionThreeButton:setProperty("Disabled", "False")119 end111 local MissionTwoButton = winMgr:getWindow("orxonox/MissionTwoButton") 112 if (P.CheckLevel("missionOne.oxw")) then 113 MissionTwoButton:setProperty("Disabled", "False") 114 end 115 116 local MissionThreeButton = winMgr:getWindow("orxonox/MissionThreeButton") 117 if (P.CheckLevel("fightInOurBack.oxw")) then 118 MissionThreeButton:setProperty("Disabled", "False") 119 end 120 120 121 local MissionFourButton = winMgr:getWindow("orxonox/MissionFourButton")122 if (P.CheckLevel("pirateAttack.oxw")) then123 MissionFourButton:setProperty("Disabled", "False")124 end125 126 local Completed = winMgr:getWindow("orxonox/CampaignMenuCongratulation")127 if (P.CheckLevel("iJohnVane_TriptoArea51.oxw")) then128 Completed:setProperty("Visible","True")129 end121 local MissionFourButton = winMgr:getWindow("orxonox/MissionFourButton") 122 if (P.CheckLevel("pirateAttack.oxw")) then 123 MissionFourButton:setProperty("Disabled", "False") 124 end 125 126 local Completed = winMgr:getWindow("orxonox/CampaignMenuCongratulation") 127 if (P.CheckLevel("iJohnVane_TriptoArea51.oxw")) then 128 Completed:setProperty("Visible","True") 129 end 130 130 end 131 131 -
code/branches/storymodeHS14/data/gui/scripts/SingleplayerMenu.lua
r10157 r10250 40 40 }) 41 41 P:setButton(1, 4,{ 42 ["button"] = winMgr:getWindow("orxonox/CampaignButton"),43 ["callback"] = P.CampaignButton_clicked42 ["button"] = winMgr:getWindow("orxonox/CampaignButton"), 43 ["callback"] = P.CampaignButton_clicked 44 44 }) 45 45 end … … 172 172 173 173 function P.CampaignButton_clicked(e) 174 showMenuSheet("CampaignMenu", true)174 showMenuSheet("CampaignMenu", true) 175 175 end 176 176
Note: See TracChangeset
for help on using the changeset viewer.










