Changeset 8079 for code/trunk/data/gui/scripts/InGameMenu.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/InGameMenu.lua
r7877 r8079 4 4 P.loadAlong = { "DecisionPopup" } 5 5 6 P.buttonList = {}7 8 6 function P.onLoad() 9 P.multiplayerMode = "startClient" 7 P.multiplayerMode = "startClient" 10 8 11 9 --button are arranged in a 4x1 matrix, the left lower item is nil 12 local item ={10 P:setButton(1, 1, { 13 11 ["button"] = winMgr:getWindow("orxonox/InGameMenu_ReturnButton"), 14 ["function"] = P.button_settings_clicked 15 } 16 P.buttonList[1] = item 12 ["callback"] = P.button_return_clicked 13 }) 17 14 18 local item ={15 P:setButton(2, 1, { 19 16 ["button"] = winMgr:getWindow("orxonox/InGameMenu_MainMenuButton"), 20 ["function"] = P.button_mainmenu_clicked 21 } 22 P.buttonList[2] = item 17 ["callback"] = P.button_mainmenu_clicked 18 }) 23 19 24 local item ={20 P:setButton(3, 1, { 25 21 ["button"] = winMgr:getWindow("orxonox/InGameMenu_SettingsButton"), 26 ["function"] = P.button_settings_clicked 27 } 28 P.buttonList[3] = item 22 ["callback"] = P.button_settings_clicked 23 }) 29 24 30 local item ={25 P:setButton(4, 1, { 31 26 ["button"] = winMgr:getWindow("orxonox/InGameMenu_QuitButton"), 32 ["function"] = P.button_quit_clicked 33 } 34 P.buttonList[4] = item 35 27 ["callback"] = P.button_quit_clicked 28 }) 36 29 end 37 30 38 31 function P.onShow() 39 --indices to iterate through buttonlist 40 P.oldindex = -2 41 P.index = -1 32 if P:hasSelection() == false then 33 P:setSelection(1, 1) 34 end 35 36 orxonox.execute("setPause 1") 37 end 38 39 function P.onQuit() 40 orxonox.execute("setPause 0") 42 41 end 43 42 … … 64 63 hideMenuSheet("InGameMenu") 65 64 orxonox.execute("exit") 66 else 65 else 67 66 P.onShow() 68 67 end 69 68 end 70 69 71 function P.onKeyPressed()72 buttonIteratorHelper(P.buttonList, code, P, 4, 1)73 end74 75 70 return P 76 71
Note: See TracChangeset
for help on using the changeset viewer.