Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5414


Ignore:
Timestamp:
Mar 21, 2009, 1:10:54 AM (16 years ago)
Author:
bknecht
Message:

Removed layout information to actual .layout file and leaving functions and script stuff in the lua-file. There is still some work to do to properly load layouts and call the correct functions, but it's more cleaned up now, but also more spread of corse.

Location:
data/media/gui
Files:
1 added
1 edited

Legend:

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

    r5412 r5414  
    99
    1010
    11 local rootSheet = winMgr:createWindow("DefaultGUISheet", "orxonox/Sheet")
    12 
    13 local leftOffset = 0.11
    14 local topOffset  = 0.3
    15 local distance   = 0.076
    16 local index      = 0
    17 
    18 local standalone = winMgr:createWindow("TaharezLook/Button", "orxonox/StandaloneButton")
    19 standalone:setText("Standalone")
    20 standalone:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
    21 standalone:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
    22 standalone:subscribeEvent("Clicked","button_standalone_clicked")
    23 index = index + 1
    24 
    25 local dedicated = winMgr:createWindow("TaharezLook/Button", "orxonox/DedicatedButton")
    26 dedicated:setText("Dedicated")
    27 dedicated:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
    28 dedicated:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
    29 dedicated:subscribeEvent("Clicked","button_dedicated_clicked")
    30 index = index + 1
    31 
    32 local server = winMgr:createWindow("TaharezLook/Button", "orxonox/ServerButton")
    33 server:setText("Server")
    34 server:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
    35 server:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
    36 server:subscribeEvent("Clicked","button_server_clicked")
    37 index = index + 1
    38 
    39 local client = winMgr:createWindow("TaharezLook/Button", "orxonox/ClientButton")
    40 client:setText("Client")
    41 client:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
    42 client:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
    43 client:subscribeEvent("Clicked","button_client_clicked")
    44 index = index + 1
    45 
    46 local quit = winMgr:createWindow("TaharezLook/Button", "orxonox/QuitButton")
    47 quit:setText("Quit")
    48 quit:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0)))
    49 quit:setPosition(CEGUI.UVector2(CEGUI.UDim(leftOffset, 0), CEGUI.UDim(topOffset + index * distance, 0)))
    50 quit:subscribeEvent("Clicked","button_quit_clicked")
    51 index = index + 1
     11local mainmenu =  winMgr:loadWindowLayout("MainMenu.layout")
    5212
    5313local backgroundImage = CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile("GUI/Background", "main_menu_1.jpg")
     
    5717background:setProperty("Image", "set: GUI/Background image:full_image")
    5818
    59 rootSheet:addChildWindow(quit)
    60 rootSheet:addChildWindow(standalone)
    61 rootSheet:addChildWindow(server)
    62 rootSheet:addChildWindow(dedicated)
    63 rootSheet:addChildWindow(client)
    64 background:addChildWindow(rootSheet)
     19background:addChildWindow(mainmenu)
    6520
    6621
     
    9045end
    9146
    92 showBackground = false
     47showBackground = true
    9348
    9449function showMainMenu()
     
    9651    system:setGUISheet(background)
    9752  else
    98     system:setGUISheet(rootSheet)
     53    orxonox.GUIManager:getInstance():testOutput("set new Menu")
     54    system:setGUISheet(mainmenu)
    9955  end
    10056  return 0;
    10157end
    10258
     59showing = true
     60
     61function toggleGUI()
     62    if showing == true then
     63        mainmenu:hide()
     64        showing = false
     65        orxonox.GUIManager:getInstance():testOutput("hiding Menu")
     66    else
     67        mainmenu:show()
     68        showing = true
     69        orxonox.GUIManager:getInstance():testOutput("showing Menu")
     70    end
     71end
     72
    10373function hideGUI()
    10474  --system:setGUISheet(nil)
    105   orxonox.GUIManager:getInstance():hideGUI()
     75  --orxonox.GUIManager:getInstance():hideGUI()
    10676end
Note: See TracChangeset for help on using the changeset viewer.