diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 67cbb439de..c829b3c52e 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -98,7 +98,18 @@ Actor* LoadFromActorFile( CString sIniPath, CString sLayer ) { Song *pSong = GAMESTATE->m_pCurSong; if( pSong == NULL ) - pSong = SONGMAN->GetRandomSong(); + { + // probe for a random banner + for( int i=0; i<300; i++ ) + { + pSong = SONGMAN->GetRandomSong(); + if( pSong == NULL ) + break; + if( !pSong->ShowInDemonstrationAndRanking() ) + continue; + break; + } + } if( pSong && pSong->HasBanner() ) sFile = pSong->GetBannerPath(); @@ -120,7 +131,20 @@ Actor* LoadFromActorFile( CString sIniPath, CString sLayer ) { Course *pCourse = GAMESTATE->m_pCurCourse; if( pCourse == NULL ) - pCourse = SONGMAN->GetRandomCourse(); + { + // probe for a random banner + for( int i=0; i<300; i++ ) + { + pCourse = SONGMAN->GetRandomCourse(); + if( pCourse == NULL ) + break; + if( !pCourse->ShowInDemonstrationAndRanking() ) + continue; + if( pCourse->m_bIsAutogen ) + continue; + break; + } + } if( pCourse && pCourse->HasBanner() ) sFile = pCourse->m_sBannerPath; diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index 574dec8b29..4af5b585cc 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -126,6 +126,8 @@ public: bool IsFixed() const; + bool ShowInDemonstrationAndRanking() const { return true; } + void LoadFromCRSFile( CString sPath ); void RevertFromDisk(); void Init(); diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index 35f10ac887..fc37fbe54f 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -11,6 +11,7 @@ #include "Steps.h" #include "ScreenAttract.h" #include "RageUtil.h" +#include "UnlockSystem.h" // HACK: This belongs in ScreenDemonstration #define DIFFICULTIES_TO_SHOW THEME->GetMetric ("ScreenDemonstration","DifficultiesToShow") @@ -69,8 +70,9 @@ bool ScreenJukebox::SetSong( bool bDemonstration ) if( !pSong->HasMusic() ) continue; // skip - - if( pSong->NeverDisplayed() ) + if( UNLOCKMAN->SongIsLocked(pSong) ) + continue; + if( !pSong->ShowInDemonstrationAndRanking() ) continue; // skip Difficulty dc = vDifficultiesToShow[ rand()%vDifficultiesToShow.size() ]; diff --git a/stepmania/src/ScreenRanking.cpp b/stepmania/src/ScreenRanking.cpp index bc31adbb9a..1ad01ebd03 100644 --- a/stepmania/src/ScreenRanking.cpp +++ b/stepmania/src/ScreenRanking.cpp @@ -182,7 +182,7 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName ) Song *pSong = SONGMAN->GetAllSongs()[s]; if( UNLOCKMAN->SongIsLocked(pSong) ) continue; - if( pSong->IsTutorial() ) + if( !pSong->ShowInDemonstrationAndRanking() ) continue; StepsScoreRowItem* pStepsScoreRowItem = new StepsScoreRowItem; diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 9bd2d78f83..fe67fdc3cf 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -1231,10 +1231,10 @@ Song::SelectionDisplay Song::GetDisplayed() const return SHOW_ALWAYS; return m_SelectionDisplay; } - bool Song::NormallyDisplayed() const { return GetDisplayed() == SHOW_ALWAYS; } bool Song::NeverDisplayed() const { return GetDisplayed() == SHOW_NEVER; } bool Song::RouletteDisplayed() const { if(IsTutorial()) return false; return GetDisplayed() != SHOW_NEVER; } +bool Song::ShowInDemonstrationAndRanking() const { return !IsTutorial() && NormallyDisplayed(); } bool Song::HasMusic() const {return m_sMusicFile != "" && IsAFile(GetMusicPath()); } diff --git a/stepmania/src/song.h b/stepmania/src/song.h index c4c987043a..00fcdb3b5a 100644 --- a/stepmania/src/song.h +++ b/stepmania/src/song.h @@ -186,6 +186,7 @@ public: bool NormallyDisplayed() const; bool NeverDisplayed() const; bool RouletteDisplayed() const; + bool ShowInDemonstrationAndRanking() const; void AddSteps( Steps* pSteps ); // we are responsible for deleting the memory pointed to by pSteps! void RemoveSteps( const Steps* pSteps );