Changeset 8079 for code/trunk/data/gui/scripts/MainMenu.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/MainMenu.lua
r7689 r8079 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:setButton(1, 1, { 11 9 ["button"] = winMgr:getWindow("orxonox/QuickGameTestButton"), 12 ["function"] = P.QuickGameTestButton_clicked 13 } 14 table.insert(P.buttonList,item) 10 ["callback"] = P.QuickGameTestButton_clicked 11 }) 15 12 16 item ={13 P:setButton(2, 1, { 17 14 ["button"] = winMgr:getWindow("orxonox/SingleplayerButton"), 18 ["function"] = P.SingleplayerButton_clicked 19 } 20 table.insert(P.buttonList,item) 15 ["callback"] = P.SingleplayerButton_clicked 16 }) 21 17 22 item ={18 P:setButton(3, 1, { 23 19 ["button"] = winMgr:getWindow("orxonox/MultiplayerButton"), 24 ["function"] = P.MultiplayerButton_clicked 25 } 26 table.insert(P.buttonList,item) 20 ["callback"] = P.MultiplayerButton_clicked 21 }) 27 22 28 item ={23 P:setButton(4, 1, { 29 24 ["button"] = winMgr:getWindow("orxonox/SettingsButton"), 30 ["function"] = P.SettingsButton_clicked 31 } 32 table.insert(P.buttonList,item) 25 ["callback"] = P.SettingsButton_clicked 26 }) 33 27 34 item ={28 P:setButton(5, 1, { 35 29 ["button"] = winMgr:getWindow("orxonox/CreditsButton"), 36 ["function"] = P.CreditsButton_clicked 37 } 38 table.insert(P.buttonList,item) 30 ["callback"] = P.CreditsButton_clicked 31 }) 39 32 40 item ={33 P:setButton(6, 1, { 41 34 ["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 35 ["callback"] = P.ExitButton_clicked 36 }) 51 37 end 52 38 … … 77 63 end 78 64 79 function P.onKeyPressed()80 buttonIteratorHelper(P.buttonList, code, P, 6, 1)81 end82 83 65 return P 84 66
Note: See TracChangeset
for help on using the changeset viewer.