From 2d546f92ef9222d3039b71be910c0f3538a7e205 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 25 Sep 2003 06:05:19 +0000 Subject: [PATCH] Fix input mappings, etc. not being reloaded after change game code. --- stepmania/src/ScreenTitleMenu.cpp | 4 ++++ stepmania/src/StepMania.cpp | 6 ++++-- stepmania/src/StepMania.h | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index daed449335..2057ba7d0a 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -301,6 +301,10 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty if( GAMEMAN->IsGameEnabled(GAMESTATE->m_CurGame) ) break; // found the first enabled game. Stop searching. } + + /* Reload the theme if it's changed, but don't back to the initial screen. */ + ResetGame( false ); + SCREENMAN->SystemMessage( ssprintf("Game: %s",GAMESTATE->GetCurrentGameDef()->m_szName) ); SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); } diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index d013e01cd4..98e622cfee 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -185,7 +185,7 @@ void ExitGame() g_bQuitting = true; } -void ResetGame() +void ResetGame( bool ReturnToFirstScreen ) { GAMESTATE->Reset(); PREFSMAN->ReadGamePrefsFromDisk(); @@ -217,11 +217,13 @@ void ResetGame() } PREFSMAN->SaveGamePrefsToDisk(); - SCREENMAN->SetNewScreen( THEME->GetMetric("Common","InitialScreen") ); PREFSMAN->m_bFirstRun = false; if( PREFSMAN->m_bAutoMapJoysticks ) INPUTMAPPER->AutoMapJoysticksForCurrentGame(); + + if( ReturnToFirstScreen ) + SCREENMAN->SetNewScreen( THEME->GetMetric("Common","InitialScreen") ); } static void GameLoop(); diff --git a/stepmania/src/StepMania.h b/stepmania/src/StepMania.h index 15dad1a030..0dc83b4faf 100644 --- a/stepmania/src/StepMania.h +++ b/stepmania/src/StepMania.h @@ -14,7 +14,7 @@ int SMmain(int argc, char* argv[]); void ApplyGraphicOptions(); void ExitGame(); -void ResetGame(); +void ResetGame( bool ReturnToFirstScreen=true ); #if defined(WIN32) extern HWND g_hWndMain;