add PlayMusic metrics instead of using optional GetPath
This commit is contained in:
@@ -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 );
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ protected:
|
|||||||
virtual void GoToPrevScreen();
|
virtual void GoToPrevScreen();
|
||||||
|
|
||||||
virtual void RefreshIcons();
|
virtual void RefreshIcons();
|
||||||
|
|
||||||
|
ThemeMetric<bool> PLAY_MUSIC;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user