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