diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 2496edba99..54834f0666 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -319,19 +319,15 @@ void MusicWheel::GetSongList(vector &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 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 &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; diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index d811025ed5..7a932eb1d7 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -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 ); diff --git a/stepmania/src/UnlockSystem.cpp b/stepmania/src/UnlockSystem.cpp index 83cdd3b0a9..de8fd9d2a2 100644 --- a/stepmania/src/UnlockSystem.cpp +++ b/stepmania/src/UnlockSystem.cpp @@ -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; diff --git a/stepmania/src/UnlockSystem.h b/stepmania/src/UnlockSystem.h index 2bf8e874b4..d95f436d69 100644 --- a/stepmania/src/UnlockSystem.h +++ b/stepmania/src/UnlockSystem.h @@ -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