Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 29, 2009, 1:36:12 PM (14 years ago)
Author:
dafrick
Message:

Made NewMultiplayerMenu and NewSingleplayerMenu work. Also added hideALLGUIs functionality in InitialiseGUI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/data/gui/scripts/NewMultiplayerMenu.lua

    r6150 r6176  
    2020    local level = ""
    2121    while true do
    22       level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
    23       if level == "" then
    24         break
    25       end
    26       table.insert(levelList, level)
    27       index = index + 1
     22        level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
     23        if level == "" then
     24            break
     25        end
     26        table.insert(levelList, level)
     27        index = index + 1
    2828    end
    2929    table.sort(levelList)
     
    3838    local multiplayerMode = "startClient"
    3939    if multiplayerMode == "startClient" then
    40         window = winMgr:getWindow("orxonox/MultiplayerJoinButton")
    41         button = tolua.cast(window,"CEGUI::RadioButton")
     40        window = winMgr:getWindow("orxonox/MultiplayerJoinButton")
     41        button = tolua.cast(window,"CEGUI::RadioButton")
    4242        button:setSelected(true)
    4343    end
    4444    if multiplayerMode == "startServer" then
    45         window = winMgr:getWindow("orxonox/MultiplayerHostButton")
    46         button = tolua.cast(window,"CEGUI::RadioButton")
     45        window = winMgr:getWindow("orxonox/MultiplayerHostButton")
     46        button = tolua.cast(window,"CEGUI::RadioButton")
    4747        button:setSelected(true)
    4848    end
    4949    if multiplayerMode == "startDedicated" then
    50         window = winMgr:getWindow("orxonox/MultiplayerDedicatedButton")
    51         button = tolua.cast(window,"CEGUI::RadioButton")
     50        window = winMgr:getWindow("orxonox/MultiplayerDedicatedButton")
     51        button = tolua.cast(window,"CEGUI::RadioButton")
    5252        button:setSelected(true)
    5353    end
     
    7070
    7171function P.MultiplayerStartButton_clicked(e)
    72     orxonox.CommandExecutor:execute(multiplayerMode)
    73     debug("event: start")
     72    local choice = winMgr:getWindow("orxonox/MultiplayerLevelListbox"):getFirstSelectedItem()
     73    if choice then
     74        orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
     75        orxonox.CommandExecutor:execute(multiplayerMode)
     76        hideAllGUIs()
     77        debug("event: start")
     78    end
    7479end
    7580
Note: See TracChangeset for help on using the changeset viewer.