Changeset 8079 for code/trunk/data/gui/scripts/SingleplayerMenu.lua
- Timestamp:
- Mar 15, 2011, 9:47:11 PM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/data/gui/scripts/SingleplayerMenu.lua
r7876 r8079 3 3 local P = createMenuSheet("SingleplayerMenu") 4 4 5 P.buttonList = {}6 5 P.levelList = {} 7 6 P.itemList = {} … … 15 14 16 15 --buttons are arranged in a 1x2 matrix 17 local item ={16 P:setButton(1, 1, { 18 17 ["button"] = winMgr:getWindow("orxonox/SingleplayerStartButton"), 19 ["function"] = P.SingleplayerStartButton_clicked 20 } 21 P.buttonList[1] = item 18 ["callback"] = P.SingleplayerStartButton_clicked 19 }) 22 20 23 local item ={21 P:setButton(1, 2, { 24 22 ["button"] = winMgr:getWindow("orxonox/SingleplayerBackButton"), 25 ["function"] = P.SingleplayerBackButton_clicked 26 } 27 P.buttonList[2] = item 23 ["callback"] = P.SingleplayerBackButton_clicked 24 }) 25 end 26 27 function P.onShow() 28 if P.showAll ~= orxonox.GUIManager:inDevMode() then 29 local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox") 30 local button = tolua.cast(window,"CEGUI::Checkbox") 31 P.showAll = not P.showAll 32 button:setSelected(P.showAll) 33 P.createLevelList() 34 end 28 35 end 29 36 … … 47 54 index = index + 1 48 55 end 49 --TODO: Reintroduce sorting, if needed. At the moment it's sorted by filename.50 --table.sort(levelList)51 56 for k,v in pairs(P.levelList) do 52 57 local item = CEGUI.createListboxTextItem(v:getName()) … … 59 64 orxonox.GUIManager:setTooltipTextHelper(P.itemList[k], v:getDescription()) 60 65 end 61 end62 63 function P.onShow()64 --indices to iterate through buttonlist65 P.oldindex = -266 P.index = -167 66 end 68 67 … … 93 92 end 94 93 95 function P.onKeyPressed()96 buttonIteratorHelper(P.buttonList, code, P, 1, 2)97 end98 99 94 return P 100 95
Note: See TracChangeset
for help on using the changeset viewer.