centralize attract volume
This commit is contained in:
@@ -26,10 +26,7 @@ ScreenAttract::ScreenAttract( bool bResetGameState )
|
|||||||
|
|
||||||
void ScreenAttract::Init()
|
void ScreenAttract::Init()
|
||||||
{
|
{
|
||||||
if( GAMESTATE->IsTimeToPlayAttractSounds() )
|
ScreenAttract::SetAttractVolume( !GAMESTATE->IsTimeToPlayAttractSounds() );
|
||||||
SOUNDMAN->SetVolumeOfNonCriticalSounds( 1.0f ); // unmute attract sounds
|
|
||||||
else
|
|
||||||
SOUNDMAN->SetVolumeOfNonCriticalSounds( 0.0f ); // mute attract sounds
|
|
||||||
|
|
||||||
GAMESTATE->VisitAttractScreen( m_sName );
|
GAMESTATE->VisitAttractScreen( m_sName );
|
||||||
|
|
||||||
@@ -43,6 +40,14 @@ void ScreenAttract::Input( const InputEventPlus &input )
|
|||||||
AttractInput( input, this );
|
AttractInput( input, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenAttract::SetAttractVolume( bool bInAttract )
|
||||||
|
{
|
||||||
|
if( bInAttract )
|
||||||
|
SOUNDMAN->SetVolumeOfNonCriticalSounds( 0.0f ); // mute attract sounds
|
||||||
|
else
|
||||||
|
SOUNDMAN->SetVolumeOfNonCriticalSounds( 1.0f ); // unmute attract sounds
|
||||||
|
}
|
||||||
|
|
||||||
void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuElements *pScreen )
|
void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuElements *pScreen )
|
||||||
{
|
{
|
||||||
if( input.type != IET_FIRST_PRESS )
|
if( input.type != IET_FIRST_PRESS )
|
||||||
@@ -74,7 +79,7 @@ void ScreenAttract::AttractInput( const InputEventPlus &input, ScreenWithMenuEle
|
|||||||
if( input.MenuI != MENU_BUTTON_COIN )
|
if( input.MenuI != MENU_BUTTON_COIN )
|
||||||
SCREENMAN->PlayCoinSound();
|
SCREENMAN->PlayCoinSound();
|
||||||
|
|
||||||
SOUNDMAN->SetVolumeOfNonCriticalSounds( 1.0f ); // unmute attract sounds
|
SetAttractVolume( false ); // unmute attract sounds
|
||||||
pScreen->Cancel( SM_GoToStartScreen );
|
pScreen->Cancel( SM_GoToStartScreen );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public:
|
|||||||
|
|
||||||
static void AttractInput( const InputEventPlus &input, ScreenWithMenuElements *pScreen );
|
static void AttractInput( const InputEventPlus &input, ScreenWithMenuElements *pScreen );
|
||||||
static void GoToStartScreen( RString sScreenName );
|
static void GoToStartScreen( RString sScreenName );
|
||||||
|
static void SetAttractVolume( bool bInAttract );
|
||||||
|
|
||||||
virtual void Input( const InputEventPlus &input );
|
virtual void Input( const InputEventPlus &input );
|
||||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "GameSoundManager.h"
|
#include "GameSoundManager.h"
|
||||||
#include "GameManager.h"
|
#include "GameManager.h"
|
||||||
#include "Style.h"
|
#include "Style.h"
|
||||||
|
#include "ScreenAttract.h"
|
||||||
|
|
||||||
#define SECONDS_TO_SHOW THEME->GetMetricF(m_sName,"SecondsToShow")
|
#define SECONDS_TO_SHOW THEME->GetMetricF(m_sName,"SecondsToShow")
|
||||||
#define ALLOW_STYLE_TYPES THEME->GetMetric (m_sName,"AllowStyleTypes")
|
#define ALLOW_STYLE_TYPES THEME->GetMetric (m_sName,"AllowStyleTypes")
|
||||||
@@ -19,15 +19,13 @@ REGISTER_SCREEN_CLASS( ScreenDemonstration );
|
|||||||
ScreenDemonstration::ScreenDemonstration()
|
ScreenDemonstration::ScreenDemonstration()
|
||||||
{
|
{
|
||||||
m_bDemonstration = true;
|
m_bDemonstration = true;
|
||||||
if( GAMESTATE->IsTimeToPlayAttractSounds() )
|
ScreenAttract::SetAttractVolume( !GAMESTATE->IsTimeToPlayAttractSounds() );
|
||||||
SOUNDMAN->SetVolumeOfNonCriticalSounds( 1.0f ); // unmute attract sounds
|
|
||||||
else
|
|
||||||
SOUNDMAN->SetVolumeOfNonCriticalSounds( 0.0f ); // mute attract sounds
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenDemonstration::Init()
|
void ScreenDemonstration::Init()
|
||||||
{
|
{
|
||||||
GAMESTATE->Reset();
|
GAMESTATE->Reset();
|
||||||
|
GAMESTATE->VisitAttractScreen( m_sName );
|
||||||
|
|
||||||
// Choose a Style
|
// Choose a Style
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user