Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/gamestates3/data/gui/scripts/InGameMenu.lua @ 10233

Last change on this file since 10233 was 6748, checked in by rgrieder, 15 years ago

A GUISheet can assign its field "loadAlong" any strings designating other sheets that have to be loaded as well.
Implemented this for all menus sheets as I see fit (load the whole MainMenu, but don't load MainMenu or Settings for the InGameMenu).
This is just a measure to avoid lags when clicking through the menus.

  • Property svn:eol-style set to native
File size: 752 bytes
Line 
1-- InGameMenu.lua
2
3local P = createMenuSheet("InGameMenu")
4P.loadAlong = { "DecisionPopup" }
5
6-- events for ingamemenu
7function P.button_quit_clicked(e)
8    openDecisionPopup( "Do you really want to quit the game?", InGameMenu.callback )
9end
10
11function P.button_mainmenu_clicked(e)
12    orxonox.Game:getInstance():popState()
13    orxonox.Game:getInstance():popState()
14    orxonox.Game:getInstance():requestState("mainmenu")
15    hideMenuSheet("InGameMenu")
16end
17
18function P.button_settings_clicked(e)
19    showMenuSheet("SettingsMenu", true)
20end
21
22function P.button_return_clicked(e)
23    hideMenuSheet("InGameMenu")
24end
25
26function P.callback(doExit)
27    if doExit then
28        hideMenuSheet("InGameMenu")
29        orxonox.execute("exit")
30    end
31end
32
33return P
34
Note: See TracBrowser for help on using the repository browser.