From 2351951035ff1b11aaecb7b3713a2b497df36895 Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Sat, 2 Aug 2003 09:56:24 +0000 Subject: [PATCH] fixed song display on "display group" screen for unlocks --- stepmania/src/ScreenSelectGroup.cpp | 15 ++++++++++++++- stepmania/src/UnlockSystem.h | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/stepmania/src/ScreenSelectGroup.cpp b/stepmania/src/ScreenSelectGroup.cpp index 750edf24e3..07f73c413c 100644 --- a/stepmania/src/ScreenSelectGroup.cpp +++ b/stepmania/src/ScreenSelectGroup.cpp @@ -24,6 +24,8 @@ #include "ThemeManager.h" #include #include "ActorUtil.h" +#include "GameState.h" +#include "UnlockSystem.h" #define BANNER_WIDTH THEME->GetMetricF("ScreenSelectGroup","BannerWidth") #define BANNER_HEIGHT THEME->GetMetricF("ScreenSelectGroup","BannerHeight") @@ -64,8 +66,19 @@ ScreenSelectGroup::ScreenSelectGroup() : Screen("ScreenSelectGroup") // Filter out Songs that can't be played by the current Style for( j=aAllSongs.size()-1; j>=0; j-- ) // foreach Song, back to front { + bool DisplaySong = aAllSongs[j]->NormallyDisplayed(); + + // check if song is locked + if (PREFSMAN->m_bUseUnlockSystem) + { + SongEntry* m_UnlockSong = GAMESTATE->m_pUnlockingSys->FindSong( aAllSongs[j] ); + + if (m_UnlockSong) + DisplaySong = (m_UnlockSong->SelectableWheel()); + } + if( aAllSongs[j]->SongCompleteForStyle(GAMESTATE->GetCurrentStyleDef()) && - aAllSongs[j]->NormallyDisplayed() ) + DisplaySong ) continue; aAllSongs.erase( aAllSongs.begin()+j, aAllSongs.begin()+j+1 ); diff --git a/stepmania/src/UnlockSystem.h b/stepmania/src/UnlockSystem.h index 612d24bcc9..c008c303e3 100644 --- a/stepmania/src/UnlockSystem.h +++ b/stepmania/src/UnlockSystem.h @@ -107,6 +107,8 @@ public: SongEntry *FindLockEntry( CString lockname ); + // so class can access FindSong + friend class ScreenSelectGroup; private: SongEntry *FindSong( const Song *pSong ); SongEntry *FindCourse( const Course *pCourse );