From 2bdff9129362fab82eebe09b7dcd6bc7258fb8a4 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 7 Feb 2005 23:31:55 +0000 Subject: [PATCH] preload cancel all sound --- stepmania/src/ScreenPlayerOptions.cpp | 7 ++++++- stepmania/src/ScreenPlayerOptions.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index 44a1a63f7c..d3d155b30d 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -47,6 +47,10 @@ ScreenPlayerOptions::ScreenPlayerOptions( CString sClassName ) : m_bAcceptedChoices = false; m_bGoToOptions = ( PREFSMAN->m_ShowSongOptions == PrefsManager::YES ); + CString sPath = THEME->GetPathS( m_sName,"cancel all", true ); + if( sPath != "" ) + m_CancelAll.Load( sPath, true ); + SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("player options intro") ); FOREACH_HumanPlayer( pn ) @@ -123,7 +127,8 @@ void ScreenPlayerOptions::Input( const DeviceInput& DeviceI, const InputEventTyp PlayerNumber pn = GAMESTATE->GetCurrentStyle()->ControllerToPlayerNumber( GameI.controller ); if( GAMESTATE->IsHumanPlayer(pn) && CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_CANCEL_ALL_PLAYER_OPTIONS) ) { - SOUND->PlayOnce( THEME->GetPathS(m_sName,"cancel all") ); + if( m_CancelAll.IsLoaded() ) + m_CancelAll.Play(); // apply the game default mods, but not the Profile saved mods GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.Init(); diff --git a/stepmania/src/ScreenPlayerOptions.h b/stepmania/src/ScreenPlayerOptions.h index b19e147ef1..25903a4a4f 100644 --- a/stepmania/src/ScreenPlayerOptions.h +++ b/stepmania/src/ScreenPlayerOptions.h @@ -23,6 +23,8 @@ private: bool m_bGoToOptions; bool m_bAskOptionsMessage; Sprite m_sprOptionsMessage; + + RageSound m_CancelAll; AutoActor m_sprCancelAll[NUM_PLAYERS]; };