Changeset 7922 for code/branches/usability/data/gui/scripts/InGameMenu.lua
- Timestamp:
- Feb 20, 2011, 12:47:57 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/data/gui/scripts/InGameMenu.lua
r7877 r7922 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:initButtons(4, 1) 11 12 P:setButton(1, 1, { 13 13 ["button"] = winMgr:getWindow("orxonox/InGameMenu_ReturnButton"), 14 ["function"] = P.button_settings_clicked 15 } 16 P.buttonList[1] = item 14 ["callback"] = P.button_return_clicked 15 }) 17 16 18 local item ={17 P:setButton(2, 1, { 19 18 ["button"] = winMgr:getWindow("orxonox/InGameMenu_MainMenuButton"), 20 ["function"] = P.button_mainmenu_clicked 21 } 22 P.buttonList[2] = item 19 ["callback"] = P.button_mainmenu_clicked 20 }) 23 21 24 local item ={22 P:setButton(3, 1, { 25 23 ["button"] = winMgr:getWindow("orxonox/InGameMenu_SettingsButton"), 26 ["function"] = P.button_settings_clicked 27 } 28 P.buttonList[3] = item 24 ["callback"] = P.button_settings_clicked 25 }) 29 26 30 local item ={27 P:setButton(4, 1, { 31 28 ["button"] = winMgr:getWindow("orxonox/InGameMenu_QuitButton"), 32 ["function"] = P.button_quit_clicked 33 } 34 P.buttonList[4] = item 35 29 ["callback"] = P.button_quit_clicked 30 }) 36 31 end 37 32 38 33 function P.onShow() 39 --indices to iterate through buttonlist40 P.oldindex = -241 P.index = -134 if P:hasSelection() == false then 35 P:setSelection(1, 1) 36 end 42 37 end 43 38 … … 64 59 hideMenuSheet("InGameMenu") 65 60 orxonox.execute("exit") 66 else 61 else 67 62 P.onShow() 68 63 end 69 64 end 70 65 71 function P.onKeyPressed()72 buttonIteratorHelper(P.buttonList, code, P, 4, 1)73 end74 75 66 return P 76 67
Note: See TracChangeset
for help on using the changeset viewer.