Last change
on this file since 7155 was
6403,
checked in by rgrieder, 15 years ago
|
Added lua convenience function for console commmands: orxonox.execute(cmd)
Also replaced the config commands with the actual orxonox.config function.
|
-
Property svn:eol-style set to
native
|
File size:
923 bytes
|
Rev | Line | |
---|
[6018] | 1 | -- InGameMenu.lua |
---|
| 2 | |
---|
| 3 | BasicGUI = require("BasicGUI") |
---|
| 4 | local P = BasicGUI:new() --inherit everything from the gui package |
---|
| 5 | if _REQUIREDNAME == nil then |
---|
| 6 | InGameMenu = P |
---|
| 7 | else |
---|
| 8 | _G[_REQUIREDNAME] = P |
---|
| 9 | end |
---|
| 10 | |
---|
| 11 | P.filename = "InGameMenu" |
---|
| 12 | P.layoutString = "InGameMenu.layout" |
---|
| 13 | |
---|
| 14 | function P:init() |
---|
| 15 | end |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | -- events for ingamemenu |
---|
| 19 | function P.button_quit_clicked(e) |
---|
[6048] | 20 | openDecisionPopup( "Do you really want to quit the game?", InGameMenu.callback ) |
---|
[6018] | 21 | end |
---|
| 22 | |
---|
| 23 | function P.button_mainmenu_clicked(e) |
---|
[6019] | 24 | orxonox.Game:getInstance():popState() |
---|
| 25 | orxonox.Game:getInstance():popState() |
---|
| 26 | orxonox.Game:getInstance():requestState("mainmenu") |
---|
[6217] | 27 | hideGUI("InGameMenu") |
---|
[6018] | 28 | end |
---|
| 29 | |
---|
[6217] | 30 | function P.button_settings_clicked(e) |
---|
| 31 | showGUI("SettingsMenu", true) |
---|
| 32 | end |
---|
| 33 | |
---|
[6019] | 34 | function P.button_return_clicked(e) |
---|
[6217] | 35 | hideGUI("InGameMenu") |
---|
[6019] | 36 | end |
---|
| 37 | |
---|
[6048] | 38 | function P.callback(doExit) |
---|
| 39 | if doExit then |
---|
[6217] | 40 | hideGUI("InGameMenu") |
---|
[6403] | 41 | orxonox.execute("exit") |
---|
[6048] | 42 | end |
---|
| 43 | end |
---|
| 44 | |
---|
[6018] | 45 | return P |
---|
| 46 | |
---|
Note: See
TracBrowser
for help on using the repository browser.