2003-02-16 04:01:45 +00:00
|
|
|
#include "global.h"
|
2003-02-08 17:07:18 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: ScreenCaution
|
|
|
|
|
|
|
|
|
|
Desc: Screen that displays while resources are being loaded.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenStyleSplash.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "RageSoundManager.h"
|
2003-03-22 20:28:03 +00:00
|
|
|
#include "ScreenManager.h"
|
2003-02-08 17:07:18 +00:00
|
|
|
#include "ThemeManager.h"
|
|
|
|
|
#include "GameState.h"
|
|
|
|
|
#include "GameManager.h"
|
|
|
|
|
|
|
|
|
|
#define NEXT_SCREEN THEME->GetMetric("ScreenStyleSplash","NextScreen")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ScreenMessage SM_DoneOpening = ScreenMessage(SM_User-7);
|
|
|
|
|
const ScreenMessage SM_StartClosing = ScreenMessage(SM_User-8);
|
|
|
|
|
|
|
|
|
|
|
2003-04-12 06:16:12 +00:00
|
|
|
ScreenStyleSplash::ScreenStyleSplash() : Screen("ScreenStyleSplash")
|
2003-02-08 17:07:18 +00:00
|
|
|
{
|
|
|
|
|
SOUNDMAN->StopMusic();
|
|
|
|
|
|
|
|
|
|
if(!PREFSMAN->m_bShowDontDie)
|
|
|
|
|
{
|
2003-03-25 21:17:29 +00:00
|
|
|
this->PostScreenMessage( SM_GoToNextScreen, 0.f );
|
2003-02-08 17:07:18 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
|
|
|
|
|
CString sStyleName = GAMESTATE->GetCurrentStyleDef()->m_szName;
|
|
|
|
|
int iDifficulty = GAMESTATE->m_PreferredDifficulty[0];
|
|
|
|
|
|
2003-04-25 00:01:35 +00:00
|
|
|
m_Background.LoadFromAniDir( THEME->GetPathToB(ssprintf("ScreenStyleSplash-%s-%s-%d",sGameName.c_str(),sStyleName.c_str(),iDifficulty) ) );
|
2003-02-08 17:07:18 +00:00
|
|
|
this->AddChild( &m_Background );
|
|
|
|
|
|
2003-05-05 11:50:18 +00:00
|
|
|
m_Menu.Load( "ScreenStyleSplash", false, false );
|
2003-03-22 20:28:03 +00:00
|
|
|
this->AddChild( &m_Menu );
|
2003-02-08 17:07:18 +00:00
|
|
|
|
2003-03-25 21:17:29 +00:00
|
|
|
this->PostScreenMessage( SM_StartClosing, 2 );
|
2003-02-08 17:07:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenStyleSplash::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
2003-03-22 20:28:03 +00:00
|
|
|
if( m_Menu.IsTransitioning() )
|
2003-02-08 17:07:18 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenStyleSplash::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
switch( SM )
|
|
|
|
|
{
|
|
|
|
|
case SM_StartClosing:
|
2003-03-22 20:28:03 +00:00
|
|
|
if( !m_Menu.IsTransitioning() )
|
|
|
|
|
m_Menu.StartTransitioning( SM_GoToNextScreen );
|
2003-02-08 17:07:18 +00:00
|
|
|
break;
|
|
|
|
|
case SM_DoneOpening:
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case SM_GoToPrevScreen:
|
|
|
|
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
|
|
|
|
break;
|
|
|
|
|
case SM_GoToNextScreen:
|
|
|
|
|
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenStyleSplash::MenuStart( PlayerNumber pn )
|
|
|
|
|
{
|
2003-03-22 20:28:03 +00:00
|
|
|
m_Menu.StartTransitioning( SM_GoToNextScreen );
|
2003-02-08 17:07:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenStyleSplash::MenuBack( PlayerNumber pn )
|
|
|
|
|
{
|
2003-03-22 20:28:03 +00:00
|
|
|
if(m_Menu.IsTransitioning())
|
2003-02-08 17:07:18 +00:00
|
|
|
return;
|
|
|
|
|
this->ClearMessageQueue();
|
2003-03-22 20:28:03 +00:00
|
|
|
m_Menu.Back( SM_GoToPrevScreen );
|
2003-04-12 17:39:27 +00:00
|
|
|
SOUNDMAN->PlayOnce( THEME->GetPathToS("menu back") );
|
2003-02-08 17:07:18 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-22 20:28:03 +00:00
|
|
|
void ScreenStyleSplash::DrawPrimitives()
|
|
|
|
|
{
|
|
|
|
|
m_Menu.DrawBottomLayer();
|
|
|
|
|
Screen::DrawPrimitives();
|
|
|
|
|
m_Menu.DrawTopLayer();
|
|
|
|
|
}
|
|
|
|
|
|