Changeset 7732 for code/trunk/data/gui/scripts/MultiplayerMenu.lua
- Timestamp:
- Dec 8, 2010, 3:29:28 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/data/gui/scripts/MultiplayerMenu.lua
r7690 r7732 4 4 5 5 P.buttonList = {} 6 7 --joinMode is 1 for choice "LAN" and 2 for "Internet" 8 --initial status 0 9 P.joinMode = 0 6 10 7 11 function P.onLoad() … … 26 30 } 27 31 P.buttonList[4] = item 28 29 32 end 30 33 … … 37 40 end 38 41 42 function P.LanButton_clicked(e) 43 P.joinMode = 1 44 end 45 46 function P.InternetButton_clicked(e) 47 P.joinMode = 2 48 end 49 39 50 function P.MultiplayerHostButton_clicked(e) 40 51 showMenuSheet("HostMenu", true) … … 43 54 44 55 function P.MultiplayerJoinButton_clicked(e) 45 local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem() 46 if choice then 47 local client = orxonox.Client:getInstance() 48 local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID() 49 client:setDestination( P.serverList[index][2], 55556 ) 56 local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem() 57 58 if P.joinMode == 2 then 59 if choice then 60 local client = orxonox.Client:getInstance() 61 local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID() 62 client:setDestination( P.serverList[index][2], 55556 ) 63 else 64 return 65 end 66 orxonox.execute("startClient") 67 hideAllMenuSheets() 50 68 else 51 return69 --wait for Sandro's function 52 70 end 53 orxonox.execute("startClient") 54 hideAllMenuSheets() 71 55 72 end 56 73
Note: See TracChangeset
for help on using the changeset viewer.