add PlayMusic metrics instead of using optional GetPath

This commit is contained in:
Chris Danford
2005-03-02 07:42:37 +00:00
parent 2d70433068
commit 1483e577d1
2 changed files with 8 additions and 7 deletions
+6 -7
View File
@@ -26,7 +26,8 @@
REGISTER_SCREEN_CLASS( ScreenOptionsMaster ); REGISTER_SCREEN_CLASS( ScreenOptionsMaster );
ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ): ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
ScreenOptions( sClassName ) ScreenOptions( sClassName ),
PLAY_MUSIC( sClassName, "PlayMusic" )
{ {
LOG->Trace("ScreenOptionsMaster::ScreenOptionsMaster(%s)", m_sName.c_str() ); LOG->Trace("ScreenOptionsMaster::ScreenOptionsMaster(%s)", m_sName.c_str() );
} }
@@ -111,13 +112,11 @@ void ScreenOptionsMaster::Update( float fDelta )
{ {
/* /*
* Don't play sounds during the ctor, since derived classes havn't loaded yet. * Don't play sounds during the ctor, since derived classes havn't loaded yet.
* If this file doesn't exist, leave the music alone (eg. ScreenPlayerOptions music sample * Leave the music alone (eg. ScreenPlayerOptions music sample
* left over from ScreenSelectMusic). If you really want to play no music, add a redir * left over from ScreenSelectMusic).
* to _silent.
*/ */
CString MusicPath = THEME->GetPathS( m_sName, "music", true ); if( PLAY_MUSIC )
if( MusicPath != "" ) SOUND->PlayMusic( THEME->GetPathS( m_sName, "music" ) );
SOUND->PlayMusic( MusicPath );
} }
ScreenOptions::Update( fDelta ); ScreenOptions::Update( fDelta );
+2
View File
@@ -32,6 +32,8 @@ protected:
virtual void GoToPrevScreen(); virtual void GoToPrevScreen();
virtual void RefreshIcons(); virtual void RefreshIcons();
ThemeMetric<bool> PLAY_MUSIC;
}; };
#endif #endif