fix honoring PREFSMAN->m_bHiddenSongs

This commit is contained in:
Glenn Maynard
2004-02-26 20:29:37 +00:00
parent 3559e640b5
commit ddeccdfeaf
4 changed files with 12 additions and 15 deletions
+2 -2
View File
@@ -611,7 +611,7 @@ void PrintHighScoreListTable( RageFile &f, const HighScoreList& hsl )
bool PrintHighScoresForSong( RageFile &f, const Profile *pProfile, Song* pSong )
{
if( pSong->m_SelectionDisplay == Song::SHOW_NEVER || UNLOCKMAN->SongIsLocked(pSong) )
if( pSong->NeverDisplayed() || UNLOCKMAN->SongIsLocked(pSong) )
return false; // skip
int iNumTimesPlayed = pProfile->GetSongNumTimesPlayed(pSong);
if( iNumTimesPlayed == 0 )
@@ -762,7 +762,7 @@ void PrintGradeTable( RageFile &f, const Profile *pProfile, CString sTitle, vect
bool PrintInventoryForSong( RageFile &f, const Profile *pProfile, Song* pSong )
{
if( pSong->m_SelectionDisplay == Song::SHOW_NEVER || UNLOCKMAN->SongIsLocked(pSong) )
if( pSong->NeverDisplayed() || UNLOCKMAN->SongIsLocked(pSong) )
return false; // skip
vector<Steps*> vpSteps = pSong->GetAllSteps();
+1 -1
View File
@@ -46,7 +46,7 @@ bool ScreenJukebox::SetSong()
if( !pSong->HasMusic() )
continue; // skip
if( pSong->m_SelectionDisplay == Song::SHOW_NEVER )
if( pSong->NeverDisplayed() )
continue; // skip
Difficulty dc = GAMESTATE->m_PreferredDifficulty[PLAYER_1];
+4 -9
View File
@@ -1568,16 +1568,11 @@ void SortSongPointerArrayByMeter( vector<Song*> &arraySongPointers, Difficulty d
sort( arraySongPointers.begin(), arraySongPointers.end(), CompareSongByMeter(dc) );
}
bool Song::NormallyDisplayed() const
Song::SelectionDisplay Song::GetDisplayed() const
{
if(!PREFSMAN->m_bHiddenSongs) return true;
return m_SelectionDisplay == SHOW_ALWAYS;
}
bool Song::RouletteDisplayed() const
{
if(!PREFSMAN->m_bHiddenSongs) return true;
return m_SelectionDisplay != SHOW_NEVER;
if( !PREFSMAN->m_bHiddenSongs )
return SHOW_ALWAYS;
return m_SelectionDisplay;
}
bool Song::HasMusic() const {return m_sMusicFile != "" && IsAFile(GetMusicPath()); }
+5 -3
View File
@@ -54,7 +54,7 @@ class Song
public:
/* Set when this song should be displayed in the music wheel: */
enum { SHOW_ALWAYS, /* all the time */
enum SelectionDisplay { SHOW_ALWAYS, /* all the time */
SHOW_ROULETTE, /* only when rouletting */
SHOW_NEVER } /* never (unless song hiding is turned off) */
m_SelectionDisplay;
@@ -191,8 +191,10 @@ public:
void GetEdits( vector<Steps*>& arrayAddTo, StepsType nt ) const;
bool IsEasy( StepsType nt ) const;
bool HasEdits( StepsType nt ) const;
bool NormallyDisplayed() const;
bool RouletteDisplayed() const;
SelectionDisplay GetDisplayed() const;
bool NormallyDisplayed() const { return GetDisplayed() == SHOW_ALWAYS; }
bool NeverDisplayed() const { return GetDisplayed() == SHOW_NEVER; }
bool RouletteDisplayed() const { return GetDisplayed() != SHOW_NEVER; }
int GetNumNotesWithGrade( Grade g ) const;
void AddNotes( Steps* pNotes ); // we are responsible for deleting the memory pointed to by pNotes!