Changeset 8079 for code/trunk/data/gui/scripts/HostMenu.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/HostMenu.lua
r7887 r8079 5 5 P.multiplayerMode = "startServer" 6 6 7 P.buttonList = {}8 7 P.levelList = {} 9 8 P.itemList = {} … … 11 10 12 11 function P.onLoad() 13 P.multiplayerMode = "startServer" 12 P.multiplayerMode = "startServer" 14 13 local window = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox") 15 14 local button = tolua.cast(window,"CEGUI::Checkbox") … … 17 16 P.createLevelList() 18 17 19 local item ={18 P:setButton(1, 1, { 20 19 ["button"] = winMgr:getWindow("orxonox/HostMenuStartButton"), 21 ["function"] = P.HostMenuStartButton_clicked 22 } 23 P.buttonList[1] = item 20 ["callback"] = P.HostMenuStartButton_clicked 21 }) 24 22 25 local item ={23 P:setButton(1, 2, { 26 24 ["button"] = winMgr:getWindow("orxonox/HostMenuBackButton"), 27 ["function"] = P.HostMenuBackButton_clicked 28 } 29 P.buttonList[2] = item 25 ["callback"] = P.HostMenuBackButton_clicked 26 }) 30 27 end 31 28 32 29 function P.onShow() 30 if P.showAll ~= orxonox.GUIManager:inDevMode() then 31 local window = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox") 32 local button = tolua.cast(window,"CEGUI::Checkbox") 33 P.showAll = not P.showAll 34 button:setSelected(P.showAll) 35 end 36 33 37 if P.multiplayerMode == "startServer" then 34 38 local window = winMgr:getWindow("orxonox/HostMenuHostButton") … … 44 48 P.createLevelList() 45 49 end 46 47 P.oldindex = -248 P.index = -149 50 50 end 51 51 … … 97 97 end 98 98 99 function P.HostMenuStartButton_clicked(e) 99 function P.HostMenuStartButton_clicked(e) 100 100 local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/HostMenuListbox")) 101 101 local choice = listbox:getFirstSelectedItem() … … 119 119 end 120 120 121 function P.onKeyPressed()122 buttonIteratorHelper(P.buttonList, code, P, 1, 2)123 end124 125 121 return P
Note: See TracChangeset
for help on using the changeset viewer.