make trail handling mimic steps handling

This commit is contained in:
Glenn Maynard
2004-06-03 20:47:37 +00:00
parent 2a121229d7
commit b1bbce2edb
2 changed files with 23 additions and 13 deletions
+19 -11
View File
@@ -320,13 +320,18 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName )
for( unsigned c=0; c<asCoursePaths.size(); c++ ) for( unsigned c=0; c<asCoursePaths.size(); c++ )
{ {
PageToShow pts; PageToShow pts;
pts.type = PAGE_TYPE_COURSE; pts.type = PAGE_TYPE_TRAIL;
pts.colorIndex = i; pts.colorIndex = i;
pts.nt = aStepsTypesToShow[i]; pts.nt = aStepsTypesToShow[i];
pts.pCourse = SONGMAN->GetCourseFromPath( asCoursePaths[c] ); pts.pCourse = SONGMAN->GetCourseFromPath( asCoursePaths[c] );
pts.cd = COURSE_DIFFICULTY_REGULAR; if( pts.pCourse == NULL )
if( pts.pCourse ) continue;
m_vPagesToShow.push_back( pts );
pts.pTrail = pts.pCourse->GetTrail( pts.nt, COURSE_DIFFICULTY_REGULAR );
if( pts.pTrail == NULL )
continue;
m_vPagesToShow.push_back( pts );
} }
} }
} }
@@ -436,7 +441,7 @@ float ScreenRanking::SetPage( PageToShow pts )
bShowDifficulty = false; bShowDifficulty = false;
bShowStepsScore = false; bShowStepsScore = false;
break; break;
case PAGE_TYPE_COURSE: case PAGE_TYPE_TRAIL:
bBanner = true; bBanner = true;
bBannerFrame = true; bBannerFrame = true;
bShowCategory = false; bShowCategory = false;
@@ -715,15 +720,13 @@ float ScreenRanking::SetPage( PageToShow pts )
} }
} }
return SECONDS_PER_PAGE; return SECONDS_PER_PAGE;
case PAGE_TYPE_COURSE: case PAGE_TYPE_TRAIL:
{ {
m_textCourseTitle.SetText( pts.pCourse->m_sName ); m_textCourseTitle.SetText( pts.pCourse->m_sName );
m_Banner.LoadFromCourse( pts.pCourse ); m_Banner.LoadFromCourse( pts.pCourse );
m_textStepsType.SetText( GameManager::NotesTypeToThemedString(pts.nt) ); m_textStepsType.SetText( GameManager::NotesTypeToThemedString(pts.nt) );
Trail *pTrail = pts.pCourse->GetTrail( pts.nt, pts.cd ); const HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCourseHighScoreList( pts.pCourse, pts.pTrail );
ASSERT( pTrail );
const HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCourseHighScoreList( pts.pCourse, pTrail );
for( int l=0; l<NUM_RANKING_LINES; l++ ) for( int l=0; l<NUM_RANKING_LINES; l++ )
{ {
HighScore hs; HighScore hs;
@@ -825,10 +828,15 @@ float ScreenRanking::SetPage( PageToShow pts )
pCourseScoreRowItem->m_textSongTitle.SetText( pCourse->m_sName ); pCourseScoreRowItem->m_textSongTitle.SetText( pCourse->m_sName );
FOREACH_ShownCourseDifficulty( cd ) FOREACH_ShownCourseDifficulty( cd )
{ {
Trail *pTrail = pCourse->GetTrail( pts.nt, cd );
const HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCourseHighScoreList( pCourse, pTrail );
BitmapText* pTextStepsScore = &pCourseScoreRowItem->m_textStepsScore[cd]; BitmapText* pTextStepsScore = &pCourseScoreRowItem->m_textStepsScore[cd];
Trail *pTrail = pCourse->GetTrail( pts.nt, cd );
pTextStepsScore->SetHidden( pTrail==NULL );
if( pTrail == NULL )
continue;
const HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCourseHighScoreList( pCourse, pTrail );
HighScore hs; HighScore hs;
bool bRecentHighScore = false; bool bRecentHighScore = false;
if( !hsl.vHighScores.empty() ) if( !hsl.vHighScores.empty() )
+4 -2
View File
@@ -21,11 +21,12 @@
class Course; class Course;
class Song; class Song;
class Trail;
enum PageType enum PageType
{ {
PAGE_TYPE_CATEGORY, PAGE_TYPE_CATEGORY,
PAGE_TYPE_COURSE, PAGE_TYPE_TRAIL,
PAGE_TYPE_ALL_STEPS, PAGE_TYPE_ALL_STEPS,
PAGE_TYPE_ALL_COURSES, PAGE_TYPE_ALL_COURSES,
NUM_PAGE_TYPES NUM_PAGE_TYPES
@@ -48,6 +49,7 @@ protected:
PageToShow() PageToShow()
{ {
pCourse = NULL; pCourse = NULL;
pTrail = NULL;
} }
PageType type; PageType type;
@@ -55,7 +57,7 @@ protected:
StepsType nt; StepsType nt;
RankingCategory category; RankingCategory category;
Course* pCourse; Course* pCourse;
CourseDifficulty cd; Trail* pTrail;
}; };
float SetPage( PageToShow pts ); float SetPage( PageToShow pts );