From ea9a5be821119a65b08efe091c2f74102d3f7ae9 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 20 Oct 2002 20:03:28 +0000 Subject: [PATCH] On SelectDifficulty the "This mode is difficult" sound plays every switch from page 1 to page 2, not just the first time. --- stepmania/src/ScreenSelectDifficulty.cpp | 9 ++++----- stepmania/src/ScreenSelectDifficulty.h | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/stepmania/src/ScreenSelectDifficulty.cpp b/stepmania/src/ScreenSelectDifficulty.cpp index 3f6d7cc036..d77bb49ebc 100644 --- a/stepmania/src/ScreenSelectDifficulty.cpp +++ b/stepmania/src/ScreenSelectDifficulty.cpp @@ -168,9 +168,8 @@ ScreenSelectDifficulty::ScreenSelectDifficulty() m_soundChange.Load( THEME->GetPathTo("Sounds", "select difficulty change") ); m_soundSelect.Load( THEME->GetPathTo("Sounds", "menu start") ); + m_soundDifficult.Load( ANNOUNCER->GetPathTo("select difficulty challenge") ); - m_bPlayedChallengeSound = false; - SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("select difficulty intro") ); m_Menu.TweenOnScreenFromMenu( SM_None ); @@ -346,10 +345,10 @@ void ScreenSelectDifficulty::ChangeTo( PlayerNumber pn, int iSelectionWas, int i } - if( !m_bPlayedChallengeSound && bChangedPagesFrom1To2 ) + if( bChangedPagesFrom1To2 ) { - SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("select difficulty challenge") ); - m_bPlayedChallengeSound = true; + m_soundDifficult.Stop(); + m_soundDifficult.PlayRandom(); } if( bChangedPagesFrom1To2 || bChangedPagesFrom2To1 ) diff --git a/stepmania/src/ScreenSelectDifficulty.h b/stepmania/src/ScreenSelectDifficulty.h index 9ce0c1f99e..3c62092c25 100644 --- a/stepmania/src/ScreenSelectDifficulty.h +++ b/stepmania/src/ScreenSelectDifficulty.h @@ -15,6 +15,7 @@ #include "Screen.h" #include "Quad.h" #include "MenuElements.h" +#include "RandomSample.h" const int NUM_ITEMS_ON_PAGE_1 = 3; // easy, medium, hard, @@ -62,8 +63,7 @@ private: RageSoundSample m_soundChange; RageSoundSample m_soundSelect; - - bool m_bPlayedChallengeSound; + RandomSample m_soundDifficult; int m_iSelection[NUM_PLAYERS]; bool m_bChosen[NUM_PLAYERS];