Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 27, 2010, 1:11:24 PM (14 years ago)
Author:
konrad
Message:

changes in the multiplayer menu, 2 buttons instead of 3: host and join separated.

File:
1 edited

Legend:

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

    r7163 r7587  
    88
    99function P.onShow()
    10     if P.multiplayerMode == "startClient" then
    11         local window = winMgr:getWindow("orxonox/MultiplayerJoinButton")
    12         local button = tolua.cast(window,"CEGUI::RadioButton")
    13         button:setSelected(true)
    14         P.showServerList()
    15     end
    16     if P.multiplayerMode == "startServer" then
    17         local window = winMgr:getWindow("orxonox/MultiplayerHostButton")
    18         local button = tolua.cast(window,"CEGUI::RadioButton")
    19         button:setSelected(true)
    20         P.showLevelList()
    21     end
    22     if P.multiplayerMode == "startDedicated" then
    23         local window = winMgr:getWindow("orxonox/MultiplayerDedicatedButton")
    24         local button = tolua.cast(window,"CEGUI::RadioButton")
    25         button:setSelected(true)
    26         P.showLevelList()
    27     end
     10    P.showServerList()
    2811end
    2912
     
    4326end
    4427
    45 function P.MultiplayerStartButton_clicked(e)
     28function P.MultiplayerHostButton2_clicked(e)
     29    showMenuSheet("HostMenu", true)
     30end
     31
     32
     33function P.MultiplayerJoinButton2_clicked(e)
    4634    local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem()
    47     if P.multiplayerMode == "startClient" then
    48         if choice then
    49             local client = orxonox.Client:getInstance()
    50             local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID()
    51             client:setDestination( P.serverList[index][2], 55556 )
    52         else
    53             return
    54         end
     35    if choice then
     36        local client = orxonox.Client:getInstance()
     37        local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID()
     38        client:setDestination( P.serverList[index][2], 55556 )
    5539    else
    56         if choice then
    57             orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
    58         else
    59             return
    60         end
     40        return
    6141    end
    62     orxonox.execute(P.multiplayerMode)
     42    orxonox.execute("startClient")
    6343    hideAllMenuSheets()
    6444end
Note: See TracChangeset for help on using the changeset viewer.