Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/gamestate/data/gui/scripts/InGameMenu.lua @ 6518

Last change on this file since 6518 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
Line 
1-- InGameMenu.lua
2
3BasicGUI = require("BasicGUI")
4local P = BasicGUI:new("InGameMenu")
5if _REQUIREDNAME == nil then
6    InGameMenu = P
7else
8    _G[_REQUIREDNAME] = P
9end
10
11
12function P:init()
13end
14
15
16-- events for ingamemenu
17function P.button_quit_clicked(e)
18    openDecisionPopup( "Do you really want to quit the game?", InGameMenu.callback )
19end
20
21function P.button_mainmenu_clicked(e)
22    orxonox.Game:getInstance():popState()
23    orxonox.Game:getInstance():popState()
24    orxonox.Game:getInstance():requestState("mainmenu")
25    hideGUI("InGameMenu")
26end
27
28function P.button_settings_clicked(e)
29    showGUI("SettingsMenu", true)
30end
31
32function P.button_return_clicked(e)
33    hideGUI("InGameMenu")
34end
35
36function P.callback(doExit)
37    if doExit then
38        hideGUI("InGameMenu")
39        orxonox.execute("exit")
40    end
41end
42
43return P
44
Note: See TracBrowser for help on using the repository browser.