Files
itgmania212121/stepmania/src/ScreenGameOver.cpp
T

83 lines
2.7 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
#include "ScreenGameOver.h"
#include "ScreenManager.h"
2002-05-28 20:01:22 +00:00
#include "AnnouncerManager.h"
2004-07-08 00:10:34 +00:00
#include "GameSoundManager.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-09-27 22:30:51 +00:00
ScreenGameOver::ScreenGameOver( CString sName ) : Screen( sName )
2002-05-27 08:23:27 +00:00
{
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-28 20:01:22 +00:00
2003-07-26 22:53:22 +00:00
SOUND->PlayMusic( THEME->GetPathToS("ScreenGameOver music") );
2002-05-28 20:01:22 +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
}
2004-06-08 05:22:33 +00:00
/*
* (c) 2002-2003 Chris Danford
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/