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
+5 -11
View File
@@ -319,20 +319,16 @@ void MusicWheel::GetSongList(vector<Song*> &arraySongs, SongSortOrder so, CStrin
continue; 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; vector<Notes*> arraySteps;
pSong->GetNotes( arraySteps, GAMESTATE->GetCurrentStyleDef()->m_NotesType, DIFFICULTY_INVALID, -1, -1, "", PREFSMAN->m_bAutogenMissingTypes ); pSong->GetNotes( arraySteps, GAMESTATE->GetCurrentStyleDef()->m_NotesType, DIFFICULTY_INVALID, -1, -1, "", PREFSMAN->m_bAutogenMissingTypes );
if( !arraySteps.empty() ) 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 ); arraySongs.push_back( pSong );
} }
}
} }
extern map<const Song*, CString> song_sort_val; extern map<const Song*, CString> song_sort_val;
@@ -553,8 +549,7 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
Course* pCourse = apCourses[c]; Course* pCourse = apCourses[c];
// if unlocks are on, make sure it is unlocked // if unlocks are on, make sure it is unlocked
if ( PREFSMAN->m_bUseUnlockSystem) if ( GAMESTATE->m_pUnlockingSys->CourseIsLocked(pCourse) )
if ( GAMESTATE->m_pUnlockingSys->CourseIsLocked( pCourse) )
continue; continue;
// check that this course has at least one song playable in the current style // check that this course has at least one song playable in the current style
@@ -1120,7 +1115,6 @@ bool MusicWheel::Select() // return true if this selection ends the screen
StartRandom(); StartRandom();
return false; return false;
case TYPE_SONG: 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 // fall-through - we want to check for unlocking only if its a song
case TYPE_COURSE: case TYPE_COURSE:
+4
View File
@@ -98,6 +98,7 @@ PrefsManager::PrefsManager()
m_bFirstRun = true; m_bFirstRun = true;
m_bAutoMapJoysticks = true; m_bAutoMapJoysticks = true;
m_fGlobalOffsetSeconds = 0; m_fGlobalOffsetSeconds = 0;
m_bShowConsole = false;
m_bTenFooterInRed = true; m_bTenFooterInRed = true;
@@ -223,6 +224,8 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
#endif #endif
ini.GetValueB( "Options", "AntiAliasing", m_bAntiAliasing ); ini.GetValueB( "Options", "AntiAliasing", m_bAntiAliasing );
ini.GetValueF( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds ); ini.GetValueF( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
ini.GetValueB( "Options", "ShowConsole", m_bShowConsole );
m_asAdditionalSongFolders.clear(); m_asAdditionalSongFolders.clear();
CString sAdditionalSongFolders; CString sAdditionalSongFolders;
@@ -317,6 +320,7 @@ void PrefsManager::SaveGlobalPrefsToDisk()
#endif #endif
ini.SetValueB( "Options", "AntiAliasing", m_bAntiAliasing ); ini.SetValueB( "Options", "AntiAliasing", m_bAntiAliasing );
ini.SetValueF( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds ); ini.SetValueF( "Options", "GlobalOffsetSeconds", m_fGlobalOffsetSeconds );
ini.SetValueB( "Options", "ShowConsole", m_bShowConsole );
ini.SetValueB( "Options", "TenFooterInRed", m_bTenFooterInRed ); 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 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 ); SongEntry *p = FindSong( song );
if (!p) return false; // does not exist if (!p)
if (p->m_iRouletteSeed == 0) return false; // already unlocked return; // does not exist
if (p->m_iRouletteSeed == 0)
return; // already unlocked
RouletteSeeds[p->m_iRouletteSeed] = '1'; RouletteSeeds[p->m_iRouletteSeed] = '1';
WriteValues("Data/MemCard.ini"); WriteValues("Data/MemCard.ini");
return true;
} }
bool UnlockSystem::CourseIsLocked( const Course *course ) bool UnlockSystem::CourseIsLocked( const Course *course )
{ {
if( !PREFSMAN->m_bUseUnlockSystem )
return false;
// I know, its not a song, but for purposes of title // I know, its not a song, but for purposes of title
// comparison, its the same thing. // comparison, its the same thing.
SongEntry *p = FindCourse( course ); SongEntry *p = FindCourse( course );
@@ -69,6 +73,9 @@ bool UnlockSystem::CourseIsLocked( const Course *course )
bool UnlockSystem::SongIsLocked( const Song *song ) bool UnlockSystem::SongIsLocked( const Song *song )
{ {
if( !PREFSMAN->m_bUseUnlockSystem )
return false;
SongEntry *p = FindSong( song ); SongEntry *p = FindSong( song );
if( p == NULL ) if( p == NULL )
return false; return false;
+1 -1
View File
@@ -83,7 +83,7 @@ public:
float UnlockClearStage(); float UnlockClearStage();
float UnlockToasty(); float UnlockToasty();
bool RouletteUnlock( const Song *song ); void RouletteUnlock( const Song *song );
// unlocks given song in roulette // unlocks given song in roulette
// read and write unlock in values // read and write unlock in values