fix options menu playing music too early

This commit is contained in:
Glenn Maynard
2005-02-20 00:22:37 +00:00
parent 65873ed62f
commit bb1e676460
2 changed files with 19 additions and 7 deletions
+18 -7
View File
@@ -366,13 +366,6 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
{
LOG->Trace("ScreenOptionsMaster::ScreenOptionsMaster(%s)", m_sName.c_str() );
/* If this file doesn't exist, leave the music alone (eg. ScreenPlayerOptions music sample
* left over from ScreenSelectMusic). If you really want to play no music, add a redir
* to _silent. */
CString MusicPath = THEME->GetPathS( m_sName, "music", true );
if( MusicPath != "" )
SOUND->PlayMusic( MusicPath );
CStringArray asLineNames;
split( LINE_NAMES, ",", asLineNames );
if( asLineNames.empty() )
@@ -465,6 +458,24 @@ ScreenOptionsMaster::~ScreenOptionsMaster()
delete [] m_OptionRowAlloc;
}
void ScreenOptionsMaster::Update( float fDelta )
{
if( m_bFirstUpdate )
{
/*
* 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
* left over from ScreenSelectMusic). If you really want to play no music, add a redir
* to _silent.
*/
CString MusicPath = THEME->GetPathS( m_sName, "music", true );
if( MusicPath != "" )
SOUND->PlayMusic( MusicPath );
}
ScreenOptions::Update( fDelta );
}
void SelectExactlyOne( int iSelection, vector<bool> &vbSelectedOut )
{
for( int i=0; i<(int)vbSelectedOut.size(); i++ )
+1
View File
@@ -12,6 +12,7 @@ class ScreenOptionsMaster: public ScreenOptions
public:
ScreenOptionsMaster( CString sName );
virtual ~ScreenOptionsMaster();
void Update( float fDelta );
private: