- Timestamp:
- Feb 20, 2011, 12:47:57 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/data/gui/scripts/SettingsMenu.lua
r7689 r7922 4 4 P.loadAlong = { "ControlsMenu", "AudioMenu", "GraphicsMenu" } 5 5 6 P.buttonList = {}7 8 6 function P.onLoad() 9 7 --"Gameplay" and "Multiplayer Options" are not integrated in the list 10 8 --buttons are arranged in a 4x2 matrix. The lower-right element is not in the matrix! 11 local item = { 9 P:initButtons(4, 2) 10 11 P:setButton(1, 2, { 12 12 ["button"] = winMgr:getWindow("orxonox/SettingsMenu/GraphicsButton"), 13 ["function"] = P.SettingsGraphicsButton_clicked 14 } 15 P.buttonList[2] = item 13 ["callback"] = P.SettingsGraphicsButton_clicked 14 }) 16 15 17 local item ={16 P:setButton(2, 2, { 18 17 ["button"] = winMgr:getWindow("orxonox/SettingsMenu/AudioButton"), 19 ["function"] = P.SettingsAudioButton_clicked 20 } 21 P.buttonList[4] = item 18 ["callback"] = P.SettingsAudioButton_clicked 19 }) 22 20 21 P:setButton(3, 1, { 22 ["button"] = winMgr:getWindow("orxonox/SettingsMenu/ControlsButton"), 23 ["callback"] = P.SettingsControlsButton_clicked 24 }) 23 25 24 local item = { 25 ["button"] = winMgr:getWindow("orxonox/SettingsMenu/ControlsButton"), 26 ["function"] = P.SettingsControlsButton_clicked 27 } 28 P.buttonList[5] = item 26 P:setButton(3, 2, { 27 ["button"] = winMgr:getWindow("orxonox/SettingsMenu/MiscellaneousButton"), 28 ["callback"] = P.SettingsMiscellaneousButton_clicked 29 }) 29 30 30 local item = { 31 ["button"] = winMgr:getWindow("orxonox/SettingsMenu/MiscellaneousButton"), 32 ["function"] = P.SettingsMiscellaneousButton_clicked 33 } 34 P.buttonList[6] = item 35 36 local item = { 31 P:setButton(4, 1, { 37 32 ["button"] = winMgr:getWindow("orxonox/SettingsMenu/SettingsBackButton"), 38 ["function"] = P.SettingsBackButton_clicked 39 } 40 P.buttonList[7] = item 41 42 end 43 44 function P.onShow() 45 --indices to iterate through buttonlist 46 P.oldindex = 3 47 P.index = 2 33 ["callback"] = P.SettingsBackButton_clicked 34 }) 48 35 end 49 36 … … 76 63 end 77 64 78 function P.onKeyPressed()79 buttonIteratorHelper(P.buttonList, code, P, 4, 2)80 end81 82 65 return P 83 66
Note: See TracChangeset
for help on using the changeset viewer.