Files
itgmania212121/stepmania/src/ScreenGameOver.cpp
T

72 lines
1.8 KiB
C++
Raw Normal View History

2003-02-16 04:01:45 +00:00
#include "global.h"
2002-05-27 08:23:27 +00:00
/*
-----------------------------------------------------------------------------
Class: ScreenGameOver
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ScreenGameOver.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-07-26 22:53:22 +00:00
#include "RageSounds.h"
#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-05-28 20:01:22 +00:00
const ScreenMessage SM_PlayAnnouncer = ScreenMessage(SM_User + 3);
2002-05-27 08:23:27 +00:00
2003-04-05 03:49:03 +00:00
#define NEXT_SCREEN THEME->GetMetric("ScreenGameOver","NextScreen")
2003-04-12 06:16:12 +00:00
ScreenGameOver::ScreenGameOver() : Screen("ScreenGameOver")
2002-05-27 08:23:27 +00:00
{
GAMESTATE->Reset();
m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenGameOver background") );
this->AddChild( &m_Background );
2002-07-23 01:41:40 +00:00
m_In.Load( THEME->GetPathToB("ScreenGameOver in") );
this->AddChild( &m_In );
m_Out.Load( THEME->GetPathToB("ScreenGameOver out") );
this->AddChild( &m_Out );
2002-05-27 08:23:27 +00:00
2003-07-26 22:53:22 +00:00
SOUND->PlayMusic( THEME->GetPathToS("ScreenGameOver music") );
2002-05-27 08:23:27 +00:00
m_In.StartTransitioning( SM_PlayAnnouncer );
this->PostScreenMessage( SM_StartFadingOut, m_Background.GetLengthSeconds() );
2002-05-27 08:23:27 +00:00
}
void ScreenGameOver::HandleScreenMessage( const ScreenMessage SM )
{
switch( SM )
{
2002-05-28 20:01:22 +00:00
case SM_PlayAnnouncer:
2003-07-26 22:53:22 +00:00
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("game over") );
2002-05-28 20:01:22 +00:00
break;
2002-05-27 08:23:27 +00:00
case SM_StartFadingOut:
m_Out.StartTransitioning( SM_GoToNextScreen );
2002-05-27 08:23:27 +00:00
break;
case SM_GoToNextScreen:
2003-04-05 03:49:03 +00:00
SCREENMAN->SetNewScreen( NEXT_SCREEN );
2002-05-27 08:23:27 +00:00
break;
}
}
void ScreenGameOver::MenuStart( PlayerNumber pn )
2002-05-28 20:01:22 +00:00
{
if( m_In.IsTransitioning() || m_Out.IsTransitioning() )
2002-07-23 01:41:40 +00:00
return;
2002-05-28 20:01:22 +00:00
this->ClearMessageQueue();
2003-03-25 21:17:29 +00:00
this->PostScreenMessage( SM_StartFadingOut, 0 );
2002-05-28 20:01:22 +00:00
}