Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/data/gui/scripts/InGameMenu.lua @ 8887

Last change on this file since 8887 was 8079, checked in by landauf, 14 years ago

merged usability branch back to trunk

incomplete summary of the changes in this branch:

  • enhanced keyboard navigation in GUIs
  • implemented new graphics menu and changeable window size at runtime
  • added developer mode
  • HUD shows if game is paused, game pauses if ingame menu is opened
  • removed a few obsolete commands and hid some that are more for internal use
  • numpad works in console and gui
  • faster loading of level info
  • enhanced usage of compositors (Shader class)
  • improved camera handling, configurable FOV and aspect ratio
  • Property svn:eol-style set to native
File size: 1.6 KB
RevLine 
[6018]1-- InGameMenu.lua
2
[6746]3local P = createMenuSheet("InGameMenu")
[6748]4P.loadAlong = { "DecisionPopup" }
[6018]5
[7726]6function P.onLoad()
[8079]7    P.multiplayerMode = "startClient"
[7726]8
9    --button are arranged in a 4x1 matrix, the left lower item is nil
[8079]10    P:setButton(1, 1, {
[7726]11            ["button"] = winMgr:getWindow("orxonox/InGameMenu_ReturnButton"),
[8079]12            ["callback"]  = P.button_return_clicked
13    })
[7726]14
[8079]15    P:setButton(2, 1, {
[7726]16            ["button"] = winMgr:getWindow("orxonox/InGameMenu_MainMenuButton"),
[8079]17            ["callback"]  = P.button_mainmenu_clicked
18    })
[7726]19
[8079]20    P:setButton(3, 1, {
[7726]21            ["button"] = winMgr:getWindow("orxonox/InGameMenu_SettingsButton"),
[8079]22            ["callback"]  = P.button_settings_clicked
23    })
[7726]24
[8079]25    P:setButton(4, 1, {
[7726]26            ["button"] = winMgr:getWindow("orxonox/InGameMenu_QuitButton"),
[8079]27            ["callback"]  = P.button_quit_clicked
28    })
[7726]29end
30
31function P.onShow()
[8079]32    if P:hasSelection() == false then
33        P:setSelection(1, 1)
34    end
35
36    orxonox.execute("setPause 1")
[7726]37end
38
[8079]39function P.onQuit()
40    orxonox.execute("setPause 0")
41end
42
[6018]43-- events for ingamemenu
44function P.button_quit_clicked(e)
[6048]45    openDecisionPopup( "Do you really want to quit the game?", InGameMenu.callback )
[6018]46end
47
48function P.button_mainmenu_clicked(e)
[7877]49    orxonox.execute("startMainMenu")
[6746]50    hideMenuSheet("InGameMenu")
[6018]51end
52
[6217]53function P.button_settings_clicked(e)
[6746]54    showMenuSheet("SettingsMenu", true)
[6217]55end
56
[6019]57function P.button_return_clicked(e)
[6746]58    hideMenuSheet("InGameMenu")
[6019]59end
60
[6048]61function P.callback(doExit)
62    if doExit then
[6746]63        hideMenuSheet("InGameMenu")
[6403]64        orxonox.execute("exit")
[8079]65    else
[7726]66        P.onShow()
[6048]67    end
68end
69
[6018]70return P
71
Note: See TracBrowser for help on using the repository browser.