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"
|
2003-07-26 23:05:16 +00:00
|
|
|
#include "RageSounds.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"
|
2003-05-23 19:05:29 +00:00
|
|
|
#include "RageLog.h"
|
2003-02-08 17:07:18 +00:00
|
|
|
|
|
|
|
|
#define NEXT_SCREEN THEME->GetMetric("ScreenStyleSplash","NextScreen")
|
2003-05-23 19:05:29 +00:00
|
|
|
#define NONSTOP_SCREEN THEME->GetMetric("ScreenStyleSplash","NonstopScreen")
|
|
|
|
|
#define ONI_SCREEN THEME->GetMetric("ScreenStyleSplash","OniScreen")
|
2003-02-08 17:07:18 +00:00
|
|
|
|
|
|
|
|
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
|
|
|
{
|
2003-07-26 23:05:16 +00:00
|
|
|
SOUND->StopMusic();
|
2003-02-08 17:07:18 +00:00
|
|
|
|
|
|
|
|
CString sGameName = GAMESTATE->GetCurrentGameDef()->m_szName;
|
|
|
|
|
CString sStyleName = GAMESTATE->GetCurrentStyleDef()->m_szName;
|
2003-05-23 19:05:29 +00:00
|
|
|
|
2003-07-03 21:27:46 +00:00
|
|
|
LOG->Trace( ssprintf("ScreenStyleSplash: Displaying Splash for style: %s", sStyleName.c_str()));
|
2003-05-23 19:05:29 +00:00
|
|
|
|
2003-02-08 17:07:18 +00:00
|
|
|
int iDifficulty = GAMESTATE->m_PreferredDifficulty[0];
|
2003-05-23 19:05:29 +00:00
|
|
|
if( GAMESTATE->m_bSideIsJoined[PLAYER_1] )
|
|
|
|
|
{
|
|
|
|
|
iDifficulty = GAMESTATE->m_PreferredDifficulty[PLAYER_1];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
iDifficulty = GAMESTATE->m_PreferredDifficulty[PLAYER_2];
|
|
|
|
|
}
|
2003-02-08 17:07:18 +00:00
|
|
|
|
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-07-26 23:05:16 +00:00
|
|
|
SOUND->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();
|
|
|
|
|
}
|
|
|
|
|
|