From 85732aa4c83fc77e3c114994289c1cc72aee6a6b Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 15 Aug 2007 20:31:47 +0000 Subject: [PATCH] return a mask, like SongIsLocked --- stepmania/src/UnlockManager.cpp | 19 +++++++++++-------- stepmania/src/UnlockManager.h | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/stepmania/src/UnlockManager.cpp b/stepmania/src/UnlockManager.cpp index c135a2ec03..01b2d4d078 100644 --- a/stepmania/src/UnlockManager.cpp +++ b/stepmania/src/UnlockManager.cpp @@ -106,16 +106,19 @@ RString UnlockManager::FindEntryID( const RString &sName ) const return pEntry->m_sEntryID; } -bool UnlockManager::CourseIsLocked( const Course *course ) const +int UnlockManager::CourseIsLocked( const Course *pCourse ) const { - if( !PREFSMAN->m_bUseUnlockSystem ) - return false; + int iRet = 0; + if( PREFSMAN->m_bUseUnlockSystem ) + { + const UnlockEntry *p = FindCourse( pCourse ); + if( p == NULL ) + return false; + if( p->IsLocked() ) + iRet |= LOCKED_LOCK; + } - const UnlockEntry *p = FindCourse( course ); - if( p == NULL ) - return false; - - return p->IsLocked(); + return iRet; } int UnlockManager::SongIsLocked( const Song *pSong ) const diff --git a/stepmania/src/UnlockManager.h b/stepmania/src/UnlockManager.h index c7d244b07e..dfbca85d87 100644 --- a/stepmania/src/UnlockManager.h +++ b/stepmania/src/UnlockManager.h @@ -113,7 +113,7 @@ public: int SongIsLocked( const Song *pSong ) const; bool SongIsRouletteOnly( const Song *song ) const; bool StepsIsLocked( const Song *pSong, const Steps *pSteps ) const; - bool CourseIsLocked( const Course *course ) const; + int CourseIsLocked( const Course *course ) const; bool ModifierIsLocked( const RString &sOneMod ) const; // Gets number of unlocks for title screen