diff --git a/stepmania/src/OptionRowHandler.cpp b/stepmania/src/OptionRowHandler.cpp index 265c3358f0..20a576e033 100644 --- a/stepmania/src/OptionRowHandler.cpp +++ b/stepmania/src/OptionRowHandler.cpp @@ -145,6 +145,7 @@ public: for( int col = 0; col < NumCols; ++col ) { GameCommand mc; + mc.ApplyCommitsScreens( false ); mc.Load( 0, ParseCommands(ENTRY_MODE(sParam, col)) ); /* If the row has just one entry, use the name of the row as the name of the * entry. If it has more than one, each one must be specified explicitly. */ @@ -261,10 +262,10 @@ public: gcOut = ListEntries[iFirstSelection]; } - virtual bool HasScreen( int iChoice ) const + virtual RString GetScreen( int iChoice ) const { const GameCommand &gc = ListEntries[iChoice]; - return !gc.m_sScreen.empty(); + return gc.m_sScreen; } void FillNoteSkins( OptionRowDefinition &defOut, CString sParam ) @@ -1165,6 +1166,7 @@ public: void Init() { m_gc.Init(); + m_gc.ApplyCommitsScreens( false ); } virtual void LoadInternal( OptionRowDefinition &defOut, const Commands &cmds ) { @@ -1197,9 +1199,9 @@ public: sIconTextOut = ""; gcOut = m_gc; } - virtual bool HasScreen( int iChoice ) const + virtual RString GetScreen( int iChoice ) const { - return !m_gc.m_sScreen.empty(); + return m_gc.m_sScreen; } }; diff --git a/stepmania/src/OptionRowHandler.h b/stepmania/src/OptionRowHandler.h index c527848f50..99b68c6c65 100644 --- a/stepmania/src/OptionRowHandler.h +++ b/stepmania/src/OptionRowHandler.h @@ -34,7 +34,7 @@ public: /* Returns an OPT mask. */ virtual int ExportOption( const OptionRowDefinition &def, const vector &vpns, const vector vbSelected[NUM_PLAYERS] ) const = 0; virtual void GetIconTextAndGameCommand( const OptionRowDefinition &def, int iFirstSelection, CString &sIconTextOut, GameCommand &gcOut ) const; - virtual bool HasScreen( int iChoice ) const { return false; } + virtual RString GetScreen( int iChoice ) const { return RString(); } }; diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index 1a0839fa56..97bd8967a7 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -20,8 +20,6 @@ #define OPTION_MENU_FLAGS THEME->GetMetric (m_sName,"OptionMenuFlags") #define LINE(sLineName) THEME->GetMetric (m_sName,ssprintf("Line%s",sLineName.c_str())) -#define NEXT_SCREEN THEME->GetMetric (m_sName,"NextScreen") - REGISTER_SCREEN_CLASS( ScreenOptionsMaster ); ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ): @@ -130,8 +128,6 @@ void ScreenOptionsMaster::BeginFadingOut() { /* If the selection is on a LIST, and the selected LIST option sets the screen, * honor it. */ - m_bExportWillSetANewScreen = false; - int iCurRow = this->GetCurrentRow(); ASSERT( iCurRow >= 0 && iCurRow < (int)m_pRows.size() ); const OptionRow &row = *m_pRows[iCurRow]; @@ -145,12 +141,16 @@ void ScreenOptionsMaster::BeginFadingOut() { const OptionRowHandler *pHand = m_OptionRowHandlers[iCurRow]; if( pHand != NULL ) - m_bExportWillSetANewScreen = pHand->HasScreen( iChoice ); + { + CString sThisScreen = pHand->GetScreen( iChoice ); + if( sThisScreen != "" ) + m_sNextScreen = sThisScreen; + } } } // If options set a NextScreen or one is specified in metrics, then fade out - if( m_bExportWillSetANewScreen || NEXT_SCREEN != "" ) + if( GetNextScreen() != "" ) ScreenOptions::BeginFadingOut(); } @@ -205,8 +205,7 @@ void ScreenOptionsMaster::HandleScreenMessage( const ScreenMessage SM ) if( m_iChangeMask & OPT_RESET_GAME ) { StepMania::ResetGame(); - SCREENMAN->SetNewScreen( CommonMetrics::INITIAL_SCREEN ); - m_bExportWillSetANewScreen = false; + m_sNextScreen = CommonMetrics::INITIAL_SCREEN; } if( m_iChangeMask & OPT_APPLY_SOUND ) @@ -218,18 +217,7 @@ void ScreenOptionsMaster::HandleScreenMessage( const ScreenMessage SM ) SONGMAN->SetPreferences(); CHECKPOINT; - if( !(m_iChangeMask & OPT_RESET_GAME) ) - this->HandleScreenMessage( SM_GoToNextScreen ); - return; - } - else if( SM == SM_GoToNextScreen ) - { - if( SCREENMAN->IsStackedScreen(this) ) - SCREENMAN->PopTopScreen( SM_None ); - else if( m_bExportWillSetANewScreen ) - ; // Do nothing. Let Export set the screen. - else if( NEXT_SCREEN != "" ) - SCREENMAN->SetNewScreen( NEXT_SCREEN ); + this->HandleScreenMessage( SM_GoToNextScreen ); return; } else