From cc470cad86a79ad2ee01aeee7d420f5e7c2fd683 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Wed, 23 Jun 2010 14:09:43 -0500 Subject: [PATCH] Implement the last remaining SampleMusicPreviewMode: StartToPreview. This one requires [ScreenSelectMusic] TwoPartConfirmsOnly=true in the metrics to work correctly. --- Docs/Changelog_sm-ssc.txt | 6 ++++++ src/GameConstantsAndTypes.cpp | 2 +- src/GameConstantsAndTypes.h | 4 ++-- src/ScreenSelectMusic.cpp | 14 ++++++++------ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index ed3d469d20..2f3861fcb9 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -9,6 +9,12 @@ Not all changes are documented, for various reasons. supported but exist anyways.) _____________________________________________________________________________ +20100623 +-------- +* Implement the last remaining SampleMusicPreviewMode: StartToPreview. + This one requires [ScreenSelectMusic] TwoPartConfirmsOnly=true in the + metrics to work correctly. + 20100619 -------- * [HighScore] add GetGrade() Lua binding. diff --git a/src/GameConstantsAndTypes.cpp b/src/GameConstantsAndTypes.cpp index f6a98329e1..fb6e7ae194 100644 --- a/src/GameConstantsAndTypes.cpp +++ b/src/GameConstantsAndTypes.cpp @@ -416,7 +416,7 @@ LuaXType( EditMode ); static const char *SampleMusicPreviewModeNames[] = { "Normal", - //"StartToPreview", + "StartToPreview", "ScreenMusic", "LastSong" }; diff --git a/src/GameConstantsAndTypes.h b/src/GameConstantsAndTypes.h index 6a2a3d59de..af7aa64a25 100644 --- a/src/GameConstantsAndTypes.h +++ b/src/GameConstantsAndTypes.h @@ -106,7 +106,7 @@ const RString& PlayModeToLocalizedString( PlayMode pm ); PlayMode StringToPlayMode( const RString& s ); LuaDeclareType( PlayMode ); - +// ziup2 has SortOrder_PinnedMeter (¿qef?) enum SortOrder { // song sorts @@ -461,7 +461,7 @@ original options from ScreenEz2SelectMusic: enum SampleMusicPreviewMode { SampleMusicPreviewMode_Normal, - //SampleMusicPreviewMode_StartToPreview, + SampleMusicPreviewMode_StartToPreview, SampleMusicPreviewMode_ScreenMusic, SampleMusicPreviewMode_LastSong, // continue playing the last song NUM_SampleMusicPreviewMode, diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index 29620ba455..4ba38e9bb5 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -990,14 +990,12 @@ void ScreenSelectMusic::MenuStart( const InputEventPlus &input ) // a song was selected if( m_MusicWheel.GetSelectedSong() != NULL ) { - /* if(TWO_PART_CONFIRMS_ONLY && SAMPLE_MUSIC_PREVIEW_MODE == SampleMusicPreviewMode_StartToPreview) { // start playing the preview music. g_bSampleMusicWaiting = true; CheckBackgroundRequests( true ); } - */ const bool bIsNew = PROFILEMAN->IsSongNew( m_MusicWheel.GetSelectedSong() ); bool bIsHard = false; @@ -1568,9 +1566,9 @@ void ScreenSelectMusic::AfterMusicChange() m_fSampleStartSeconds = 0; m_fSampleLengthSeconds = -1; break; - //case SampleMusicPreviewMode_StartToPreview: + case SampleMusicPreviewMode_StartToPreview: // we want to load the sample music, but we don't want to - // actually play it; fall through for now. -aj + // actually play it. fall through. -aj case SampleMusicPreviewMode_Normal: case SampleMusicPreviewMode_LastSong: // fall through // play the sample music @@ -1654,8 +1652,12 @@ void ScreenSelectMusic::AfterMusicChange() if( !m_MusicWheel.IsRouletting() && SOUND->GetMusicPath() != m_sSampleMusicToPlay ) { SOUND->StopMusic(); - if( !m_sSampleMusicToPlay.empty() ) - g_bSampleMusicWaiting = true; + // some SampleMusicPreviewModes don't want the sample music immediately. + if( SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_StartToPreview ) + { + if( !m_sSampleMusicToPlay.empty() ) + g_bSampleMusicWaiting = true; + } } g_StartedLoadingAt.Touch();