From 7f0ba99f77469a3a73721e537f067e6129182ade Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 24 Feb 2005 22:31:11 +0000 Subject: [PATCH] Explicitly set the preferred song in SSM's ctor, instead of handling it in the music wheel. This way, we can re-set the preferred song at any time and have it take effect when we get back to the wheel; previously, if we'd already played a song, m_pCurSong would override it. --- stepmania/src/MusicWheel.cpp | 4 ---- stepmania/src/ScreenSelectMusic.cpp | 9 +++++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 534d04c35a..25309ab000 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -258,12 +258,8 @@ bool MusicWheel::SelectSongOrCourse() { if( GAMESTATE->m_pCurSong && SelectSong( GAMESTATE->m_pCurSong ) ) return true; - if( GAMESTATE->m_pPreferredSong && SelectSong( GAMESTATE->m_pPreferredSong ) ) - return true; if( GAMESTATE->m_pCurCourse && SelectCourse( GAMESTATE->m_pCurCourse ) ) return true; - if( GAMESTATE->m_pPreferredCourse && SelectCourse( GAMESTATE->m_pPreferredCourse ) ) - return true; // Select the first selectable song based on the sort order... vector &wiWheelItems = m_WheelItemDatas[m_SortOrder]; diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 14c2dd957d..7d34219717 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -71,6 +71,15 @@ ScreenSelectMusic::ScreenSelectMusic( CString sClassName ) : ScreenWithMenuEleme /* Finish any previous stage. It's OK to call this when we havn't played a stage yet. * Do this before anything that might look at GAMESTATE->m_iCurrentStageIndex. */ GAMESTATE->FinishStage(); + + /* If we have a preferred song, let it override the active song. That way, you + * can set PreferredSong at any time (eg. during initial menus or evaluation) to + * select the default song for the next play, without interfering with things + * that still need pCurSong. */ + if( GAMESTATE->m_pPreferredSong ) + GAMESTATE->m_pCurSong.Set( GAMESTATE->m_pPreferredSong ); + if( GAMESTATE->m_pPreferredCourse ) + GAMESTATE->m_pCurCourse = GAMESTATE->m_pPreferredCourse; }