diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index e4b6b42195..b01f5b5e2d 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -39,9 +39,8 @@ ScreenSelect::ScreenSelect( CString sClassName ) : Screen(sClassName) m_sName = sClassName; - GAMESTATE->m_bPlayersCanJoin = false; - // Set this true later if we discover a choice that chooses the Style - + /* If we don't have a style set yet, players can still join. */ + GAMESTATE->m_bPlayersCanJoin = ( GAMESTATE->m_CurStyle == STYLE_INVALID ); for( int c=0; cGetSelectionIndex((PlayerNumber)p)].Apply( (PlayerNumber)p ); int iSelectionIndex = GetSelectionIndex(GAMESTATE->m_MasterPlayerNumber); - SCREENMAN->SetNewScreen( NEXT_SCREEN(iSelectionIndex) ); + if( m_aModeChoices[iSelectionIndex ].m_sScreen != "" ) + SCREENMAN->SetNewScreen( m_aModeChoices[iSelectionIndex ].m_sScreen ); + else + SCREENMAN->SetNewScreen( NEXT_SCREEN(iSelectionIndex) ); } break; } diff --git a/stepmania/src/ScreenSelectMaster.cpp b/stepmania/src/ScreenSelectMaster.cpp index e916a58abd..cbe10663d6 100644 --- a/stepmania/src/ScreenSelectMaster.cpp +++ b/stepmania/src/ScreenSelectMaster.cpp @@ -20,6 +20,7 @@ #include "AnnouncerManager.h" #include "ModeChoice.h" #include "ActorUtil.h" +#include "RageLog.h" #define NUM_ICON_PARTS THEME->GetMetricI(m_sName,"NumIconParts") #define NUM_PREVIEW_PARTS THEME->GetMetricI(m_sName,"NumPreviewParts") @@ -36,13 +37,6 @@ const ScreenMessage SM_PlayPostSwitchPage = (ScreenMessage)(SM_User+1); ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sClassName ) { - /* ScreenSelect::ScreenSelect will have set m_bPlayersCanJoin if the style is being - * set. We should either have a style or be setting the style, or GameState::IsHumanPlayer - * will always return true. Nothing does this right now, and it's an easy mistake, - * so don't allow it. */ - if( GAMESTATE->m_CurStyle == STYLE_INVALID && !GAMESTATE->m_bPlayersCanJoin ) - RageException::Throw("Screen %s doesn't set the style and the style isn't already set", m_sName.c_str() ); - int p, i; for( p=0; pIsHumanPlayer((PlayerNumber)p) ) - bAllDone &= m_bChosen[p]; + + /* If SHARED_PREVIEW_AND_CURSOR, only one player has to pick. */ + if( !SHARED_PREVIEW_AND_CURSOR ) + { + // check to see if everyone has chosen + for( p=0; pIsHumanPlayer((PlayerNumber)p) ) + bAllDone &= m_bChosen[p]; + } + if( bAllDone ) this->PostScreenMessage( SM_BeginFadingOut, fSecs );// tell our owner it's time to move on } +/* + * We want all items to always run OnCommand and either GainFocus or LoseFocus on + * tween-in. If we only run OnCommand, then it has to contain a copy of either + * GainFocus or LoseFocus, which implies that the default setting is hard-coded in + * the theme. Always run both. + * + * However, the actual tween-in is OnCommand; we don't always want to actually run + * through the Gain/LoseFocus tweens during initial tween-in. So, we run the focus + * command first, do a FinishTweening to pop it in place, and then run OnCommand. + * This means that the focus command should be position neutral; eg. only use "addx", + * not "x". + */ float ScreenSelectMaster::TweenOnScreen() { float fSecs = 0; @@ -460,15 +474,9 @@ float ScreenSelectMaster::TweenOnScreen() { for( int i=0; iFinishTweening(); fSecs = max( fSecs, SET_XY_AND_ON_COMMAND( m_sprIcon[i][c] ) ); - for( int c=0; c<(int) m_aModeChoices.size(); c++ ) - { - const bool GainingFocus = (c == m_iChoice[0]); - fSecs = max( fSecs, COMMAND( m_sprIcon[i][c], GainingFocus? "GainFocus":"LoseFocus" ) ); - if( !GainingFocus ) - m_sprIcon[i][c]->FinishTweening(); - } - } if( SHARED_PREVIEW_AND_CURSOR ) @@ -476,12 +484,9 @@ float ScreenSelectMaster::TweenOnScreen() int p=0; for( int i=0; iFinishTweening(); fSecs = max( fSecs, SET_XY_AND_ON_COMMAND( m_sprPreview[i][c][p] ) ); - const bool GainingFocus = (int(c) == m_iChoice[p]); - fSecs = max( fSecs, COMMAND( m_sprPreview[i][c][p], GainingFocus? "GainFocus":"LoseFocus" ) ); - if( !GainingFocus ) - m_sprPreview[i][c][p]->FinishTweening(); } } else @@ -490,37 +495,13 @@ float ScreenSelectMaster::TweenOnScreen() if( GAMESTATE->IsPlayerEnabled(p) ) for( int i=0; iFinishTweening(); fSecs = max( fSecs, SET_XY_AND_ON_COMMAND( m_sprPreview[i][c][p] ) ); - const bool GainingFocus = (int(c) == m_iChoice[p]); - fSecs = max( fSecs, COMMAND( m_sprPreview[i][c][p], GainingFocus? "GainFocus":"LoseFocus" ) ); - if( !GainingFocus ) - m_sprPreview[i][c][p]->FinishTweening(); } } } - if( SHARED_PREVIEW_AND_CURSOR ) - { - for( int i=0; iIsPlayerEnabled(p) ) - continue; - for( int c=0; c<(int) m_aModeChoices.size(); c++ ) - for( int i=0; iIsPlayerEnabled(p) && m_iChoice[p] == (int)c ) + SelectedByEitherPlayer = true; + + if( SelectedByEitherPlayer ) + fSecs = max( fSecs, COMMAND( m_sprIcon[i][c], "OffFocused" ) ); + else + fSecs = max( fSecs, COMMAND( m_sprIcon[i][c], "OffUnfocused" ) ); + } + if( SHARED_PREVIEW_AND_CURSOR ) {