simplify
This commit is contained in:
@@ -319,19 +319,15 @@ 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 );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -553,9 +549,8 @@ 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
|
||||||
if( pCourse->IsPlayableIn(GAMESTATE->GetCurrentStyleDef()->m_NotesType) )
|
if( pCourse->IsPlayableIn(GAMESTATE->GetCurrentStyleDef()->m_NotesType) )
|
||||||
@@ -1120,8 +1115,7 @@ 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:
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -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 );
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user