Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 25, 2009, 4:52:37 PM (15 years ago)
Author:
scheusso
Message:

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

Location:
code/branches/presentation2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2

  • code/branches/presentation2/src/libraries/core/Game.cc

    r6121 r6150  
    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; }
     
    327331    }
    328332
     333    void Game::keyESC()
     334    {
     335        if( this->getState("mainMenu") && this->getState("mainMenu")->getActivity().active==true )
     336            this->stop();
     337        else
     338            GUIManager::getInstance().keyESC();
     339    }
     340
    329341    void Game::stop()
    330342    {
     
    557569
    558570        shared_ptr<GameState> state = this->getState(name);
    559         state->activate();
     571        state->activateInternal();
    560572        if (!this->loadedStates_.empty())
    561573            this->loadedStates_.back()->activity_.topState = false;
     
    576588            if (!this->loadedStates_.empty())
    577589                this->loadedStates_.back()->activity_.topState = true;
    578             state->deactivate();
     590            state->deactivateInternal();
    579591        }
    580592        catch (...)
Note: See TracChangeset for help on using the changeset viewer.