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"
|
2003-01-02 07:54:28 +00:00
|
|
|
#include "RageSoundManager.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "ThemeManager.h"
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2002-05-27 08:23:27 +00:00
|
|
|
|
|
|
|
|
const ScreenMessage SM_StartFadingOut = ScreenMessage(SM_User + 1);
|
2002-08-27 23:31:41 +00:00
|
|
|
const ScreenMessage SM_GoToNextScreen = 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-09-24 02:55:32 +00:00
|
|
|
m_Background.LoadFromAniDir( THEME->GetPathTo("BGAnimations","game over") );
|
|
|
|
|
this->AddChild( &m_Background );
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2002-09-24 02:55:32 +00:00
|
|
|
m_Fade.OpenWipingRight( SM_None );
|
|
|
|
|
this->AddChild( &m_Fade );
|
2002-05-27 08:23:27 +00:00
|
|
|
|
2003-01-02 07:39:58 +00:00
|
|
|
SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","game over music") );
|
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:
|
2002-08-27 23:31:41 +00:00
|
|
|
SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo("game over") );
|
2002-05-28 20:01:22 +00:00
|
|
|
break;
|
2002-05-27 08:23:27 +00:00
|
|
|
case SM_StartFadingOut:
|
2002-09-24 02:55:32 +00:00
|
|
|
m_Fade.CloseWipingRight( SM_GoToNextScreen );
|
2002-05-27 08:23:27 +00:00
|
|
|
break;
|
2002-08-27 23:31:41 +00:00
|
|
|
case SM_GoToNextScreen:
|
2002-08-27 03:59:22 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
2002-05-27 08:23:27 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-04 03:49:08 +00:00
|
|
|
void ScreenGameOver::MenuStart( PlayerNumber pn )
|
2002-05-28 20:01:22 +00:00
|
|
|
{
|
2002-09-24 02:55:32 +00:00
|
|
|
if( m_Fade.IsClosing() )
|
2002-07-23 01:41:40 +00:00
|
|
|
return;
|
|
|
|
|
|
2002-05-28 20:01:22 +00:00
|
|
|
this->ClearMessageQueue();
|
|
|
|
|
this->SendScreenMessage( SM_StartFadingOut, 0 );
|
|
|
|
|
}
|