From b3d25996d8b1010a2836509a47f23b26289ac632 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 12 Oct 2003 19:45:28 +0000 Subject: [PATCH] add option for silent attract --- stepmania/Themes/default/metrics.ini | 4 +++- stepmania/src/PrefsManager.cpp | 4 ++++ stepmania/src/PrefsManager.h | 1 + stepmania/src/ScreenAttract.cpp | 3 ++- stepmania/src/ScreenOptionsMasterPrefs.cpp | 4 +++- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 92f9f70e0a..2fd2b64e24 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -2403,15 +2403,17 @@ HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options:: MasterVolume= PreloadSounds=If YES, preload most sounds in advance. This increases load times,::and should normally be left OFF. ResamplingQuality=Advanced: Select the resampling quality to use. +AttractSound=Set to ON to play sound during the attract screens.::Set to OFF to mute sounds durring attract. StyleIcon=0 TimerSeconds=0 PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster NextScreen=ScreenOptionsMenu@ScreenOptionsMaster -OptionMenuFlags=rows,2;together;explanations +OptionMenuFlags=rows,3;together;explanations Line1=conf,PreloadSounds Line2=conf,ResamplingQuality +Line3=conf,AttractSound [ScreenIntroMovie] NextScreen=ScreenDemonstration diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index a152911405..4393e9eed4 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -138,6 +138,8 @@ PrefsManager::PrefsManager() m_fCenterImageScaleX = 1; m_fCenterImageScaleY = 1; + m_bAttractSound = true; + /* XXX: Set these defaults for individual consoles using VideoCardDefaults.ini. */ #ifdef _XBOX @@ -297,6 +299,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk() ini.GetValue( "Options", "CenterImageTranslateY", m_iCenterImageTranslateY ); ini.GetValue( "Options", "CenterImageScaleX", m_fCenterImageScaleX ); ini.GetValue( "Options", "CenterImageScaleY", m_fCenterImageScaleY ); + ini.GetValue( "Options", "AttractSound", m_bAttractSound ); CString sAdditionalSongFolders; if( ini.GetValue( "Options", "AdditionalSongFolders", sAdditionalSongFolders ) ) @@ -418,6 +421,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const ini.SetValue( "Options", "CenterImageTranslateY", m_iCenterImageTranslateY ); ini.SetValue( "Options", "CenterImageScaleX", m_fCenterImageScaleX ); ini.SetValue( "Options", "CenterImageScaleY", m_fCenterImageScaleY ); + ini.SetValue( "Options", "AttractSound", m_bAttractSound ); /* Only write these if they aren't the default. This ensures that we can change * the default and have it take effect for everyone (except people who diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index c8afa5417f..0147441ae9 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -104,6 +104,7 @@ public: int m_iCenterImageTranslateY; float m_fCenterImageScaleX; float m_fCenterImageScaleY; + bool m_bAttractSound; // course ranking enum CourseSortOrders { COURSE_SORT_SONGS, COURSE_SORT_METER, COURSE_SORT_METER_SUM, COURSE_SORT_RANK } m_iCourseSortOrder; diff --git a/stepmania/src/ScreenAttract.cpp b/stepmania/src/ScreenAttract.cpp index 37d681aba2..e88c4af19f 100644 --- a/stepmania/src/ScreenAttract.cpp +++ b/stepmania/src/ScreenAttract.cpp @@ -51,7 +51,8 @@ ScreenAttract::ScreenAttract( CString sClassName ) : Screen( sClassName ) m_soundStart.Load( THEME->GetPathToS("Common start") ); - SOUND->PlayMusic( THEME->GetPathToS(m_sName + " music") ); + if( PREFSMAN->m_bAttractSound ) + SOUND->PlayMusic( THEME->GetPathToS(m_sName + " music") ); GAMESTATE->m_bPlayersCanJoin = true; diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index 16c2c7cfe7..9a44ae5b17 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -373,6 +373,7 @@ static void RefreshRate( int &sel, bool ToSel, const CStringArray &choices ) /* Sound options */ MOVE( PreloadSounds, PREFSMAN->m_bSoundPreloadAll ); MOVE( ResamplingQuality, PREFSMAN->m_iSoundResampleQuality ); +MOVE( AttractSound, PREFSMAN->m_bAttractSound ); static const ConfOption g_ConfOptions[] = @@ -454,7 +455,8 @@ static const ConfOption g_ConfOptions[] = /* Sound options */ ConfOption( "Preload\nSounds", PreloadSounds, "NO","YES" ), ConfOption( "Resampling\nQuality", ResamplingQuality, "FAST","NORMAL","HIGH QUALITY" ), - ConfOption( "", NULL ) + ConfOption( "Attract\nSound", AttractSound, "OFF","ON" ), + ConfOption( "", NULL ) // end marker }; /* Get a mask of effects to apply if the given option changes. */