look at PLAY_MUSIC when calculating whether or not to stop the music
This commit is contained in:
@@ -133,14 +133,11 @@ void ScreenAttract::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
/* Look at the def of the screen we're going to; if it has a music theme element
|
/* Look at the def of the screen we're going to; if it has a music theme element
|
||||||
* and it's the same as the one we're playing now, don't stop. However, if we're
|
* and it's the same as the one we're playing now, don't stop. However, if we're
|
||||||
* going to interrupt it when we fade in, stop the old music before we fade out. */
|
* going to interrupt it when we fade in, stop the old music before we fade out. */
|
||||||
/* GetPath optional because this screen and the next screen may not have music -
|
bool bMusicChanging = false;
|
||||||
* if PLAY_MUSIC == 0. We can't access PLAY_MUSIC from here. */
|
if( PLAY_MUSIC )
|
||||||
CString sThisMusic = THEME->GetPathS( NEXT_SCREEN, "music", true );
|
bMusicChanging = THEME->GetPathS(NEXT_SCREEN,"music") != THEME->GetPathS(m_sName,"music",true); // GetPath optional on the next screen because it may not have music.
|
||||||
CString sNextMusic = THEME->GetPathS( m_sName, "music", true );
|
|
||||||
bool bGoingToPlayTheSameMusic = sThisMusic == sNextMusic;
|
if( bMusicChanging )
|
||||||
if( bGoingToPlayTheSameMusic )
|
|
||||||
; // do nothing
|
|
||||||
else
|
|
||||||
SOUND->PlayMusic( "" ); // stop the music
|
SOUND->PlayMusic( "" ); // stop the music
|
||||||
|
|
||||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
#define STYLE_ICON THEME->GetMetricB(m_sName,"StyleIcon")
|
#define STYLE_ICON THEME->GetMetricB(m_sName,"StyleIcon")
|
||||||
#define MEMORY_CARD_ICONS THEME->GetMetricB(m_sName,"MemoryCardIcons")
|
#define MEMORY_CARD_ICONS THEME->GetMetricB(m_sName,"MemoryCardIcons")
|
||||||
#define FORCE_TIMER THEME->GetMetricB(m_sName,"ForceTimer")
|
#define FORCE_TIMER THEME->GetMetricB(m_sName,"ForceTimer")
|
||||||
#define PLAY_MUSIC THEME->GetMetricB(m_sName,"PlayMusic")
|
|
||||||
#define STOP_MUSIC_ON_BACK THEME->GetMetricB(m_sName,"StopMusicOnBack")
|
#define STOP_MUSIC_ON_BACK THEME->GetMetricB(m_sName,"StopMusicOnBack")
|
||||||
|
|
||||||
//REGISTER_SCREEN_CLASS( ScreenWithMenuElements );
|
//REGISTER_SCREEN_CLASS( ScreenWithMenuElements );
|
||||||
@@ -32,7 +31,8 @@ void ScreenWithMenuElements::Init()
|
|||||||
|
|
||||||
Screen::Init();
|
Screen::Init();
|
||||||
|
|
||||||
m_FirstUpdateCommand.Load( m_sName, "FirstUpdateCommand" );
|
FIRST_UPDATE_COMMAND.Load( m_sName, "FirstUpdateCommand" );
|
||||||
|
PLAY_MUSIC.Load( m_sName, "PlayMusic" );
|
||||||
|
|
||||||
ASSERT( this->m_SubActors.empty() ); // don't call Init twice!
|
ASSERT( this->m_SubActors.empty() ); // don't call Init twice!
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ void ScreenWithMenuElements::Update( float fDeltaTime )
|
|||||||
SOUND->PlayMusic( THEME->GetPathS(m_sName,"music") );
|
SOUND->PlayMusic( THEME->GetPathS(m_sName,"music") );
|
||||||
|
|
||||||
/* Evaluate FirstUpdateCommand. */
|
/* Evaluate FirstUpdateCommand. */
|
||||||
this->RunCommands( m_FirstUpdateCommand );
|
this->RunCommands( FIRST_UPDATE_COMMAND );
|
||||||
}
|
}
|
||||||
|
|
||||||
Screen::Update( fDeltaTime );
|
Screen::Update( fDeltaTime );
|
||||||
|
|||||||
@@ -37,11 +37,13 @@ protected:
|
|||||||
AutoActor m_autoFooter;
|
AutoActor m_autoFooter;
|
||||||
HelpDisplay *m_textHelp;
|
HelpDisplay *m_textHelp;
|
||||||
AutoActor m_sprOverlay;
|
AutoActor m_sprOverlay;
|
||||||
ThemeMetric<LuaExpression> m_FirstUpdateCommand;
|
|
||||||
|
|
||||||
Transition m_In;
|
Transition m_In;
|
||||||
Transition m_Out;
|
Transition m_Out;
|
||||||
Transition m_Cancel;
|
Transition m_Cancel;
|
||||||
|
|
||||||
|
ThemeMetric<LuaExpression> FIRST_UPDATE_COMMAND;
|
||||||
|
ThemeMetric<bool> PLAY_MUSIC;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user