From 0e59f3d13597c05a8b28b50676a1f1d0dc9cc8a4 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 25 Feb 2005 00:29:09 +0000 Subject: [PATCH] Revert this, and do it differently: prefer the preferred song/course in MusicWheel::SelectSongOrCourse instead of the active one. The advantage of this is that if, for example, a PreferredCourse is set, the player is playing regular play (not course mode), and then switches to course mode via the mode menu, the course will be selected correctly. (Previously, it'd end up on the default course in that case instead.) --- stepmania/src/MusicWheel.cpp | 6 +++++- stepmania/src/ScreenSelectMusic.cpp | 9 --------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 25309ab000..a1c75962eb 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -251,13 +251,17 @@ MusicWheel::~MusicWheel() { } -/* If a song or course is set in GAMESTATE and avaialble, select it. Otherwise, choose the +/* If a song or course is set in GAMESTATE and available, select it. Otherwise, choose the * first available song or course. Return true if an item was set, false if no items are * available. */ bool MusicWheel::SelectSongOrCourse() { + if( GAMESTATE->m_pPreferredSong && SelectSong( GAMESTATE->m_pPreferredSong ) ) + return true; if( GAMESTATE->m_pCurSong && SelectSong( GAMESTATE->m_pCurSong ) ) return true; + if( GAMESTATE->m_pPreferredCourse && SelectCourse( GAMESTATE->m_pPreferredCourse ) ) + return true; if( GAMESTATE->m_pCurCourse && SelectCourse( GAMESTATE->m_pCurCourse ) ) return true; diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 7d34219717..14c2dd957d 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -71,15 +71,6 @@ 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; }