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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/menu/src/libraries/core/Game.cc

    r6047 r6048  
    5151#include "GameMode.h"
    5252#include "GameState.h"
     53#include "GUIManager.h"
    5354
    5455namespace orxonox
     
    5758        { Game::getInstance().stop(); }
    5859    SetConsoleCommandShortcutExternAlias(stop_game, "exit");
     60    static void key_esc()
     61        { Game::getInstance().keyESC(); }
     62    SetConsoleCommandShortcutExternAlias(key_esc, "keyESC");
    5963    static void printFPS()
    6064        { COUT(0) << Game::getInstance().getAvgFPS() << std::endl; }
     
    354358    }
    355359
     360    void Game::keyESC()
     361    {
     362        if( this->getState("mainMenu") && this->getState("mainMenu")->getActivity().active==true )
     363            this->stop();
     364        else
     365            GUIManager::getInstance().keyESC();
     366    }
     367
    356368    void Game::stop()
    357369    {
Note: See TracChangeset for help on using the changeset viewer.