added TransitionBGAnimation

This commit is contained in:
Chris Danford
2003-03-05 08:48:35 +00:00
parent d34102b717
commit 267fcec652
11 changed files with 169 additions and 32 deletions
+24 -20
View File
@@ -36,14 +36,18 @@ ScreenCaution::ScreenCaution()
return;
}
m_Background.LoadFromAniDir( THEME->GetPathTo("BGAnimations","caution") );
m_Background.LoadFromAniDir( THEME->GetPathTo("BGAnimations","caution background") );
this->AddChild( &m_Background );
m_Wipe.OpenWipingRight( SM_DoneOpening );
this->AddChild( &m_Wipe );
m_In.Load( THEME->GetPathTo("BGAnimations","caution in") );
m_In.StartTransitioning( SM_DoneOpening );
this->AddChild( &m_In );
m_FadeWipe.SetOpened();
this->AddChild( &m_FadeWipe );
m_Out.Load( THEME->GetPathTo("BGAnimations","caution out") );
this->AddChild( &m_Out );
m_Back.Load( THEME->GetPathTo("BGAnimations","menu back") );
this->AddChild( &m_Back );
this->SendScreenMessage( SM_StartClosing, 3 );
@@ -53,7 +57,16 @@ ScreenCaution::ScreenCaution()
void ScreenCaution::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
if( m_Wipe.IsClosing() )
PlayerNumber pn = MenuI.player;
if( MenuI.IsValid() && pn!=PLAYER_INVALID && !GAMESTATE->m_bSideIsJoined[pn] )
{
GAMESTATE->m_bSideIsJoined[pn] = true;
SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","menu start") );
SCREENMAN->RefreshCreditsMessages();
return; // don't fall though
}
if( m_In.IsTransitioning() || m_Out.IsTransitioning() || m_Back.IsTransitioning() )
return;
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
@@ -65,8 +78,8 @@ void ScreenCaution::HandleScreenMessage( const ScreenMessage SM )
switch( SM )
{
case SM_StartClosing:
if( !m_Wipe.IsClosing() )
m_Wipe.CloseWipingRight( SM_GoToNextScreen );
if( !m_Out.IsTransitioning() )
m_Out.StartTransitioning( SM_GoToNextScreen );
break;
case SM_DoneOpening:
SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("caution") );
@@ -82,24 +95,15 @@ void ScreenCaution::HandleScreenMessage( const ScreenMessage SM )
void ScreenCaution::MenuStart( PlayerNumber pn )
{
if( pn != PLAYER_INVALID && !GAMESTATE->m_bSideIsJoined[pn] )
{
GAMESTATE->m_bSideIsJoined[pn] = true;
SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","menu start") );
SCREENMAN->RefreshCreditsMessages();
return; // don't fall though
}
if( !m_Wipe.IsOpening() && !m_Wipe.IsClosing() )
m_Wipe.CloseWipingRight( SM_GoToNextScreen );
m_Out.StartTransitioning( SM_GoToNextScreen );
}
void ScreenCaution::MenuBack( PlayerNumber pn )
{
if(m_FadeWipe.IsClosing())
if( m_In.IsTransitioning() || m_Out.IsTransitioning() )
return;
this->ClearMessageQueue();
m_FadeWipe.CloseWipingLeft( SM_GoToPrevScreen );
m_Back.StartTransitioning( SM_GoToPrevScreen );
SOUNDMAN->PlayOnce( THEME->GetPathTo("Sounds","menu back") );
}