Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6176


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

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

Location:
code/branches/presentation2/data/gui/scripts
Files:
3 edited

Legend:

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

    r6153 r6176  
    161161end
    162162
     163function hideAllGUIs()
     164    while nrOfActiveSheets ~= 0 do
     165        hideGUI(activeSheets[nrOfActiveSheets])
     166    end
     167end
     168
    163169function keyESC()
    164170    if nrOfActiveSheets > 0 then
  • 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
  • code/branches/presentation2/data/gui/scripts/NewSingleplayerMenu.lua

    r6150 r6176  
    3939
    4040function P.SingleplayerStartButton_clicked(e)
    41     -- start game
    42     debug("event: start")
     41    choice = winMgr:getWindow("orxonox/SingleplayerLevelListbox"):getFirstSelectedItem()
     42    if choice then
     43        orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
     44        orxonox.CommandExecutor:execute("startGame")
     45        hideAllGUIs()
     46        debug("event: start")
     47    end
    4348end
    4449
Note: See TracChangeset for help on using the changeset viewer.