Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5165


Ignore:
Timestamp:
Aug 31, 2008, 10:28:56 PM (16 years ago)
Author:
rgrieder
Message:

added server/client button to main menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • data/Media/gui/scripts/loadGUI.lua

    r5164 r5165  
    1717quit:subscribeEvent("Clicked","button_quit_clicked")
    1818
    19 local start = winMgr:createWindow("TaharezLook/Button", "orxonox/StartButton")
    20 start:setText("Start")
    21 start:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
    22 start:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(0.3, 0)))
    23 start:subscribeEvent("Clicked","button_start_clicked")
     19local standalone = winMgr:createWindow("TaharezLook/Button", "orxonox/StandaloneButton")
     20standalone:setText("Standalone")
     21standalone:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
     22standalone:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(0.3, 0)))
     23standalone:subscribeEvent("Clicked","button_standalone_clicked")
     24
     25local server = winMgr:createWindow("TaharezLook/Button", "orxonox/ServerButton")
     26server:setText("Server")
     27server:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
     28server:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(0.4, 0)))
     29server:subscribeEvent("Clicked","button_server_clicked")
     30
     31local client = winMgr:createWindow("TaharezLook/Button", "orxonox/ClientButton")
     32client:setText("Client")
     33client:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
     34client:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(0.5, 0)))
     35client:subscribeEvent("Clicked","button_client_clicked")
    2436
    2537local backgroundImage = CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile("GUI/Background", "sample_loading.jpg")
     
    2941
    3042rootSheet:addChildWindow(quit)
    31 rootSheet:addChildWindow(start)
     43rootSheet:addChildWindow(standalone)
     44rootSheet:addChildWindow(server)
     45rootSheet:addChildWindow(client)
    3246background:addChildWindow(rootSheet)
    3347
     
    3852end
    3953
    40 function button_start_clicked(e)
     54function button_standalone_clicked(e)
    4155  orxonox.CommandExecutor:execute("selectGameState standalone")
    4256  hideGUI()
    43   --orxonox.CommandExecutor:execute("openConsole")
     57end
     58
     59function button_server_clicked(e)
     60  orxonox.CommandExecutor:execute("selectGameState server")
     61  hideGUI()
     62end
     63
     64function button_client_clicked(e)
     65  orxonox.CommandExecutor:execute("selectGameState client")
     66  hideGUI()
    4467end
    4568
Note: See TracChangeset for help on using the changeset viewer.