Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 8, 2010, 4:54:58 PM (14 years ago)
Author:
dafrick
Message:

Server discovery just once insetad of (redundantly) twice.

File:
1 edited

Legend:

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

    r7739 r7741  
    66
    77--joinMode is 1 for choice "LAN" and 2 for "Internet"
    8 --initial status 0
    9 P.joinMode = 0
     8--initial status 1
     9P.joinMode = 1
    1010
    1111function P.onLoad()
     
    3333
    3434function P.onShow()
    35     P.showServerList()
     35    --P.showServerList()
    3636
    3737    --indices to iterate through buttonlist
    3838    P.oldindex = -2
    3939    P.index = -1
     40   
     41    if P.joinMode == 1 then
     42        local window = winMgr:getWindow("orxonox/MultiplayerLanButton")
     43        local button = tolua.cast(window,"CEGUI::RadioButton")
     44        button:setSelected(true)
     45    end
     46    if P.joinMode == 2 then
     47        local window = winMgr:getWindow("orxonox/MultiplayerInternetButton")
     48        local button = tolua.cast(window,"CEGUI::RadioButton")
     49        button:setSelected(true)
     50    end
    4051end
    4152
    4253function P.LanButton_clicked(e)
     54    local we = CEGUI.toWindowEventArgs(e)
     55    local button = tolua.cast(we.window,"CEGUI::RadioButton")
    4356    P.joinMode = 1
    44         P.showServerList()
     57    if button:isSelected() == true then
     58            P.showServerList()
     59    end
    4560end
    4661
    4762function P.InternetButton_clicked(e)
     63    local we = CEGUI.toWindowEventArgs(e)
     64    local button = tolua.cast(we.window,"CEGUI::RadioButton")
    4865    P.joinMode = 2
    49         P.showServerList()
     66    if button:isSelected() == true then
     67            P.showServerList()
     68        end
    5069end
    5170
Note: See TracChangeset for help on using the changeset viewer.