2002-05-27 08:23:27 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: ScreenGameOver
|
|
|
|
|
|
|
|
|
|
Desc: See header.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenGameOver.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "PrefsManager.h"
|
2002-05-27 08:23:27 +00:00
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "TransitionFadeWipe.h"
|
|
|
|
|
#include "Sprite.h"
|
|
|
|
|
#include "AnnouncerManager.h"
|
|
|
|
|
#include "ScreenManager.h"
|
2002-05-28 20:01:22 +00:00
|
|
|
#include "AnnouncerManager.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
#include "GameState.h"
|
|
|
|
|
|
2002-05-27 08:23:27 +00:00
|
|
|
|
|
|
|
|
const ScreenMessage SM_StartFadingOut = ScreenMessage(SM_User + 1);
|
|
|
|
|
const ScreenMessage SM_GoToNextState = ScreenMessage(SM_User + 2);
|
2002-05-28 20:01:22 +00:00
|
|
|
const ScreenMessage SM_PlayAnnouncer = ScreenMessage(SM_User + 3);
|
2002-05-27 08:23:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
ScreenGameOver::ScreenGameOver()
|
|
|
|
|
{
|
2002-07-23 01:41:40 +00:00
|
|
|
m_bClosing = false;
|
|
|
|
|
|
2002-08-13 23:26:46 +00:00
|
|
|
m_sprGameOver.Load( THEME->GetPathTo("Graphics","game over") );
|
2002-05-28 20:01:22 +00:00
|
|
|
m_sprGameOver.SetXY( CENTER_X, CENTER_Y );
|
2002-07-23 01:41:40 +00:00
|
|
|
this->AddSubActor( &m_sprGameOver );
|
2002-05-28 20:01:22 +00:00
|
|
|
|
|
|
|
|
// tween game over
|
2002-08-18 16:19:26 +00:00
|
|
|
m_sprGameOver.SetGlowColor( D3DXCOLOR(1,1,1,0) );
|
2002-05-28 20:01:22 +00:00
|
|
|
m_sprGameOver.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
|
|
|
|
|
|
|
|
|
m_sprGameOver.BeginTweeningQueued( 0.5f ); // fade to white
|
|
|
|
|
m_sprGameOver.SetTweenAddColor( D3DXCOLOR(1,1,1,1) );
|
|
|
|
|
|
|
|
|
|
m_sprGameOver.BeginTweeningQueued( 0.01f ); // turn color on
|
|
|
|
|
m_sprGameOver.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,1) );
|
|
|
|
|
|
|
|
|
|
m_sprGameOver.BeginTweeningQueued( 0.5f ); // fade to color
|
|
|
|
|
m_sprGameOver.SetTweenAddColor( D3DXCOLOR(1,1,1,0) );
|
2002-05-27 08:23:27 +00:00
|
|
|
|
2002-07-11 00:44:34 +00:00
|
|
|
// BUGFIX by ANDY: Stage will now reset back to 0 when game ends.
|
2002-07-23 01:41:40 +00:00
|
|
|
GAMESTATE->m_iCurrentStageIndex = 0;
|
2002-05-27 08:23:27 +00:00
|
|
|
|
2002-05-28 20:01:22 +00:00
|
|
|
this->SendScreenMessage( SM_PlayAnnouncer, 0.5 );
|
2002-05-27 08:23:27 +00:00
|
|
|
this->SendScreenMessage( SM_StartFadingOut, 5 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ScreenGameOver::HandleScreenMessage( const ScreenMessage SM )
|
|
|
|
|
{
|
|
|
|
|
switch( SM )
|
|
|
|
|
{
|
2002-05-28 20:01:22 +00:00
|
|
|
case SM_PlayAnnouncer:
|
|
|
|
|
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_GAME_OVER) );
|
|
|
|
|
break;
|
2002-05-27 08:23:27 +00:00
|
|
|
case SM_StartFadingOut:
|
2002-07-23 01:41:40 +00:00
|
|
|
m_bClosing = true;
|
2002-05-28 20:01:22 +00:00
|
|
|
m_sprGameOver.BeginTweening( 0.8f );
|
|
|
|
|
m_sprGameOver.SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
2002-05-27 08:23:27 +00:00
|
|
|
this->SendScreenMessage( SM_GoToNextState, 0.8f );
|
|
|
|
|
break;
|
|
|
|
|
case SM_GoToNextState:
|
2002-08-27 03:59:22 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
2002-05-27 08:23:27 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-28 20:01:22 +00:00
|
|
|
void ScreenGameOver::MenuStart( PlayerNumber p )
|
|
|
|
|
{
|
2002-07-23 01:41:40 +00:00
|
|
|
if( m_bClosing )
|
|
|
|
|
return;
|
|
|
|
|
|
2002-05-28 20:01:22 +00:00
|
|
|
this->ClearMessageQueue();
|
|
|
|
|
this->SendScreenMessage( SM_StartFadingOut, 0 );
|
|
|
|
|
}
|