Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 12, 2009, 11:32:41 AM (15 years ago)
Author:
scheusso
Message:

ESC handling in ingame menu: if theres already an opened GUI sheet then hide it, if not open the ingame menu
in mainmenu everything should remain the same

Location:
code/branches/menu/data
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/menu/data/defaultConfig/keybindings.ini

    r5929 r6048  
    2323KeyEnd=boost
    2424KeyEquals=
    25 KeyEscape="exit"
     25KeyEscape="toggleIngameGUI"
    2626KeyF="scale -1 moveUpDown"
    2727KeyF1="OverlayGroup toggleVisibility Debug"
  • code/branches/menu/data/gui/scripts/InGameMenu.lua

    r6024 r6048  
    1818-- events for ingamemenu
    1919function P.button_quit_clicked(e)
    20     orxonox.CommandExecutor:execute("hideGUI InGameMenu")
    21     orxonox.CommandExecutor:execute("exit")
     20    openDecisionPopup( "Do you really want to quit the game?", InGameMenu.callback )
    2221end
    2322
     
    3433end
    3534
     35function P.callback(doExit)
     36    if doExit then
     37        orxonox.CommandExecutor:execute("hideGUI InGameMenu")
     38        orxonox.CommandExecutor:execute("exit")
     39    end
     40end
     41
    3642return P
    3743
  • code/branches/menu/data/gui/scripts/InitialiseGUI.lua

    r6036 r6048  
    2121bHidePrevious = {}
    2222
     23-- Require all tools
     24require("GUITools")
     25
    2326-- loads the GUI with the specified filename
    2427-- be sure to set the global variable "filename" before calling this function
     
    2831    if loadedGui == nil then
    2932        loadedGuiNS = require(filename)
     33        if loadedGuiNS == nil then
     34            return
     35        end
    3036        loadedGui = loadedGuiNS:load()
    3137        loadedGUIs[filename] = loadedGui
     
    147153end
    148154
     155function keyESC()
     156    orxonox.CommandExecutor:execute("hideGUI "..activeSheets[nrOfActiveSheets])
     157end
     158
    149159function setBackground(filename)
    150160    local newroot
Note: See TracChangeset for help on using the changeset viewer.