less fragile attract sound logic
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
CString PLAYER_COLOR_NAME( size_t p ) { return ssprintf("ColorP%d",int(p+1)); }
|
CString PLAYER_COLOR_NAME( size_t p ) { return ssprintf("ColorP%d",int(p+1)); }
|
||||||
|
|
||||||
ThemeMetric<CString> INITIAL_SCREEN ("Common","InitialScreen");
|
ThemeMetric<CString> INITIAL_SCREEN ("Common","InitialScreen");
|
||||||
|
ThemeMetric<CString> FIRST_ATTRACT_SCREEN ("Common","FirstAttractScreen");
|
||||||
ThemeMetric<CString> DEFAULT_MODIFIERS ("Common","DefaultModifiers" );
|
ThemeMetric<CString> DEFAULT_MODIFIERS ("Common","DefaultModifiers" );
|
||||||
ThemeMetric<CString> DEFAULT_CPU_MODIFIERS ("Common","DefaultCpuModifiers" );
|
ThemeMetric<CString> DEFAULT_CPU_MODIFIERS ("Common","DefaultCpuModifiers" );
|
||||||
ThemeMetric1D<RageColor> PLAYER_COLOR ("Common",PLAYER_COLOR_NAME,NUM_PLAYERS);
|
ThemeMetric1D<RageColor> PLAYER_COLOR ("Common",PLAYER_COLOR_NAME,NUM_PLAYERS);
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ public:
|
|||||||
// Metrics
|
// Metrics
|
||||||
//
|
//
|
||||||
extern ThemeMetric<CString> INITIAL_SCREEN;
|
extern ThemeMetric<CString> INITIAL_SCREEN;
|
||||||
|
extern ThemeMetric<CString> FIRST_ATTRACT_SCREEN;
|
||||||
extern ThemeMetric<CString> DEFAULT_MODIFIERS;
|
extern ThemeMetric<CString> DEFAULT_MODIFIERS;
|
||||||
extern ThemeMetric<CString> DEFAULT_CPU_MODIFIERS;
|
extern ThemeMetric<CString> DEFAULT_CPU_MODIFIERS;
|
||||||
extern ThemeMetric1D<RageColor> PLAYER_COLOR;
|
extern ThemeMetric1D<RageColor> PLAYER_COLOR;
|
||||||
|
|||||||
@@ -1736,6 +1736,14 @@ bool GameState::OneIsHot() const
|
|||||||
|
|
||||||
bool GameState::IsTimeToPlayAttractSounds() const
|
bool GameState::IsTimeToPlayAttractSounds() const
|
||||||
{
|
{
|
||||||
|
// m_iNumTimesThroughAttract will be -1 from the first attract screen after
|
||||||
|
// the end of a game until the next time FIRST_ATTRACT_SCREEN is reached.
|
||||||
|
// Play attract sounds for this sort span of time regardless of
|
||||||
|
// m_AttractSoundFrequency because it's awkward to have the machine go
|
||||||
|
// silent immediately after the end of a game.
|
||||||
|
if( m_iNumTimesThroughAttract == -1 )
|
||||||
|
return true;
|
||||||
|
|
||||||
if( PREFSMAN->m_AttractSoundFrequency == PrefsManager::ASF_NEVER )
|
if( PREFSMAN->m_AttractSoundFrequency == PrefsManager::ASF_NEVER )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -1748,14 +1756,8 @@ bool GameState::IsTimeToPlayAttractSounds() const
|
|||||||
|
|
||||||
void GameState::VisitAttractScreen( const CString sScreenName )
|
void GameState::VisitAttractScreen( const CString sScreenName )
|
||||||
{
|
{
|
||||||
bool bSeenThisScreenInThisLoop = m_vScreensSeenSoFarInThisAttractLoop.find( sScreenName ) != m_vScreensSeenSoFarInThisAttractLoop.end();
|
if( sScreenName == FIRST_ATTRACT_SCREEN.GetValue() )
|
||||||
if( bSeenThisScreenInThisLoop )
|
m_iNumTimesThroughAttract++;
|
||||||
{
|
|
||||||
m_vScreensSeenSoFarInThisAttractLoop.clear();
|
|
||||||
GAMESTATE->m_iNumTimesThroughAttract++;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_vScreensSeenSoFarInThisAttractLoop.insert( sScreenName );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameState::DifficultiesLocked()
|
bool GameState::DifficultiesLocked()
|
||||||
|
|||||||
@@ -272,7 +272,6 @@ public:
|
|||||||
//
|
//
|
||||||
// Attract stuff
|
// Attract stuff
|
||||||
//
|
//
|
||||||
set<CString> m_vScreensSeenSoFarInThisAttractLoop;
|
|
||||||
int m_iNumTimesThroughAttract; // negative means play regardless of m_iAttractSoundFrequency setting
|
int m_iNumTimesThroughAttract; // negative means play regardless of m_iAttractSoundFrequency setting
|
||||||
bool IsTimeToPlayAttractSounds() const;
|
bool IsTimeToPlayAttractSounds() const;
|
||||||
void VisitAttractScreen( const CString sScreenName );
|
void VisitAttractScreen( const CString sScreenName );
|
||||||
|
|||||||
Reference in New Issue
Block a user