NextSong/PrevSong now work when TwoPartSelection=true + TwoPartConfirmsOnly=true on ScreenSelectMusic. A new message ("TwoPartConfirmCanceled") was added to catch when this happens.

This commit is contained in:
AJ Kelly
2010-04-03 14:56:31 -05:00
parent 9e019c194f
commit cd2bb9df35
+38 -4
View File
@@ -357,6 +357,7 @@ void ScreenSelectMusic::CheckBackgroundRequests( bool bForce )
FallbackMusic.fFadeInLengthSeconds = SAMPLE_MUSIC_FALLBACK_FADE_IN_SECONDS; FallbackMusic.fFadeInLengthSeconds = SAMPLE_MUSIC_FALLBACK_FADE_IN_SECONDS;
FallbackMusic.bAlignBeat = ALIGN_MUSIC_BEATS; FallbackMusic.bAlignBeat = ALIGN_MUSIC_BEATS;
//if( SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_StartToPreview )
SOUND->PlayMusic( PlayParams, FallbackMusic ); SOUND->PlayMusic( PlayParams, FallbackMusic );
} }
} }
@@ -616,7 +617,38 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
} }
} }
if(!TWO_PART_CONFIRMS_ONLY) // two part confirms only means we can actually change songs here,
// so we need some hackery. oops looks like this is never going into
// mainline sm4 then -aj
if(TWO_PART_CONFIRMS_ONLY)
{
if( m_SelectionState == SelectionState_SelectingSteps)
{
if( input.MenuI == m_GameButtonPreviousSong )
{
if( GAMESTATE->IsAnExtraStageAndSelectionLocked() )
m_soundLocked.Play();
else
{
m_SelectionState = SelectionState_SelectingSong;
MESSAGEMAN->Broadcast("TwoPartConfirmCanceled");
m_MusicWheel.ChangeMusicUnlessLocked( -1 );
}
}
else if( input.MenuI == m_GameButtonNextSong )
{
if( GAMESTATE->IsAnExtraStageAndSelectionLocked() )
m_soundLocked.Play();
else
{
m_SelectionState = SelectionState_SelectingSong;
MESSAGEMAN->Broadcast("TwoPartConfirmCanceled");
m_MusicWheel.ChangeMusicUnlessLocked( +1 );
}
}
}
}
else
{ {
if( m_SelectionState == SelectionState_SelectingSteps && if( m_SelectionState == SelectionState_SelectingSteps &&
input.type == IET_FIRST_PRESS && input.type == IET_FIRST_PRESS &&
@@ -1017,9 +1049,6 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
return; return;
} }
// I believe this is for those who like pump pro. -aj
MESSAGEMAN->Broadcast("SongChosen");
/* /*
if(TWO_PART_CONFIRMS_ONLY && SAMPLE_MUSIC_PREVIEW_MODE == SampleMusicPreviewMode_StartToPreview) if(TWO_PART_CONFIRMS_ONLY && SAMPLE_MUSIC_PREVIEW_MODE == SampleMusicPreviewMode_StartToPreview)
{ {
@@ -1028,6 +1057,9 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
} }
*/ */
// I believe this is for those who like pump pro. -aj
MESSAGEMAN->Broadcast("SongChosen");
break; break;
case SelectionState_SelectingSteps: case SelectionState_SelectingSteps:
@@ -1256,6 +1288,7 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input )
void ScreenSelectMusic::MenuBack( const InputEventPlus &input ) void ScreenSelectMusic::MenuBack( const InputEventPlus &input )
{ {
// Handle unselect song (ffff) // Handle unselect song (ffff)
// todo: this isn't right at all. -aj
if( m_SelectionState == SelectionState_SelectingSteps && !m_bStepsChosen[input.pn] && input.MenuI == GAME_BUTTON_BACK && input.type == IET_FIRST_PRESS ) if( m_SelectionState == SelectionState_SelectingSteps && !m_bStepsChosen[input.pn] && input.MenuI == GAME_BUTTON_BACK && input.type == IET_FIRST_PRESS )
{ {
// if a player has chosen their steps already, don't unchoose song. // if a player has chosen their steps already, don't unchoose song.
@@ -1509,6 +1542,7 @@ void ScreenSelectMusic::AfterMusicChange()
m_fSampleLengthSeconds = -1; m_fSampleLengthSeconds = -1;
break; break;
case SampleMusicPreviewMode_Normal: case SampleMusicPreviewMode_Normal:
//case SampleMusicPreviewMode_StartToPreview:
// play the sample music // play the sample music
m_sSampleMusicToPlay = pSong->GetMusicPath(); m_sSampleMusicToPlay = pSong->GetMusicPath();
m_pSampleMusicTimingData = &pSong->m_Timing; m_pSampleMusicTimingData = &pSong->m_Timing;