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 mainmenu = winMgr:loadWindowLayout("MainMenu.layout") |
---|
12 | |
---|
13 | local backgroundImage = CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile("GUI/Background", "main_menu_1.jpg") |
---|
14 | local background = winMgr:createWindow("TaharezLook/StaticImage", "orxonox/Background") |
---|
15 | background:setProperty("FrameEnabled", "set: true") |
---|
16 | background:setProperty("BackgroundEnabled", "set: false") |
---|
17 | background:setProperty("Image", "set: GUI/Background image:full_image") |
---|
18 | |
---|
19 | background:addChildWindow(mainmenu) |
---|
20 | |
---|
21 | |
---|
22 | function button_quit_clicked(e) |
---|
23 | hideGUI() |
---|
24 | orxonox.CommandExecutor:execute("exit") |
---|
25 | end |
---|
26 | |
---|
27 | function button_standalone_clicked(e) |
---|
28 | orxonox.CommandExecutor:execute("selectGameState standalone") |
---|
29 | hideGUI() |
---|
30 | end |
---|
31 | |
---|
32 | function button_server_clicked(e) |
---|
33 | orxonox.CommandExecutor:execute("selectGameState server") |
---|
34 | hideGUI() |
---|
35 | end |
---|
36 | |
---|
37 | function button_dedicated_clicked(e) |
---|
38 | orxonox.CommandExecutor:execute("selectGameState dedicated") |
---|
39 | hideGUI() |
---|
40 | end |
---|
41 | |
---|
42 | function button_client_clicked(e) |
---|
43 | orxonox.CommandExecutor:execute("selectGameState client") |
---|
44 | hideGUI() |
---|
45 | end |
---|
46 | |
---|
47 | showBackground = true |
---|
48 | |
---|
49 | function showMainMenu() |
---|
50 | if showBackground == true then |
---|
51 | system:setGUISheet(background) |
---|
52 | else |
---|
53 | orxonox.GUIManager:getInstance():testOutput("set new Menu") |
---|
54 | system:setGUISheet(mainmenu) |
---|
55 | end |
---|
56 | return 0; |
---|
57 | end |
---|
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 | |
---|
73 | function hideGUI() |
---|
74 | --system:setGUISheet(nil) |
---|
75 | --orxonox.GUIManager:getInstance():hideGUI() |
---|
76 | end |
---|