From b1bbce2edbf9746c833848a1b0b2fd86628e0a1e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 3 Jun 2004 20:47:37 +0000 Subject: [PATCH] make trail handling mimic steps handling --- stepmania/src/ScreenRanking.cpp | 30 +++++++++++++++++++----------- stepmania/src/ScreenRanking.h | 6 ++++-- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/stepmania/src/ScreenRanking.cpp b/stepmania/src/ScreenRanking.cpp index 40aede332c..025b3d5f61 100644 --- a/stepmania/src/ScreenRanking.cpp +++ b/stepmania/src/ScreenRanking.cpp @@ -320,13 +320,18 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName ) for( unsigned c=0; cGetCourseFromPath( asCoursePaths[c] ); - pts.cd = COURSE_DIFFICULTY_REGULAR; - if( pts.pCourse ) - m_vPagesToShow.push_back( pts ); + if( pts.pCourse == NULL ) + continue; + + 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; bShowStepsScore = false; break; - case PAGE_TYPE_COURSE: + case PAGE_TYPE_TRAIL: bBanner = true; bBannerFrame = true; bShowCategory = false; @@ -715,15 +720,13 @@ float ScreenRanking::SetPage( PageToShow pts ) } } return SECONDS_PER_PAGE; - case PAGE_TYPE_COURSE: + case PAGE_TYPE_TRAIL: { m_textCourseTitle.SetText( pts.pCourse->m_sName ); m_Banner.LoadFromCourse( pts.pCourse ); m_textStepsType.SetText( GameManager::NotesTypeToThemedString(pts.nt) ); - Trail *pTrail = pts.pCourse->GetTrail( pts.nt, pts.cd ); - ASSERT( pTrail ); - const HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCourseHighScoreList( pts.pCourse, pTrail ); + const HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCourseHighScoreList( pts.pCourse, pts.pTrail ); for( int l=0; lm_textSongTitle.SetText( pCourse->m_sName ); FOREACH_ShownCourseDifficulty( cd ) { - Trail *pTrail = pCourse->GetTrail( pts.nt, cd ); - const HighScoreList &hsl = PROFILEMAN->GetMachineProfile()->GetCourseHighScoreList( pCourse, pTrail ); 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; bool bRecentHighScore = false; if( !hsl.vHighScores.empty() ) diff --git a/stepmania/src/ScreenRanking.h b/stepmania/src/ScreenRanking.h index 4650c8d957..8bdcf22ac0 100644 --- a/stepmania/src/ScreenRanking.h +++ b/stepmania/src/ScreenRanking.h @@ -21,11 +21,12 @@ class Course; class Song; +class Trail; enum PageType { PAGE_TYPE_CATEGORY, - PAGE_TYPE_COURSE, + PAGE_TYPE_TRAIL, PAGE_TYPE_ALL_STEPS, PAGE_TYPE_ALL_COURSES, NUM_PAGE_TYPES @@ -48,6 +49,7 @@ protected: PageToShow() { pCourse = NULL; + pTrail = NULL; } PageType type; @@ -55,7 +57,7 @@ protected: StepsType nt; RankingCategory category; Course* pCourse; - CourseDifficulty cd; + Trail* pTrail; }; float SetPage( PageToShow pts );