Commit 83aab19f authored by Gerhard Stein's avatar Gerhard Stein

Menu can be called within the game

parent 498b63be
......@@ -10,6 +10,7 @@
#include "common/Menu/CControlsettings.h"
#include "common/Menu/CMainMenu.h"
#include "sdl/input/CInput.h"
#include "sdl/music/CMusic.h"
void CMenuController::process()
......@@ -26,6 +27,7 @@ void CMenuController::process()
{
EventContainer.add( new OpenMenuEvent( new CMainMenu(mOpenedGamePlay) ) );
g_pBehaviorEngine->setPause(true);
g_pMusicPlayer->pause();
}
else // Close the menu which is open. Might go back if it is a submenu
{
......@@ -54,6 +56,9 @@ void CMenuController::process()
{
popBackMenu();
EventContainer.pop_Event();
if(EventContainer.empty())
g_pMusicPlayer->play();
}
if( EventContainer.occurredEvent<CloseAllMenusEvent>() )
......@@ -62,9 +67,10 @@ void CMenuController::process()
popBackMenu();
EventContainer.pop_Event();
g_pMusicPlayer->play();
}
// Control Menu Events
if( OpenMovementControlMenuEvent* ctrlMenu = EventContainer.occurredEvent<OpenMovementControlMenuEvent>() )
{
const int players = ctrlMenu->mNumPlayers;
......
......@@ -252,12 +252,12 @@ void CPlayGameGalaxy::process()
void CPlayGameGalaxy::processInput()
{
// open the menu
if(g_pInput->getPressedCommand(IC_BACK))
{
//if(g_pInput->getPressedCommand(IC_BACK))
//{
//mp_Menu = new CMenuGalaxy(ACTIVE, m_SavedGame, m_restartVideo);
//m_BackgroundBitmap = *g_pGfxEngine->getBitmap("KEENSWATCH");
g_pMusicPlayer->pause();
}
//g_pMusicPlayer->pause();
//}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment