From 1e58f4b115978231f3e272a7b5336509149d63cc Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 18 Apr 2004 20:37:18 +0000 Subject: [PATCH] reload metrics on F2, write scores on Shift+F2 --- stepmania/src/StepMania.cpp | 43 +++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 20eb392d16..53222ab610 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -1291,25 +1291,32 @@ bool HandleGlobalInputs( DeviceInput DeviceI, InputEventType type, GameInput Gam if(DeviceI == DeviceInput(DEVICE_KEYBOARD, SDLK_F2)) { - THEME->ReloadMetrics(); - TEXTUREMAN->ReloadAll(); - SCREENMAN->ReloadCreditsText(); - NOTESKIN->RefreshNoteSkinData( GAMESTATE->m_CurGame ); - CodeDetector::RefreshCacheItems(); - - // HACK: Also save bookkeeping and profile info for debugging - // so we don't have to play through a whole song to get new output. - BOOKKEEPER->WriteToDisk(); - PROFILEMAN->SaveMachineProfile(); - for( int p=0; pIsUsingProfile((PlayerNumber)p) ) - PROFILEMAN->SaveProfile( (PlayerNumber)p ); - - /* If we're in screen test mode, reload the screen. */ - if( PREFSMAN->m_bScreenTestMode ) - ResetGame( true ); + if( INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, SDLK_LSHIFT) ) ) + { + // HACK: Also save bookkeeping and profile info for debugging + // so we don't have to play through a whole song to get new output. + BOOKKEEPER->WriteToDisk(); + PROFILEMAN->SaveMachineProfile(); + for( int p=0; pIsUsingProfile((PlayerNumber)p) ) + PROFILEMAN->SaveProfile( (PlayerNumber)p ); + SCREENMAN->SystemMessage( "Stats saved" ); + } else - SCREENMAN->SystemMessage( "Reloaded metrics and textures" ); + { + THEME->ReloadMetrics(); + TEXTUREMAN->ReloadAll(); + SCREENMAN->ReloadCreditsText(); + NOTESKIN->RefreshNoteSkinData( GAMESTATE->m_CurGame ); + CodeDetector::RefreshCacheItems(); + + + /* If we're in screen test mode, reload the screen. */ + if( PREFSMAN->m_bScreenTestMode ) + ResetGame( true ); + else + SCREENMAN->SystemMessage( "Reloaded metrics and textures" ); + } return true; }