This commit is contained in:
Glenn Maynard
2003-07-18 08:04:47 +00:00
parent 948ac51c90
commit 608f6aede3
4 changed files with 23 additions and 18 deletions
+7 -13
View File
@@ -319,19 +319,15 @@ void MusicWheel::GetSongList(vector<Song*> &arraySongs, SongSortOrder so, CStrin
continue;
}
// If we're using unlocks, check it here to prevent from being shown
if( so!=SORT_ROULETTE && GAMESTATE->m_pUnlockingSys->SongIsLocked(pSong) )
continue;
vector<Notes*> arraySteps;
pSong->GetNotes( arraySteps, GAMESTATE->GetCurrentStyleDef()->m_NotesType, DIFFICULTY_INVALID, -1, -1, "", PREFSMAN->m_bAutogenMissingTypes );
if( !arraySteps.empty() )
{
// If we're using unlocks, check it here to prevent from being shown
if( PREFSMAN->m_bUseUnlockSystem && so!=SORT_ROULETTE )
{
if( GAMESTATE->m_pUnlockingSys->SongIsLocked(pSong) )
continue;
}
arraySongs.push_back( pSong );
}
}
}
@@ -553,9 +549,8 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
Course* pCourse = apCourses[c];
// if unlocks are on, make sure it is unlocked
if ( PREFSMAN->m_bUseUnlockSystem)
if ( GAMESTATE->m_pUnlockingSys->CourseIsLocked( pCourse) )
continue;
if ( GAMESTATE->m_pUnlockingSys->CourseIsLocked(pCourse) )
continue;
// check that this course has at least one song playable in the current style
if( pCourse->IsPlayableIn(GAMESTATE->GetCurrentStyleDef()->m_NotesType) )
@@ -1120,8 +1115,7 @@ bool MusicWheel::Select() // return true if this selection ends the screen
StartRandom();
return false;
case TYPE_SONG:
if (PREFSMAN->m_bUseUnlockSystem)
GAMESTATE->m_pUnlockingSys->RouletteUnlock( m_CurWheelItemData[m_iSelection]->m_pSong );
GAMESTATE->m_pUnlockingSys->RouletteUnlock( m_CurWheelItemData[m_iSelection]->m_pSong );
// fall-through - we want to check for unlocking only if its a song
case TYPE_COURSE:
return true;
+4
View File
@@ -98,6 +98,7 @@ PrefsManager::PrefsManager()
m_bFirstRun = true;
m_bAutoMapJoysticks = true;
m_fGlobalOffsetSeconds = 0;
m_bShowConsole = false;
m_bTenFooterInRed = true;
@@ -223,6 +224,8 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
#endif
ini.GetValueB( "Options", "AntiAliasing", m_bAntiAliasing );
ini.GetValueF( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
ini.GetValueB( "Options", "ShowConsole", m_bShowConsole );
m_asAdditionalSongFolders.clear();
CString sAdditionalSongFolders;
@@ -317,6 +320,7 @@ void PrefsManager::SaveGlobalPrefsToDisk()
#endif
ini.SetValueB( "Options", "AntiAliasing", m_bAntiAliasing );
ini.SetValueF( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
ini.SetValueB( "Options", "ShowConsole", m_bShowConsole );
ini.SetValueB( "Options", "TenFooterInRed", m_bTenFooterInRed );
+11 -4
View File
@@ -44,19 +44,23 @@ UnlockSystem::UnlockSystem()
WriteValues("Data/MemCard.ini"); // create if it does not exist
}
bool UnlockSystem::RouletteUnlock( const Song *song )
void UnlockSystem::RouletteUnlock( const Song *song )
{
SongEntry *p = FindSong( song );
if (!p) return false; // does not exist
if (p->m_iRouletteSeed == 0) return false; // already unlocked
if (!p)
return; // does not exist
if (p->m_iRouletteSeed == 0)
return; // already unlocked
RouletteSeeds[p->m_iRouletteSeed] = '1';
WriteValues("Data/MemCard.ini");
return true;
}
bool UnlockSystem::CourseIsLocked( const Course *course )
{
if( !PREFSMAN->m_bUseUnlockSystem )
return false;
// I know, its not a song, but for purposes of title
// comparison, its the same thing.
SongEntry *p = FindCourse( course );
@@ -69,6 +73,9 @@ bool UnlockSystem::CourseIsLocked( const Course *course )
bool UnlockSystem::SongIsLocked( const Song *song )
{
if( !PREFSMAN->m_bUseUnlockSystem )
return false;
SongEntry *p = FindSong( song );
if( p == NULL )
return false;
+1 -1
View File
@@ -83,7 +83,7 @@ public:
float UnlockClearStage();
float UnlockToasty();
bool RouletteUnlock( const Song *song );
void RouletteUnlock( const Song *song );
// unlocks given song in roulette
// read and write unlock in values