Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/media/gui/scripts/mainmenu_2.lua @ 5523

Last change on this file since 5523 was 5523, checked in by bknecht, 15 years ago

small change improving the handling of the GUIs in Lua

File size: 1.0 KB
Line 
1-- mainmenu_2.lua
2gui = require("gui")
3local P = gui:new() --inherit everything from the gui package
4
5mainmenu_2 = P
6
7P.filename = "mainmenu_2"
8P.layoutString = "MainMenu_2.layout"
9
10function P:init()
11    --win = winMgr:getWindow("orxonox/LevelListBox")
12    --print(win.getItemCount())
13    --item = winMgr:createWindow("TaharezLook/ListboxItem", "orxonox/LevelListBoxItem1")
14    --item:setText("HiHo")
15    --win:addItem(item)
16    --print(win:getItemCount())
17end
18
19
20-- events for mainmenu
21function P.button_quit_clicked(e)
22  hideGUI()
23  orxonox.CommandExecutor:execute("exit")
24end
25
26function P.button_standalone_clicked(e)
27  orxonox.CommandExecutor:execute("startGame")
28  toggleGUI()
29end
30
31function P.button_server_clicked(e)
32  orxonox.CommandExecutor:execute("echo Not yet supported!")
33  hideGUI()
34end
35
36function P.button_dedicated_clicked(e)
37  orxonox.CommandExecutor:execute("echo Not yet supported!")
38  hideGUI()
39end
40
41function P.button_client_clicked(e)
42  orxonox.CommandExecutor:execute("echo Not yet supported!")
43  hideGUI()
44end
45
46return mainmenu_2
47
Note: See TracBrowser for help on using the repository browser.