Files
itgmania212121/stepmania/src/ScreenCaution.cpp
T

107 lines
2.9 KiB
C++
Raw Normal View History

2002-05-20 08:59:37 +00:00
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: ScreenCaution
2002-05-20 08:59:37 +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.
Chris Danford
2002-05-20 08:59:37 +00:00
-----------------------------------------------------------------------------
*/
#include "ScreenCaution.h"
2002-08-20 07:58:19 +00:00
#include "ScreenTitleMenu.h"
2002-05-20 08:59:37 +00:00
#include "GameConstantsAndTypes.h"
#include "ScreenSelectStyle.h"
#include "ScreenEZ2SelectStyle.h"
2002-05-20 08:59:37 +00:00
#include "RageTextureManager.h"
2002-07-23 01:41:40 +00:00
#include "PrefsManager.h"
2002-05-20 08:59:37 +00:00
#include "AnnouncerManager.h"
#include "GameState.h"
2002-08-15 16:45:49 +00:00
#define USE_NORMAL_OR_EZ2_SELECT_STYLE THEME->GetMetricB("General","UseNormalOrEZ2SelectStyle")
2002-05-20 08:59:37 +00:00
2002-08-20 07:58:19 +00:00
const ScreenMessage SM_GoToPrevState = 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);
const ScreenMessage SM_GoToSelectMusic = ScreenMessage(SM_User-9);
ScreenCaution::ScreenCaution()
{
GAMESTATE->m_bPlayersCanJoin = true;
m_sprCaution.Load( THEME->GetPathTo("Graphics","caution") );
m_sprCaution.StretchTo( CRect(SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM) );
2002-07-23 01:41:40 +00:00
this->AddSubActor( &m_sprCaution );
2002-05-20 08:59:37 +00:00
m_Wipe.OpenWipingRight( SM_DoneOpening );
2002-07-23 01:41:40 +00:00
this->AddSubActor( &m_Wipe );
2002-05-20 08:59:37 +00:00
2002-08-20 07:58:19 +00:00
m_FadeWipe.SetOpened();
this->AddSubActor( &m_FadeWipe );
this->SendScreenMessage( SM_StartClosing, 1 );
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() )
m_Wipe.CloseWipingRight( SM_GoToSelectMusic );
2002-05-20 08:59:37 +00:00
break;
case SM_DoneOpening:
2002-07-11 19:02:26 +00:00
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_CAUTION) );
2002-05-20 08:59:37 +00:00
break;
2002-08-20 07:58:19 +00:00
case SM_GoToPrevState:
SCREENMAN->SetNewScreen( new ScreenTitleMenu );
break;
2002-05-20 08:59:37 +00:00
case SM_GoToSelectMusic:
if( USE_NORMAL_OR_EZ2_SELECT_STYLE )
SCREENMAN->SetNewScreen( new ScreenEz2SelectStyle );
else
SCREENMAN->SetNewScreen( new ScreenSelectStyle );
2002-05-20 08:59:37 +00:00
break;
}
}
2002-05-27 18:36:01 +00:00
void ScreenCaution::MenuStart( const PlayerNumber p )
2002-05-20 08:59:37 +00:00
{
2002-08-20 21:00:56 +00:00
if( p != PLAYER_INVALID && !GAMESTATE->m_bSideIsJoined[p] )
{
2002-08-20 21:00:56 +00:00
GAMESTATE->m_bSideIsJoined[p] = true;
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","menu start") );
SCREENMAN->RefreshCreditsMessages();
return; // don't fall though
}
if( !m_Wipe.IsOpening() && !m_Wipe.IsClosing() )
2002-06-25 18:44:54 +00:00
m_Wipe.CloseWipingRight( SM_GoToSelectMusic );
2002-05-20 08:59:37 +00:00
}
2002-08-20 07:58:19 +00:00
void ScreenCaution::MenuBack( const PlayerNumber p )
{
if(m_FadeWipe.IsClosing())
return;
2002-08-20 07:58:19 +00:00
this->ClearMessageQueue();
m_FadeWipe.CloseWipingLeft( SM_GoToPrevState );
SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","menu back") );
}