Changeset 7922 for code/branches/usability/data/gui/scripts/MainMenu.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/MainMenu.lua
r7689 r7922 4 4 P.loadAlong = { "SingleplayerMenu", "MultiplayerMenu", "SettingsMenu", "CreditsMenu" } 5 5 6 P.buttonList = {}7 8 6 function P.onLoad() 9 7 --buttons are arranged in a 6x1 Matrix (list) 10 local item = { 8 P:initButtons(6, 1) 9 10 P:setButton(1, 1, { 11 11 ["button"] = winMgr:getWindow("orxonox/QuickGameTestButton"), 12 ["function"] = P.QuickGameTestButton_clicked 13 } 14 table.insert(P.buttonList,item) 12 ["callback"] = P.QuickGameTestButton_clicked 13 }) 15 14 16 item ={15 P:setButton(2, 1, { 17 16 ["button"] = winMgr:getWindow("orxonox/SingleplayerButton"), 18 ["function"] = P.SingleplayerButton_clicked 19 } 20 table.insert(P.buttonList,item) 17 ["callback"] = P.SingleplayerButton_clicked 18 }) 21 19 22 item ={20 P:setButton(3, 1, { 23 21 ["button"] = winMgr:getWindow("orxonox/MultiplayerButton"), 24 ["function"] = P.MultiplayerButton_clicked 25 } 26 table.insert(P.buttonList,item) 22 ["callback"] = P.MultiplayerButton_clicked 23 }) 27 24 28 item ={25 P:setButton(4, 1, { 29 26 ["button"] = winMgr:getWindow("orxonox/SettingsButton"), 30 ["function"] = P.SettingsButton_clicked 31 } 32 table.insert(P.buttonList,item) 27 ["callback"] = P.SettingsButton_clicked 28 }) 33 29 34 item ={30 P:setButton(5, 1, { 35 31 ["button"] = winMgr:getWindow("orxonox/CreditsButton"), 36 ["function"] = P.CreditsButton_clicked 37 } 38 table.insert(P.buttonList,item) 32 ["callback"] = P.CreditsButton_clicked 33 }) 39 34 40 item ={35 P:setButton(6, 1, { 41 36 ["button"] = winMgr:getWindow("orxonox/ExitButton"), 42 ["function"] = P.ExitButton_clicked 43 } 44 table.insert(P.buttonList,item) 45 end 46 47 function P.onShow() 48 --indices to iterate through buttonlist 49 P.oldindex = -2 50 P.index = -1 37 ["callback"] = P.ExitButton_clicked 38 }) 51 39 end 52 40 … … 77 65 end 78 66 79 function P.onKeyPressed()80 buttonIteratorHelper(P.buttonList, code, P, 6, 1)81 end82 83 67 return P 84 68
Note: See TracChangeset
for help on using the changeset viewer.