2002-05-20 08:59:37 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
2002-08-13 23:26:46 +00:00
|
|
|
Class: ScreenCaution
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-08-13 23:26:46 +00:00
|
|
|
Desc: Screen that displays while resources are being loaded.
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-08-13 23:26:46 +00:00
|
|
|
Chris Danford
|
2002-05-20 08:59:37 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenCaution.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "PrefsManager.h"
|
2002-05-20 08:59:37 +00:00
|
|
|
#include "AnnouncerManager.h"
|
2002-08-13 23:26:46 +00:00
|
|
|
#include "GameState.h"
|
2002-08-27 16:53:25 +00:00
|
|
|
#include "RageMusic.h"
|
2002-08-13 23:26:46 +00:00
|
|
|
|
|
|
|
|
|
2002-08-27 03:59:22 +00:00
|
|
|
#define NEXT_SCREEN THEME->GetMetric("ScreenCaution","NextScreen")
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
|
2002-08-27 23:31:41 +00:00
|
|
|
const ScreenMessage SM_GoToPrevScreen = ScreenMessage(SM_User-6);
|
2002-05-20 08:59:37 +00:00
|
|
|
const ScreenMessage SM_DoneOpening = ScreenMessage(SM_User-7);
|
|
|
|
|
const ScreenMessage SM_StartClosing = ScreenMessage(SM_User-8);
|
2002-08-27 03:59:22 +00:00
|
|
|
const ScreenMessage SM_GoToNextScreen = ScreenMessage(SM_User-9);
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
ScreenCaution::ScreenCaution()
|
|
|
|
|
{
|
2002-08-13 23:26:46 +00:00
|
|
|
GAMESTATE->m_bPlayersCanJoin = true;
|
|
|
|
|
|
2002-09-23 07:35:47 +00:00
|
|
|
m_Background.LoadFromAniDir( THEME->GetPathTo("BGAnimations","caution") );
|
|
|
|
|
this->AddChild( &m_Background );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
|
|
|
|
m_Wipe.OpenWipingRight( SM_DoneOpening );
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_Wipe );
|
2002-05-20 08:59:37 +00:00
|
|
|
|
2002-08-20 07:58:19 +00:00
|
|
|
m_FadeWipe.SetOpened();
|
2002-09-02 21:59:58 +00:00
|
|
|
this->AddChild( &m_FadeWipe );
|
2002-08-20 07:58:19 +00:00
|
|
|
|
2002-08-25 19:00:12 +00:00
|
|
|
this->SendScreenMessage( SM_StartClosing, 3 );
|
2002-08-27 16:53:25 +00:00
|
|
|
|
|
|
|
|
MUSIC->LoadAndPlayIfNotAlready( THEME->GetPathTo("Sounds","caution music") );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenCaution::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
|
|
|
|
if( m_Wipe.IsClosing() )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenCaution::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
switch( SM )
|
|
|
|
|
{
|
|
|
|
|
case SM_StartClosing:
|
2002-06-25 18:44:54 +00:00
|
|
|
if( !m_Wipe.IsClosing() )
|
2002-08-27 03:59:22 +00:00
|
|
|
m_Wipe.CloseWipingRight( SM_GoToNextScreen );
|
2002-05-20 08:59:37 +00:00
|
|
|
break;
|
|
|
|
|
case SM_DoneOpening:
|
2002-08-27 23:31:41 +00:00
|
|
|
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("caution") );
|
2002-05-20 08:59:37 +00:00
|
|
|
break;
|
2002-08-27 23:31:41 +00:00
|
|
|
case SM_GoToPrevScreen:
|
2002-08-27 03:59:22 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
2002-08-20 07:58:19 +00:00
|
|
|
break;
|
2002-08-27 03:59:22 +00:00
|
|
|
case SM_GoToNextScreen:
|
|
|
|
|
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
2002-05-20 08:59:37 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenCaution::MenuStart( PlayerNumber pn )
|
2002-05-20 08:59:37 +00:00
|
|
|
{
|
2002-09-04 03:49:08 +00:00
|
|
|
if( pn != PLAYER_INVALID && !GAMESTATE->m_bSideIsJoined[pn] )
|
2002-08-13 23:26:46 +00:00
|
|
|
{
|
2002-09-04 03:49:08 +00:00
|
|
|
GAMESTATE->m_bSideIsJoined[pn] = true;
|
2002-08-13 23:26:46 +00:00
|
|
|
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","menu start") );
|
|
|
|
|
SCREENMAN->RefreshCreditsMessages();
|
|
|
|
|
return; // don't fall though
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( !m_Wipe.IsOpening() && !m_Wipe.IsClosing() )
|
2002-08-27 03:59:22 +00:00
|
|
|
m_Wipe.CloseWipingRight( SM_GoToNextScreen );
|
2002-05-20 08:59:37 +00:00
|
|
|
}
|
2002-08-20 07:58:19 +00:00
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenCaution::MenuBack( PlayerNumber pn )
|
2002-08-20 07:58:19 +00:00
|
|
|
{
|
2002-08-20 08:29:55 +00:00
|
|
|
if(m_FadeWipe.IsClosing())
|
|
|
|
|
return;
|
2002-08-20 07:58:19 +00:00
|
|
|
this->ClearMessageQueue();
|
2002-08-27 23:31:41 +00:00
|
|
|
m_FadeWipe.CloseWipingLeft( SM_GoToPrevScreen );
|
2002-08-20 07:58:19 +00:00
|
|
|
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","menu back") );
|
|
|
|
|
}
|
|
|
|
|
|