1 | local schemeMgr = CEGUI.SchemeManager:getSingleton() |
---|
2 | local winMgr = CEGUI.WindowManager:getSingleton() |
---|
3 | local logger = CEGUI.Logger:getSingleton() |
---|
4 | local system = CEGUI.System:getSingleton() |
---|
5 | |
---|
6 | schemeMgr:loadScheme("TaharezLookSkin.scheme") |
---|
7 | system:setDefaultMouseCursor("TaharezLook", "MouseArrow") |
---|
8 | system:setDefaultFont("BlueHighway-12") |
---|
9 | |
---|
10 | |
---|
11 | local rootSheet = winMgr:createWindow("DefaultGUISheet", "orxonox/Sheet") |
---|
12 | |
---|
13 | local quit = winMgr:createWindow("TaharezLook/Button", "orxonox/QuitButton") |
---|
14 | quit:setText("Quit") |
---|
15 | quit:setSize(CEGUI.UVector2(CEGUI.UDim(0.15, 0), CEGUI.UDim(0.05, 0))) |
---|
16 | quit:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(0.6, 0))) |
---|
17 | quit:subscribeEvent("Clicked","button_quit_clicked") |
---|
18 | |
---|
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.4, 0))) |
---|
23 | start:subscribeEvent("Clicked","button_start_clicked") |
---|
24 | |
---|
25 | local backgroundImage = CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile("GUI/Background", "sample_loading.jpg") |
---|
26 | local background = winMgr:createWindow("TaharezLook/StaticImage", "orxonox/Background") |
---|
27 | background:setProperty("Image", "set: GUI/Background image:full_image") |
---|
28 | |
---|
29 | rootSheet:addChildWindow(quit) |
---|
30 | rootSheet:addChildWindow(start) |
---|
31 | background:addChildWindow(rootSheet) |
---|
32 | |
---|
33 | |
---|
34 | function button_quit_clicked(e) |
---|
35 | orxonox.CommandExecutor:execute("exit") |
---|
36 | end |
---|
37 | |
---|
38 | function button_start_clicked(e) |
---|
39 | --orxonox.CommandExecutor:execute("loadGame standalone") |
---|
40 | hideGUI() |
---|
41 | orxonox.CommandExecutor:execute("openConsole") |
---|
42 | end |
---|
43 | |
---|
44 | local showBackground = false |
---|
45 | |
---|
46 | function showMainMenu() |
---|
47 | if showBackground == true then |
---|
48 | system:setGUISheet(background) |
---|
49 | else |
---|
50 | system:setGUISheet(rootSheet) |
---|
51 | end |
---|
52 | return 0; |
---|
53 | end |
---|
54 | |
---|
55 | function hideGUI() |
---|
56 | system:setGUISheet(nil) |
---|
57 | orxonox.GUIManager:getInstance():_hideGUI() |
---|
58 | end |
---|