merge UnlockManager::SongIsRouletteOnly into SongIsLocked
This commit is contained in:
@@ -353,7 +353,7 @@ void MusicWheel::GetSongList( vector<Song*> &arraySongs, SortOrder so, const RSt
|
||||
/* Hide songs that asked to be hidden via #SELECTABLE. */
|
||||
if( iLocked & LOCKED_SELECTABLE )
|
||||
continue;
|
||||
if( so!=SORT_ROULETTE && UNLOCKMAN->SongIsRouletteOnly( pSong ) )
|
||||
if( so != SORT_ROULETTE && iLocked & LOCKED_ROULETTE )
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,11 @@ int UnlockManager::SongIsLocked( const Song *pSong ) const
|
||||
{
|
||||
const UnlockEntry *p = FindSong( pSong );
|
||||
if( p != NULL && p->IsLocked() )
|
||||
{
|
||||
iRet |= LOCKED_LOCK;
|
||||
if( !p->m_sEntryID.empty() && m_RouletteCodes.find( p->m_sEntryID ) != m_RouletteCodes.end() )
|
||||
iRet |= LOCKED_ROULETTE;
|
||||
}
|
||||
}
|
||||
if( PREFSMAN->m_bHiddenSongs && pSong->m_SelectionDisplay == Song::SHOW_NEVER )
|
||||
iRet |= LOCKED_SELECTABLE;
|
||||
@@ -149,23 +153,6 @@ int UnlockManager::SongIsLocked( const Song *pSong ) const
|
||||
return iRet;
|
||||
}
|
||||
|
||||
/* Return true if the song is *only* available in roulette. */
|
||||
bool UnlockManager::SongIsRouletteOnly( const Song *song ) const
|
||||
{
|
||||
if( !PREFSMAN->m_bUseUnlockSystem )
|
||||
return false;
|
||||
|
||||
const UnlockEntry *p = FindSong( song );
|
||||
if( p == NULL )
|
||||
return false;
|
||||
|
||||
/* If the song is locked by a code, and it's a roulette code, honor IsLocked. */
|
||||
if( p->m_sEntryID.empty() || m_RouletteCodes.find( p->m_sEntryID ) == m_RouletteCodes.end() )
|
||||
return false;
|
||||
|
||||
return p->IsLocked();
|
||||
}
|
||||
|
||||
bool UnlockManager::StepsIsLocked( const Song *pSong, const Steps *pSteps ) const
|
||||
{
|
||||
if( !PREFSMAN->m_bUseUnlockSystem )
|
||||
|
||||
@@ -93,12 +93,15 @@ public:
|
||||
// Option is locked due to an unsatisfied unlock entry.
|
||||
#define LOCKED_LOCK 0x1
|
||||
|
||||
// Option is only available in random selections.
|
||||
#define LOCKED_ROULETTE 0x2
|
||||
|
||||
// Option is locked due to a #SELECTABLE tag.
|
||||
#define LOCKED_SELECTABLE 0x2
|
||||
#define LOCKED_SELECTABLE 0x4
|
||||
|
||||
// Option is disabled by the operator. (For courses, this means that a song in the
|
||||
// course is disabled.)
|
||||
#define LOCKED_DISABLED 0x4
|
||||
#define LOCKED_DISABLED 0x8
|
||||
|
||||
class UnlockManager
|
||||
{
|
||||
@@ -111,7 +114,6 @@ public:
|
||||
|
||||
float PointsUntilNextUnlock( UnlockRequirement t ) const;
|
||||
int SongIsLocked( const Song *pSong ) const;
|
||||
bool SongIsRouletteOnly( const Song *song ) const;
|
||||
bool StepsIsLocked( const Song *pSong, const Steps *pSteps ) const;
|
||||
int CourseIsLocked( const Course *course ) const;
|
||||
bool ModifierIsLocked( const RString &sOneMod ) const;
|
||||
|
||||
Reference in New Issue
Block a user