Last change
on this file since 6519 was
6459,
checked in by rgrieder, 15 years ago
|
Simplified BasicGUI construction. Just give the name of the GUI as argument. The rest will be deduced.
|
-
Property svn:eol-style set to
native
|
File size:
830 bytes
|
Rev | Line | |
---|
[6018] | 1 | -- InGameMenu.lua |
---|
| 2 | |
---|
| 3 | BasicGUI = require("BasicGUI") |
---|
[6459] | 4 | local P = BasicGUI:new("InGameMenu") |
---|
[6018] | 5 | if _REQUIREDNAME == nil then |
---|
| 6 | InGameMenu = P |
---|
| 7 | else |
---|
| 8 | _G[_REQUIREDNAME] = P |
---|
| 9 | end |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | function P:init() |
---|
| 13 | end |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | -- events for ingamemenu |
---|
| 17 | function P.button_quit_clicked(e) |
---|
[6048] | 18 | openDecisionPopup( "Do you really want to quit the game?", InGameMenu.callback ) |
---|
[6018] | 19 | end |
---|
| 20 | |
---|
| 21 | function P.button_mainmenu_clicked(e) |
---|
[6019] | 22 | orxonox.Game:getInstance():popState() |
---|
| 23 | orxonox.Game:getInstance():popState() |
---|
| 24 | orxonox.Game:getInstance():requestState("mainmenu") |
---|
[6217] | 25 | hideGUI("InGameMenu") |
---|
[6018] | 26 | end |
---|
| 27 | |
---|
[6217] | 28 | function P.button_settings_clicked(e) |
---|
| 29 | showGUI("SettingsMenu", true) |
---|
| 30 | end |
---|
| 31 | |
---|
[6019] | 32 | function P.button_return_clicked(e) |
---|
[6217] | 33 | hideGUI("InGameMenu") |
---|
[6019] | 34 | end |
---|
| 35 | |
---|
[6048] | 36 | function P.callback(doExit) |
---|
| 37 | if doExit then |
---|
[6217] | 38 | hideGUI("InGameMenu") |
---|
[6403] | 39 | orxonox.execute("exit") |
---|
[6048] | 40 | end |
---|
| 41 | end |
---|
| 42 | |
---|
[6018] | 43 | return P |
---|
| 44 | |
---|
Note: See
TracBrowser
for help on using the repository browser.