Add HideIncompleteCourses; in some environments, it doesn't make sense to show incomplete courses.

This commit is contained in:
Glenn Maynard
2008-05-13 01:26:02 +00:00
parent de4dec1f7b
commit d03587dd30
3 changed files with 11 additions and 0 deletions
+1
View File
@@ -219,6 +219,7 @@ void Course::Init()
m_SortOrder_Ranking = 0;
m_LoadedFromProfile = ProfileSlot_Invalid;
m_bIncomplete = false;
m_TrailCache.clear();
m_iTrailCacheSeed = 0;
m_RadarCache.clear();
+2
View File
@@ -185,6 +185,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
{
LOG->UserLog( "Course file", sPath, "random_within_group entry \"%s\" specifies a group that doesn't exist. "
"This entry will be ignored.", sSong.c_str() );
out.m_bIncomplete = true;
continue; // skip this #SONG
}
}
@@ -211,6 +212,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
{
LOG->UserLog( "Course file", sPath, "contains a fixed song entry \"%s\" that does not exist. "
"This entry will be ignored.", sSong.c_str());
out.m_bIncomplete = true;
continue; // skip this #SONG
}
}
+8
View File
@@ -53,6 +53,7 @@ static const ThemeMetric<bool> MOVE_UNLOCKS_TO_BOTTOM_OF_PREFERRED_SORT ( "Song
static const ThemeMetric<int> EXTRA_STAGE2_DIFFICULTY_MAX ( "SongManager", "ExtraStage2DifficultyMax" );
static Preference<RString> g_sDisabledSongs( "DisabledSongs", "" );
static Preference<bool> g_bHideIncompleteCourses( "HideIncompleteCourses", false );
RString SONG_GROUP_COLOR_NAME( size_t i ) { return ssprintf( "SongGroupColor%i", (int) i+1 ); }
RString COURSE_GROUP_COLOR_NAME( size_t i ) { return ssprintf( "CourseGroupColor%i", (int) i+1 ); }
@@ -705,6 +706,13 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld )
Course* pCourse = new Course;
CourseLoaderCRS::LoadFromCRSFile( *sCoursePath, *pCourse );
if( g_bHideIncompleteCourses.Get() && pCourse->m_bIncomplete )
{
delete pCourse;
continue;
}
m_pCourses.push_back( pCourse );
}
}