diff --git a/stepmania/src/ScreenRanking.cpp b/stepmania/src/ScreenRanking.cpp index 51125480cf..711c14a637 100644 --- a/stepmania/src/ScreenRanking.cpp +++ b/stepmania/src/ScreenRanking.cpp @@ -43,8 +43,6 @@ StringToX( PageType ); #define DIFFICULTY_X(col) (DIFFICULTY_START_X+COL_SPACING_X*col) #define SCORE_OFFSET_X(col) (SCORE_OFFSET_START_X+COL_SPACING_X*col) -#define COURSE_DIFFICULTY_X(col) (COURSE_DIFFICULTY_START_X+COL_SPACING_X*col) - AutoScreenMessage( SM_ShowNextPage ) AutoScreenMessage( SM_HidePage ) @@ -129,8 +127,6 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName, TIME_START_Y (m_sName,"TimeStartY"), DIFFICULTY_START_X (m_sName,"DifficultyStartX"), DIFFICULTY_Y (m_sName,"DifficultyY"), - COURSE_DIFFICULTY_START_X (m_sName,"CourseDifficultyStartX"), - COURSE_DIFFICULTY_Y (m_sName,"CourseDifficultyY"), SCORE_OFFSET_START_X (m_sName,"ScoreOffsetStartX"), SCORE_OFFSET_Y (m_sName,"ScoreOffsetY") { @@ -180,49 +176,12 @@ void ScreenRanking::Init() SET_XY_AND_ON_COMMAND( m_Banner ); this->AddChild( &m_Banner ); - m_sprBannerFrame.SetName( "BannerFrame" ); - SET_XY_AND_ON_COMMAND( m_sprBannerFrame ); - this->AddChild( &m_sprBannerFrame ); - m_textCourseTitle.SetName( "CourseTitle" ); m_textCourseTitle.LoadFromFont( THEME->GetPathF(m_sName,"course title") ); m_textCourseTitle.SetShadowLength( 0 ); SET_XY_AND_ON_COMMAND( m_textCourseTitle ); this->AddChild( &m_textCourseTitle ); - } - switch( m_PageType ) - { - case PAGE_TYPE_CATEGORY: - case PAGE_TYPE_TRAIL: - for( int l=0; lGetPathG( m_sName, ssprintf("bullets 1x%d",NUM_RANKING_LINES) ) ); - m_sprBullets[l].StopAnimating(); - this->AddChild( &m_sprBullets[l] ); - - m_textNames[l].SetName( ssprintf("Name%d",l+1) ); - m_textNames[l].LoadFromFont( THEME->GetPathF(m_sName,"name") ); - this->AddChild( &m_textNames[l] ); - - m_textScores[l].SetName( ssprintf("Score%d",l+1) ); - m_textScores[l].LoadFromFont( THEME->GetPathF(m_sName,"score") ); - this->AddChild( &m_textScores[l] ); - - m_textPoints[l].SetName( ssprintf("Points%d",l+1) ); - m_textPoints[l].LoadFromFont( THEME->GetPathF(m_sName,"points") ); - m_textPoints[l].SetHidden( true ); - this->AddChild( &m_textPoints[l] ); - - m_textTime[l].SetName( ssprintf("Time%d",l+1) ); - m_textTime[l].LoadFromFont( THEME->GetPathF(m_sName,"time") ); - m_textTime[l].SetHidden( true ); - this->AddChild( &m_textTime[l] ); - } - } - - { vector asCoursePaths; split( COURSES_TO_SHOW, ",", asCoursePaths, true ); for( unsigned i=0; iGetPathG( m_sName, ssprintf("bullets 1x%d",NUM_RANKING_LINES) ) ); + m_sprBullets[l]->SetName( ssprintf("Bullet%d",l+1) ); + m_sprBullets[l]->StopAnimating(); + this->AddChild( m_sprBullets[l] ); + m_textNames[l].SetName( ssprintf("Name%d",l+1) ); + m_textNames[l].LoadFromFont( THEME->GetPathF(m_sName,"name") ); + this->AddChild( &m_textNames[l] ); + + m_textScores[l].SetName( ssprintf("Score%d",l+1) ); + m_textScores[l].LoadFromFont( THEME->GetPathF(m_sName,"score") ); + this->AddChild( &m_textScores[l] ); + + m_textPoints[l].SetName( ssprintf("Points%d",l+1) ); + m_textPoints[l].LoadFromFont( THEME->GetPathF(m_sName,"points") ); + m_textPoints[l].SetHidden( true ); + this->AddChild( &m_textPoints[l] ); + + m_textTime[l].SetName( ssprintf("Time%d",l+1) ); + m_textTime[l].LoadFromFont( THEME->GetPathF(m_sName,"time") ); + m_textTime[l].SetHidden( true ); + this->AddChild( &m_textTime[l] ); + } + } + + m_vScoreRowItem.clear(); if( m_PageType == PAGE_TYPE_ALL_STEPS ) { - m_vScoreRowItem.clear(); vector vpSongs; GetAllSongsToShow( vpSongs, SHOW_ONLY_MOST_RECENT_SCORES, NUM_MOST_RECENT_SCORES_TO_SHOW ); m_vScoreRowItem.resize( vpSongs.size() ); - FOREACH_CONST( Song*, vpSongs, s ) - { - int i = s - vpSongs.begin(); - Song *pSong = *s; - ScoreRowItem &item = m_vScoreRowItem[i]; - item.m_pSong = pSong; - - item.m_sprFrame.Load( THEME->GetPathG(m_sName,"song frame") ); - item.m_sprFrame->SetName( "Frame" ); - ON_COMMAND( item.m_sprFrame ); - item.AddChild( item.m_sprFrame ); - - item.m_textTitle.SetName( "Title" ); - item.m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"song title") ); - ON_COMMAND( item.m_textTitle ); - item.AddChild( &item.m_textTitle ); - - for( int d=0; dGetPathF(m_sName,"steps score") ); - ON_COMMAND( item.m_textScore[d] ); - item.AddChild( &item.m_textScore[d] ); - } - } - - m_ListScoreRowItems.SetName( "ListScoreRowItems" ); - SET_XY_AND_ON_COMMAND( m_ListScoreRowItems ); - this->AddChild( &m_ListScoreRowItems ); - - FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), d ) - { - m_sprDifficulty[*d].Load( THEME->GetPathG(m_sName,"difficulty "+DifficultyToString(*d)) ); - m_sprDifficulty[*d]->SetName( ssprintf("Difficulty%d",(*d)+1) ); - m_sprDifficulty[*d]->SetXY( DIFFICULTY_X(*d), DIFFICULTY_Y ); - ON_COMMAND( m_sprDifficulty[*d] ); - this->AddChild( m_sprDifficulty[*d] ); - } - - if( !vpSongs.empty() ) - { - for( unsigned i=0; iTrace("rankings: adding %u courses", unsigned(vpCourses.size())); m_vScoreRowItem.resize( vpCourses.size() ); + for( unsigned i=0; iGetPathG(m_sName,"difficulty "+DifficultyToString(*d)) ); + else + m_sprDifficulty[*d].Load( THEME->GetPathG(m_sName,"CourseDifficulty "+CourseDifficultyToString(*d)) ); + m_sprDifficulty[*d]->SetName( "Difficulty"+DifficultyToString(*d) ); + m_sprDifficulty[*d]->SetXY( DIFFICULTY_X(*d), DIFFICULTY_Y ); + ON_COMMAND( m_sprDifficulty[*d] ); + this->AddChild( m_sprDifficulty[*d] ); + } + for( unsigned i=0; iGetPathG(m_sName,"course frame") ); + item.m_sprFrame.Load( THEME->GetPathG(m_sName,"list frame") ); item.m_sprFrame->SetName( "Frame" ); ON_COMMAND( item.m_sprFrame ); item.AddChild( item.m_sprFrame ); item.m_textTitle.SetName( "Title" ); - item.m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"course list title") ); + item.m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"list title") ); ON_COMMAND( item.m_textTitle ); item.AddChild( &item.m_textTitle ); - FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), cd ) + FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), d ) { - item.m_textScore[*cd].SetName( "Score" ); - item.m_textScore[*cd].LoadFromFont( THEME->GetPathF(m_sName,"course list score") ); - ON_COMMAND( item.m_textScore[*cd] ); - item.AddChild( &item.m_textScore[*cd] ); + item.m_textScore[*d].SetName( "Score" ); + item.m_textScore[*d].LoadFromFont( THEME->GetPathF(m_sName,"list score") ); + ON_COMMAND( item.m_textScore[*d] ); + item.AddChild( &item.m_textScore[*d] ); } } @@ -346,24 +304,12 @@ void ScreenRanking::Init() SET_XY_AND_ON_COMMAND( m_ListScoreRowItems ); this->AddChild( &m_ListScoreRowItems ); - FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), cd ) + for( unsigned i=0; iGetPathG(m_sName,"CourseDifficulty "+CourseDifficultyToString(*cd)) ); - m_sprCourseDifficulty[*cd]->SetName( "CourseDifficulty"+CourseDifficultyToString(*cd) ); - m_sprCourseDifficulty[*cd]->SetXY( COURSE_DIFFICULTY_X(*cd), COURSE_DIFFICULTY_Y ); - ON_COMMAND( m_sprCourseDifficulty[*cd] ); - this->AddChild( m_sprCourseDifficulty[*cd] ); - } - - if( !vpCourses.empty() ) - { - for( unsigned i=0; iSetState( l ); + m_sprBullets[l]->SetXY( BULLET_X(l), BULLET_Y(l) ); ON_COMMAND( m_sprBullets[l] ); m_textNames[l].SetXY( NAME_X(l), NAME_Y(l) ); diff --git a/stepmania/src/ScreenRanking.h b/stepmania/src/ScreenRanking.h index e0728ee8db..1b82b82efa 100644 --- a/stepmania/src/ScreenRanking.h +++ b/stepmania/src/ScreenRanking.h @@ -3,7 +3,6 @@ #include "ScreenAttract.h" #include "GameConstantsAndTypes.h" // for NUM_RANKING_LINES -#include "Sprite.h" #include "BitmapText.h" #include "Banner.h" #include "ActorScroller.h" @@ -71,20 +70,18 @@ protected: PageType m_PageType; Banner m_Banner; // for course - Sprite m_sprBannerFrame; // for course BitmapText m_textCourseTitle; // for course BitmapText m_textCategory; // for category BitmapText m_textStepsType; // for category, course, all_steps AutoActor m_sprPageType; - Sprite m_sprBullets[NUM_RANKING_LINES]; // for category and course + AutoActor m_sprBullets[NUM_RANKING_LINES]; // for category and course BitmapText m_textNames[NUM_RANKING_LINES]; // for category and course BitmapText m_textScores[NUM_RANKING_LINES]; // for category and course BitmapText m_textPoints[NUM_RANKING_LINES]; // for course BitmapText m_textTime[NUM_RANKING_LINES]; // for course AutoActor m_sprDifficulty[NUM_DIFFICULTIES]; // for all_steps - AutoActor m_sprCourseDifficulty[NUM_DIFFICULTIES]; // for all_courses struct ScoreRowItem : public ActorFrame // for all_steps and all_courses { ScoreRowItem() { m_pSong = NULL; m_pCourse = NULL; } @@ -138,8 +135,6 @@ protected: ThemeMetric TIME_START_Y; ThemeMetric DIFFICULTY_START_X; ThemeMetric DIFFICULTY_Y; - ThemeMetric COURSE_DIFFICULTY_START_X; - ThemeMetric COURSE_DIFFICULTY_Y; ThemeMetric SCORE_OFFSET_START_X; ThemeMetric SCORE_OFFSET_Y; };