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