local schemeMgr = CEGUI.SchemeManager:getSingleton() local winMgr = CEGUI.WindowManager:getSingleton() local logger = CEGUI.Logger:getSingleton() local system = CEGUI.System:getSingleton() schemeMgr:loadScheme("TaharezLookSkin.scheme") system:setDefaultMouseCursor("TaharezLook", "MouseArrow") system:setDefaultFont("BlueHighway-12") local rootSheet = winMgr:createWindow("DefaultGUISheet", "orxonox/Sheet") local quit = winMgr:createWindow("TaharezLook/Button", "orxonox/QuitButton") quit:setText("Quit") quit:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0))) quit:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(0.6, 0))) quit:subscribeEvent("Clicked","button_quit_clicked") local standalone = winMgr:createWindow("TaharezLook/Button", "orxonox/StandaloneButton") standalone:setText("Standalone") standalone:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0))) standalone:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(0.3, 0))) standalone:subscribeEvent("Clicked","button_standalone_clicked") local server = winMgr:createWindow("TaharezLook/Button", "orxonox/ServerButton") server:setText("Server") server:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0))) server:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(0.4, 0))) server:subscribeEvent("Clicked","button_server_clicked") local client = winMgr:createWindow("TaharezLook/Button", "orxonox/ClientButton") client:setText("Client") client:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0))) client:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(0.5, 0))) client:subscribeEvent("Clicked","button_client_clicked") local backgroundImage = CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile("GUI/Background", "sample_loading.jpg") local background = winMgr:createWindow("TaharezLook/StaticImage", "orxonox/Background") background:setProperty("Image", "set: GUI/Background image:full_image") background:subscribeEvent("CharacterKey", "key_pressed") rootSheet:addChildWindow(quit) rootSheet:addChildWindow(standalone) rootSheet:addChildWindow(server) rootSheet:addChildWindow(client) background:addChildWindow(rootSheet) function button_quit_clicked(e) hideGUI() orxonox.CommandExecutor:execute("exit") end function button_standalone_clicked(e) orxonox.CommandExecutor:execute("selectGameState standalone") hideGUI() end function button_server_clicked(e) orxonox.CommandExecutor:execute("selectGameState server") hideGUI() end function button_client_clicked(e) orxonox.CommandExecutor:execute("selectGameState client") hideGUI() end function key_pressed(e) keyevent = tolua.cast(e, "CEGUI::KeyEventArgs") if keyevent.codepoint == 167 then orxonox.CommandExecutor:execute("openConsole") end end showBackground = false function showMainMenu() if showBackground == true then system:setGUISheet(background) else system:setGUISheet(rootSheet) end return 0; end function hideGUI() system:setGUISheet(nil) orxonox.GUIManager:getInstance():hideGUI() end