From 50370506d94b975be670bda7532e582eda9191f9 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 20 Aug 2002 07:58:19 +0000 Subject: [PATCH] Allow backing out of the caution screen. --- stepmania/src/ScreenCaution.cpp | 16 ++++++++++++++++ stepmania/src/ScreenCaution.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/stepmania/src/ScreenCaution.cpp b/stepmania/src/ScreenCaution.cpp index 7ebfe8b10d..3b8a67280c 100644 --- a/stepmania/src/ScreenCaution.cpp +++ b/stepmania/src/ScreenCaution.cpp @@ -12,6 +12,7 @@ #include "ScreenCaution.h" +#include "ScreenTitleMenu.h" #include "GameConstantsAndTypes.h" #include "ScreenSelectStyle.h" #include "ScreenEZ2SelectStyle.h" @@ -24,6 +25,7 @@ #define USE_NORMAL_OR_EZ2_SELECT_STYLE THEME->GetMetricB("General","UseNormalOrEZ2SelectStyle") +const ScreenMessage SM_GoToPrevState = ScreenMessage(SM_User-6); const ScreenMessage SM_DoneOpening = ScreenMessage(SM_User-7); const ScreenMessage SM_StartClosing = ScreenMessage(SM_User-8); const ScreenMessage SM_GoToSelectMusic = ScreenMessage(SM_User-9); @@ -40,6 +42,9 @@ ScreenCaution::ScreenCaution() m_Wipe.OpenWipingRight( SM_DoneOpening ); this->AddSubActor( &m_Wipe ); + m_FadeWipe.SetOpened(); + this->AddSubActor( &m_FadeWipe ); + this->SendScreenMessage( SM_StartClosing, 3 ); } @@ -64,6 +69,9 @@ void ScreenCaution::HandleScreenMessage( const ScreenMessage SM ) case SM_DoneOpening: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_CAUTION) ); break; + case SM_GoToPrevState: + SCREENMAN->SetNewScreen( new ScreenTitleMenu ); + break; case SM_GoToSelectMusic: if( USE_NORMAL_OR_EZ2_SELECT_STYLE ) SCREENMAN->SetNewScreen( new ScreenEz2SelectStyle ); @@ -86,3 +94,11 @@ void ScreenCaution::MenuStart( const PlayerNumber p ) if( !m_Wipe.IsOpening() && !m_Wipe.IsClosing() ) m_Wipe.CloseWipingRight( SM_GoToSelectMusic ); } + +void ScreenCaution::MenuBack( const PlayerNumber p ) +{ + this->ClearMessageQueue(); + m_FadeWipe.CloseWipingLeft( SM_GoToPrevState ); + SOUND->PlayOnceStreamed( THEME->GetPathTo("Sounds","menu back") ); +} + diff --git a/stepmania/src/ScreenCaution.h b/stepmania/src/ScreenCaution.h index 91393d52e6..7f1da02132 100644 --- a/stepmania/src/ScreenCaution.h +++ b/stepmania/src/ScreenCaution.h @@ -15,6 +15,7 @@ #include "Screen.h" #include "TransitionFade.h" +#include "TransitionFadeWipe.h" #include "RandomSample.h" @@ -28,8 +29,10 @@ public: protected: void MenuStart( const PlayerNumber p ); + void MenuBack( const PlayerNumber p ); Sprite m_sprCaution; TransitionFade m_Wipe; + TransitionFadeWipe m_FadeWipe; }; #endif