Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7876 for code/trunk/data/gui


Ignore:
Timestamp:
Feb 13, 2011, 5:49:41 PM (14 years ago)
Author:
dafrick
Message:

Extending startGame and similar console commands, now also the level to be started (or in case of startClient, the destination) can be specified (but doesn't have to).
Additionally startMainMenu is now in GSLevel and can only be executed in a Level, as opposed to only in the MainMenu as it was before.
Added changeGame console command which works in a level in standalone mode to change to a different level.

Location:
code/trunk/data/gui/scripts
Files:
3 edited

Legend:

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

    r7689 r7876  
    104104        local level = P.levelList[index+1]
    105105        if level ~= nil then
    106             orxonox.LevelManager:getInstance():setDefaultLevel(level:getXMLFilename())
    107             orxonox.execute(P.multiplayerMode)
     106            orxonox.execute(P.multiplayerMode .. " " .. level:getXMLFilename())
    108107            hideAllMenuSheets()
    109108        end
  • code/trunk/data/gui/scripts/MultiplayerMenu.lua

    r7801 r7876  
    7575
    7676function P.MultiplayerJoinButton_clicked(e)
    77     local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem()   
     77    local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem()
     78    local destination = nil
    7879    if choice then
    79         local client = orxonox.Client:getInstance()
    8080        local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID()
    81         client:setDestination( P.serverList[index][2], 55556 )
     81        destination = P.serverList[index][2]
    8282    else
    8383        return
    8484    end
    85     orxonox.execute("startClient")
     85    orxonox.execute("startClient " .. destination)
    8686    hideAllMenuSheets()
    8787end
  • code/trunk/data/gui/scripts/SingleplayerMenu.lua

    r7689 r7876  
    7474        local level = P.levelList[index+1]
    7575        if level ~= nil then
    76             orxonox.LevelManager:getInstance():setDefaultLevel(level:getXMLFilename())
    77             orxonox.execute("startGame")
     76            orxonox.execute("startGame " .. level:getXMLFilename())
    7877            hideAllMenuSheets()
    7978        end
Note: See TracChangeset for help on using the changeset viewer.