- Timestamp:
- Feb 20, 2011, 12:47:57 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/data/gui/scripts/ControlsMenu.lua
r7689 r7922 2 2 3 3 local P = createMenuSheet("ControlsMenu") 4 P.buttonList = {}5 4 P.loadAlong = { "MouseControlsMenu", "KeyBindMenu" } 6 5 7 6 function P.onLoad() 8 P.multiplayerMode = "startClient" 7 P.multiplayerMode = "startClient" 9 8 10 9 --buttons are arranged in a 3x1 matrix: 11 local item = { 10 P:initButtons(3, 1) 11 12 P:setButton(1, 1, { 12 13 ["button"] = winMgr:getWindow("orxonox/MouseControlsButton"), 13 ["function"] = P.ControlsMouseControlsButton_clicked 14 } 15 P.buttonList[1] = item 14 ["callback"] = P.ControlsMouseControlsButton_clicked 15 }) 16 16 17 local item ={17 P:setButton(2, 1, { 18 18 ["button"] = winMgr:getWindow("orxonox/KeybindingsButton"), 19 ["function"] = P.ControlsKeyboardControlsButton_clicked 20 } 21 P.buttonList[2] = item 19 ["callback"] = P.ControlsKeyboardControlsButton_clicked 20 }) 22 21 23 local item ={22 P:setButton(3, 1, { 24 23 ["button"] = winMgr:getWindow("orxonox/ControlsBackButton"), 25 ["function"] = P.ControlsBackButton_clicked 26 } 27 P.buttonList[3] = item 28 29 end 30 31 function P.onShow() 32 --indices to iterate through buttonlist 33 P.oldindex = -2 34 P.index = -1 24 ["callback"] = P.ControlsBackButton_clicked 25 }) 35 26 end 36 27 … … 47 38 end 48 39 49 function P.onKeyPressed()50 buttonIteratorHelper(P.buttonList, code, P, 3, 1)51 end52 53 40 return P 54 41
Note: See TracChangeset
for help on using the changeset viewer.