Changeset 5414 for data/media/gui/scripts/loadGUI.lua
- Timestamp:
- Mar 21, 2009, 1:10:54 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/media/gui/scripts/loadGUI.lua
r5412 r5414 9 9 10 10 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 11 local mainmenu = winMgr:loadWindowLayout("MainMenu.layout") 52 12 53 13 local backgroundImage = CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile("GUI/Background", "main_menu_1.jpg") … … 57 17 background:setProperty("Image", "set: GUI/Background image:full_image") 58 18 59 rootSheet:addChildWindow(quit) 60 rootSheet:addChildWindow(standalone) 61 rootSheet:addChildWindow(server) 62 rootSheet:addChildWindow(dedicated) 63 rootSheet:addChildWindow(client) 64 background:addChildWindow(rootSheet) 19 background:addChildWindow(mainmenu) 65 20 66 21 … … 90 45 end 91 46 92 showBackground = false47 showBackground = true 93 48 94 49 function showMainMenu() … … 96 51 system:setGUISheet(background) 97 52 else 98 system:setGUISheet(rootSheet) 53 orxonox.GUIManager:getInstance():testOutput("set new Menu") 54 system:setGUISheet(mainmenu) 99 55 end 100 56 return 0; 101 57 end 102 58 59 showing = true 60 61 function 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 71 end 72 103 73 function hideGUI() 104 74 --system:setGUISheet(nil) 105 orxonox.GUIManager:getInstance():hideGUI()75 --orxonox.GUIManager:getInstance():hideGUI() 106 76 end
Note: See TracChangeset
for help on using the changeset viewer.