add PageType_AllSteps

This commit is contained in:
Chris Danford
2006-06-12 09:14:20 +00:00
parent 439ab6c58a
commit 65e945bb18
3 changed files with 48 additions and 33 deletions
+2 -1
View File
@@ -27,7 +27,8 @@ enum CourseType
COURSE_TYPE_ONI, // if life meter type is BATTERY COURSE_TYPE_ONI, // if life meter type is BATTERY
COURSE_TYPE_ENDLESS, // if set to REPEAT COURSE_TYPE_ENDLESS, // if set to REPEAT
COURSE_TYPE_SURVIVAL, // if life meter type is TIME COURSE_TYPE_SURVIVAL, // if life meter type is TIME
NUM_CourseType NUM_CourseType,
CourseType_INVALID
}; };
#define FOREACH_CourseType( i ) FOREACH_ENUM( CourseType, NUM_CourseType, i ) #define FOREACH_CourseType( i ) FOREACH_ENUM( CourseType, NUM_CourseType, i )
const RString& CourseTypeToString( CourseType i ); const RString& CourseTypeToString( CourseType i );
+39 -26
View File
@@ -23,6 +23,7 @@ static const char *PageTypeNames[] = {
"NonstopCourses", "NonstopCourses",
"OniCourses", "OniCourses",
"SurvivalCourses", "SurvivalCourses",
"AllCourses",
}; };
XToString( PageType, NUM_PAGE_TYPES ); XToString( PageType, NUM_PAGE_TYPES );
StringToX( PageType ); StringToX( PageType );
@@ -62,7 +63,10 @@ static void GetAllCoursesToShow( vector<Course*> &vpOut, CourseType ct, bool bSh
{ {
vpOut.clear(); vpOut.clear();
vector<Course*> vpCourses; vector<Course*> vpCourses;
SONGMAN->GetCourses( ct, vpCourses, false ); if( ct == CourseType_INVALID )
SONGMAN->GetAllCourses( vpCourses, false );
else
SONGMAN->GetCourses( ct, vpCourses, false );
FOREACH_CONST( Course*, vpCourses, c) FOREACH_CONST( Course*, vpCourses, c)
{ {
@@ -81,7 +85,6 @@ static void GetAllCoursesToShow( vector<Course*> &vpOut, CourseType ct, bool bSh
} }
} }
static RString STEPS_TYPE_COLOR_NAME( size_t i ) { return ssprintf("StepsTypeColor%d",int(i+1)); } static RString STEPS_TYPE_COLOR_NAME( size_t i ) { return ssprintf("StepsTypeColor%d",int(i+1)); }
REGISTER_SCREEN_CLASS( ScreenRanking ); REGISTER_SCREEN_CLASS( ScreenRanking );
@@ -395,10 +398,6 @@ void ScoreScroller::Load(
m_iNumItems = m_vScoreRowItemData.size(); m_iNumItems = m_vScoreRowItemData.size();
} }
// PAGE_TYPE_ALL_STEPS:
// PAGE_TYPE_NONSTOP_COURSES:
// PAGE_TYPE_ONI_COURSES:
// PAGE_TYPE_SURVIVAL_COURSES:
void ScreenRankingScroller::Init() void ScreenRankingScroller::Init()
{ {
DIFFICULTIES_TO_SHOW.Load( m_sName, "DifficultiesToShow" ); DIFFICULTIES_TO_SHOW.Load( m_sName, "DifficultiesToShow" );
@@ -414,7 +413,7 @@ void ScreenRankingScroller::Init()
FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), d ) FOREACH_CONST( Difficulty, DIFFICULTIES_TO_SHOW.GetValue(), d )
{ {
if( m_PageType == PAGE_TYPE_ALL_STEPS ) if( m_PageType == PageType_AllSteps )
m_sprDifficulty[*d].Load( THEME->GetPathG(m_sName,"difficulty "+DifficultyToString(*d)) ); m_sprDifficulty[*d].Load( THEME->GetPathG(m_sName,"difficulty "+DifficultyToString(*d)) );
else else
m_sprDifficulty[*d].Load( THEME->GetPathG(m_sName,"CourseDifficulty "+CourseDifficultyToString(*d)) ); m_sprDifficulty[*d].Load( THEME->GetPathG(m_sName,"CourseDifficulty "+CourseDifficultyToString(*d)) );
@@ -424,16 +423,30 @@ void ScreenRankingScroller::Init()
} }
m_ListScoreRowItems.SetName( "ListScoreRowItems" ); m_ListScoreRowItems.SetName( "ListScoreRowItems" );
if( m_PageType == PAGE_TYPE_ALL_STEPS ) switch( m_PageType )
m_ListScoreRowItems.LoadSongs( SHOW_ONLY_MOST_RECENT_SCORES, NUM_MOST_RECENT_SCORES_TO_SHOW );
else if( m_PageType == PAGE_TYPE_NONSTOP_COURSES ||
m_PageType == PAGE_TYPE_ONI_COURSES ||
m_PageType == PAGE_TYPE_SURVIVAL_COURSES )
{ {
CourseType ct = m_PageType == PAGE_TYPE_NONSTOP_COURSES? COURSE_TYPE_NONSTOP : default: ASSERT(0);
m_PageType == PAGE_TYPE_ONI_COURSES? COURSE_TYPE_ONI : case PageType_AllSteps:
COURSE_TYPE_SURVIVAL; m_ListScoreRowItems.LoadSongs( SHOW_ONLY_MOST_RECENT_SCORES, NUM_MOST_RECENT_SCORES_TO_SHOW );
m_ListScoreRowItems.LoadCourses( ct, SHOW_ONLY_MOST_RECENT_SCORES, NUM_MOST_RECENT_SCORES_TO_SHOW ); break;
case PageType_NonstopCourses:
case PageType_OniCourses:
case PageType_SurvivalCourses:
case PageType_AllCourses:
{
CourseType ct;
switch( m_PageType )
{
default: ASSERT(0);
case PageType_NonstopCourses: ct = COURSE_TYPE_NONSTOP; break;
case PageType_OniCourses: ct = COURSE_TYPE_ONI; break;
case PageType_SurvivalCourses: ct = COURSE_TYPE_SURVIVAL; break;
case PageType_AllCourses: ct = CourseType_INVALID; break;
}
m_ListScoreRowItems.LoadCourses( ct, SHOW_ONLY_MOST_RECENT_SCORES, NUM_MOST_RECENT_SCORES_TO_SHOW );
}
break;
} }
m_ListScoreRowItems.Load( m_sName, DIFFICULTIES_TO_SHOW.GetValue(), ROW_SPACING_Y ); m_ListScoreRowItems.Load( m_sName, DIFFICULTIES_TO_SHOW.GetValue(), ROW_SPACING_Y );
@@ -492,8 +505,8 @@ float ScreenRankingScroller::SetPage( const PageToShow &pts )
return m_ListScoreRowItems.GetSecondsForCompleteScrollThrough(); return m_ListScoreRowItems.GetSecondsForCompleteScrollThrough();
} }
// PAGE_TYPE_CATEGORY: // PageType_Category:
// PAGE_TYPE_TRAIL: // PageType_Trail:
#define BULLET_X(row) (BULLET_START_X+ROW_SPACING_X*row) #define BULLET_X(row) (BULLET_START_X+ROW_SPACING_X*row)
#define BULLET_Y(row) (BULLET_START_Y+ROW_SPACING_Y*row) #define BULLET_Y(row) (BULLET_START_Y+ROW_SPACING_Y*row)
#define NAME_X(row) (NAME_START_X+ROW_SPACING_X*row) #define NAME_X(row) (NAME_START_X+ROW_SPACING_X*row)
@@ -520,7 +533,7 @@ void ScreenRankingLines::Init()
ScreenRanking::Init(); ScreenRanking::Init();
if( m_PageType == PAGE_TYPE_CATEGORY ) if( m_PageType == PageType_Category )
{ {
m_textCategory.SetName( "Category" ); m_textCategory.SetName( "Category" );
m_textCategory.LoadFromFont( THEME->GetPathF(m_sName,"category") ); m_textCategory.LoadFromFont( THEME->GetPathF(m_sName,"category") );
@@ -540,7 +553,7 @@ void ScreenRankingLines::Init()
} }
} }
if( m_PageType == PAGE_TYPE_TRAIL ) if( m_PageType == PageType_Trail )
{ {
m_Banner.SetName( "Banner" ); m_Banner.SetName( "Banner" );
this->AddChild( &m_Banner ); this->AddChild( &m_Banner );
@@ -619,10 +632,10 @@ float ScreenRankingLines::SetPage( const PageToShow &pts )
bool bShowTime = false; bool bShowTime = false;
switch( m_PageType ) switch( m_PageType )
{ {
case PAGE_TYPE_CATEGORY: case PageType_Category:
bShowScores = true; bShowScores = true;
break; break;
case PAGE_TYPE_TRAIL: case PageType_Trail:
bShowScores = !pts.pCourse->IsOni(); bShowScores = !pts.pCourse->IsOni();
bShowPoints = pts.pCourse->IsOni(); bShowPoints = pts.pCourse->IsOni();
bShowTime = pts.pCourse->IsOni(); bShowTime = pts.pCourse->IsOni();
@@ -645,7 +658,7 @@ float ScreenRankingLines::SetPage( const PageToShow &pts )
switch( m_PageType ) switch( m_PageType )
{ {
case PAGE_TYPE_CATEGORY: case PageType_Category:
{ {
m_textCategory.SetText( ssprintf("Type %c", 'A'+pts.category) ); m_textCategory.SetText( ssprintf("Type %c", 'A'+pts.category) );
@@ -683,7 +696,7 @@ float ScreenRankingLines::SetPage( const PageToShow &pts )
} }
} }
return SECONDS_PER_PAGE; return SECONDS_PER_PAGE;
case PAGE_TYPE_TRAIL: case PageType_Trail:
{ {
m_textCourseTitle.SetText( pts.pCourse->GetDisplayFullTitle() ); m_textCourseTitle.SetText( pts.pCourse->GetDisplayFullTitle() );
@@ -742,10 +755,10 @@ float ScreenRankingLines::SetPage( const PageToShow &pts )
void ScreenRankingLines::BeginScreen() void ScreenRankingLines::BeginScreen()
{ {
if( m_PageType == PAGE_TYPE_CATEGORY ) if( m_PageType == PageType_Category )
SET_XY( m_textCategory ); SET_XY( m_textCategory );
if( m_PageType == PAGE_TYPE_TRAIL ) if( m_PageType == PageType_Trail )
{ {
SET_XY( m_Banner ); SET_XY( m_Banner );
SET_XY( m_textCourseTitle ); SET_XY( m_textCourseTitle );
+7 -6
View File
@@ -21,12 +21,13 @@ struct HighScoreList;
enum PageType enum PageType
{ {
PAGE_TYPE_CATEGORY, PageType_Category,
PAGE_TYPE_TRAIL, PageType_Trail,
PAGE_TYPE_ALL_STEPS, PageType_AllSteps,
PAGE_TYPE_NONSTOP_COURSES, PageType_NonstopCourses,
PAGE_TYPE_ONI_COURSES, PageType_OniCourses,
PAGE_TYPE_SURVIVAL_COURSES, PageType_SurvivalCourses,
PageType_AllCourses,
NUM_PAGE_TYPES NUM_PAGE_TYPES
}; };
#define FOREACH_PageType( pt ) FOREACH_ENUM( PageType, NUM_PAGE_TYPES, pt ) #define FOREACH_PageType( pt ) FOREACH_ENUM( PageType, NUM_PAGE_TYPES, pt )