fix attract sound frequency if initial screen not in attract loop
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
#include "Foreach.h"
|
||||
#include "LuaReference.h"
|
||||
#include "CommonMetrics.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "Screen.h"
|
||||
|
||||
#include <ctime>
|
||||
#include <set>
|
||||
@@ -1718,7 +1720,7 @@ bool GameState::OneIsHot() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GameState::IsTimeToPlayAttractSounds()
|
||||
bool GameState::IsTimeToPlayAttractSounds() const
|
||||
{
|
||||
if( PREFSMAN->m_AttractSoundFrequency == PrefsManager::ASF_NEVER )
|
||||
return false;
|
||||
@@ -1730,6 +1732,18 @@ bool GameState::IsTimeToPlayAttractSounds()
|
||||
return false;
|
||||
}
|
||||
|
||||
void GameState::VisitAttractScreen( const CString sScreenName )
|
||||
{
|
||||
bool bSeenThisScreenInThisLoop = m_vScreensSeenSoFarInThisAttractLoop.find( sScreenName ) != m_vScreensSeenSoFarInThisAttractLoop.end();
|
||||
if( bSeenThisScreenInThisLoop )
|
||||
{
|
||||
m_vScreensSeenSoFarInThisAttractLoop.clear();
|
||||
GAMESTATE->m_iNumTimesThroughAttract++;
|
||||
}
|
||||
|
||||
m_vScreensSeenSoFarInThisAttractLoop.insert( sScreenName );
|
||||
}
|
||||
|
||||
bool GameState::DifficultiesLocked()
|
||||
{
|
||||
if( GAMESTATE->m_PlayMode == PLAY_MODE_RAVE )
|
||||
|
||||
@@ -272,8 +272,10 @@ public:
|
||||
//
|
||||
// Attract stuff
|
||||
//
|
||||
set<CString> m_vScreensSeenSoFarInThisAttractLoop;
|
||||
int m_iNumTimesThroughAttract; // negative means play regardless of m_iAttractSoundFrequency setting
|
||||
bool IsTimeToPlayAttractSounds();
|
||||
bool IsTimeToPlayAttractSounds() const;
|
||||
void VisitAttractScreen( const CString sScreenName );
|
||||
|
||||
//
|
||||
// PlayerState
|
||||
|
||||
@@ -27,9 +27,7 @@ ScreenAttract::ScreenAttract( CString sName, bool bResetGameState ) : ScreenWith
|
||||
if( bResetGameState )
|
||||
GAMESTATE->Reset();
|
||||
|
||||
// increment times through attract count
|
||||
if( INITIAL_SCREEN == m_sName )
|
||||
GAMESTATE->m_iNumTimesThroughAttract++;
|
||||
GAMESTATE->VisitAttractScreen( sName );
|
||||
}
|
||||
|
||||
void ScreenAttract::Init()
|
||||
|
||||
Reference in New Issue
Block a user