Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/presentation2/data/gui/scripts/InGameMenu.lua @ 6176

Last change on this file since 6176 was 6150, checked in by scheusso, 15 years ago

merged menu branch to presentation2 branch with some additional fixes and features ;)

File size: 958 bytes
RevLine 
[6018]1-- InGameMenu.lua
2
3BasicGUI = require("BasicGUI")
4local P = BasicGUI:new() --inherit everything from the gui package
5if _REQUIREDNAME == nil then
6    InGameMenu = P
7else
8    _G[_REQUIREDNAME] = P
9end
10
11P.filename = "InGameMenu"
12P.layoutString = "InGameMenu.layout"
13
14function P:init()
15end
16
17
18-- events for ingamemenu
19function P.button_quit_clicked(e)
[6048]20    openDecisionPopup( "Do you really want to quit the game?", InGameMenu.callback )
[6018]21end
22
23function P.button_mainmenu_clicked(e)
[6019]24    orxonox.Game:getInstance():popState()
25    orxonox.Game:getInstance():popState()
26    orxonox.Game:getInstance():requestState("mainmenu")
[6018]27    orxonox.CommandExecutor:execute("hideGUI InGameMenu")
28end
29
[6019]30function P.button_return_clicked(e)
31    orxonox.CommandExecutor:execute("hideGUI InGameMenu")
32end
33
[6048]34function P.callback(doExit)
35    if doExit then
36        orxonox.CommandExecutor:execute("hideGUI InGameMenu")
37        orxonox.CommandExecutor:execute("exit")
38    end
39end
40
[6018]41return P
42
Note: See TracBrowser for help on using the repository browser.