Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 8, 2010, 3:29:28 PM (13 years ago)
Author:
konrad
Message:

Credits Menu is now scrollable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/data/gui/scripts/MultiplayerMenu.lua

    r7690 r7732  
    44
    55P.buttonList = {}
     6
     7--joinMode is 1 for choice "LAN" and 2 for "Internet"
     8--initial status 0
     9P.joinMode = 0
    610
    711function P.onLoad()
     
    2630    }
    2731    P.buttonList[4] = item
    28 
    2932end
    3033
     
    3740end
    3841
     42function P.LanButton_clicked(e)
     43    P.joinMode = 1
     44end
     45
     46function P.InternetButton_clicked(e)
     47    P.joinMode = 2
     48end
     49
    3950function P.MultiplayerHostButton_clicked(e)
    4051    showMenuSheet("HostMenu", true)
     
    4354
    4455function 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()
    5068    else
    51         return
     69        --wait for Sandro's function
    5270    end
    53     orxonox.execute("startClient")
    54     hideAllMenuSheets()
     71
    5572end
    5673
Note: See TracChangeset for help on using the changeset viewer.