\n" "
%s\n" "
\n", g_Level, g_Level, sID.c_str(), sName.c_str(), g_Level, sID.c_str(), bExpanded?"visibletext":"hiddentext") ); }
inline void PRINT_OPEN(RageFile &f,CString sName,bool bExpanded=false) { PRINT_OPEN(f,sName,bExpanded,MakeUniqueId()); }
inline void PRINT_CLOSE(RageFile &f) { f.Write( "
\n" "
\n" ); g_Level--; ASSERT(g_Level>=0); }
-//inline void PRINT_LINK(RageFile &f,CString sName,CString sLink) { f.Write( ssprintf(" vLines;
};
-//inline CString MAKE_LINE_S(CString sName,CString sVal) { return ssprintf("%s = %s
\n",sName.c_str(),sVal.c_str()); }
-//inline CString MAKE_LINE_B(CString sName,bool bVal) { return ssprintf("%s = %s
\n",sName.c_str(),(bVal)?"yes":"no"); }
-//inline CString MAKE_LINE_I(CString sName,int iVal) { return ssprintf("%s = %d
\n",sName.c_str(),iVal); }
-//inline CString MAKE_LINE_RANK(int iRank,CString sName,int iVal) { return ssprintf("%d - %s (%d)
\n",iRank,sName.c_str(),iVal); }
-
-#define BEGIN_TABLE(cols) { Table table; table.iNumCols=cols;
-#define TABLE_LINE2(p1,p2) table.vLines.push_back( Table::Line(p1,p2) );
-#define TABLE_LINE3(p1,p2,p3) table.vLines.push_back( Table::Line(p1,p2,p3) );
-#define END_TABLE PrintTable( f, table ); }
+#define BEGIN_TABLE(cols) { Table table; table.iNumCols=cols;
+#define TABLE_LINE1(p1) table.vLines.push_back( Table::Line(p1) );
+#define TABLE_LINE2(p1,p2) table.vLines.push_back( Table::Line(p1,p2) );
+#define TABLE_LINE3(p1,p2,p3) table.vLines.push_back( Table::Line(p1,p2,p3) );
+#define TABLE_LINE4(p1,p2,p3,p4) table.vLines.push_back( Table::Line(p1,p2,p3,p4) );
+#define TABLE_LINE5(p1,p2,p3,p4,p5) table.vLines.push_back( Table::Line(p1,p2,p3,p4,p5) );
+#define END_TABLE PrintTable( f, table ); }
inline void PrintTable(RageFile &f,Table &table)
{
@@ -109,13 +108,30 @@ inline void PrintTable(RageFile &f,Table &table)
f.Write("");
f.Write(" | ");
}
- f.Write("");
- f.Write( line.sName );
- f.Write(" | ");
- f.Write(" | ");
- f.Write("");
- f.Write( line.sValue );
- f.Write(" | ");
+ if( bPrintRank )
+ {
+ f.Write("");
+ f.Write(" ");
+ f.Write( line.sName );
+ f.Write(" ");
+ f.Write("");
+ f.Write( line.sSubName );
+ f.Write(" ");
+ f.Write(" | ");
+ }
+ else
+ {
+ f.Write("");
+ f.Write( line.sName );
+ f.Write(" | ");
+ }
+ if( !line.sValue.empty() )
+ {
+ f.Write(" | ");
+ f.Write("");
+ f.Write( line.sValue );
+ f.Write(" | ");
+ }
f.Write( "\n" );
f.Write("");
@@ -129,9 +145,9 @@ inline void PrintTable(RageFile &f,Table &table)
void PrintStatistics( RageFile &f, const Profile *pProfile, CString sTitle, vector &vpSongs, vector &vpAllSteps, vector &vStepsTypesToShow, map mapStepsToSong, vector vpCourses )
{
- PRINT_OPEN(f,sTitle);
+ PRINT_OPEN(f,sTitle,true);
{
- PRINT_OPEN(f,"This Profile",true);
+ PRINT_OPEN(f,"General Info",true);
{
BEGIN_TABLE(2);
TABLE_LINE2( "Name", pProfile->m_sName );
@@ -149,7 +165,7 @@ void PrintStatistics( RageFile &f, const Profile *pProfile, CString sTitle, vect
PRINT_CLOSE(f);
- PRINT_OPEN(f,"Num Songs Played by PlayMode",true);
+ PRINT_OPEN(f,"Num Songs Played by PlayMode");
{
BEGIN_TABLE(4);
FOREACH_PlayMode( pm )
@@ -159,7 +175,7 @@ void PrintStatistics( RageFile &f, const Profile *pProfile, CString sTitle, vect
PRINT_CLOSE(f);
- PRINT_OPEN(f,"Num Songs Played by Style",true);
+ PRINT_OPEN(f,"Num Songs Played by Style");
{
BEGIN_TABLE(4);
for( int i=0; iGetStepsHighScoreList(pSteps);
+ if( hsl.vHighScores.empty() )
+ continue; // no data, skip this one
+ Grade g = hsl.GetTopScore().grade;
+ ASSERT( g != GRADE_NO_DATA );
+ ASSERT( g < NUM_GRADES );
+ ASSERT( g >= 0 );
+ iGradeCount[g] ++;
+ }
+
+ BEGIN_TABLE(6);
+ for( int g=0; gm_iNumGradeTiersUsed; g++ )
+ TABLE_LINE2( GradeToThemedString((Grade)g), iGradeCount[g] );
+ TABLE_LINE2( GradeToThemedString(GRADE_FAILED), iGradeCount[GRADE_FAILED] );
+ END_TABLE;
+ }
+ PRINT_CLOSE(f);
}
PRINT_CLOSE(f);
}
@@ -224,7 +266,7 @@ void PrintPopularity( RageFile &f, const Profile *pProfile, CString sTitle, vect
int iNumTimesPlayed = pProfile->GetSongNumTimesPlayed(pSong);
if( iNumTimesPlayed == 0 || iNumTimesPlayed < iPopularNumPlaysThreshold ) // not popular
break; // done searching
- TABLE_LINE3(i+1, pSong->GetFullDisplayTitle(), iNumTimesPlayed );
+ TABLE_LINE4(i+1, pSong->GetDisplayMainTitle(), pSong->GetDisplaySubTitle(), iNumTimesPlayed );
}
END_TABLE;
}
@@ -242,7 +284,7 @@ void PrintPopularity( RageFile &f, const Profile *pProfile, CString sTitle, vect
int iNumTimesPlayed = pProfile->GetSongNumTimesPlayed(pSong);
if( iNumTimesPlayed >= iPopularNumPlaysThreshold ) // not unpopular
break; // done searching
- TABLE_LINE3(i+1, pSong->GetFullDisplayTitle(), iNumTimesPlayed );
+ TABLE_LINE4(i+1, pSong->GetDisplayMainTitle(), pSong->GetDisplaySubTitle(), iNumTimesPlayed );
}
END_TABLE;
}
@@ -263,12 +305,10 @@ void PrintPopularity( RageFile &f, const Profile *pProfile, CString sTitle, vect
continue; // skip
Song* pSong = mapStepsToSong[pSteps];
CString s;
- s += pSong->GetFullDisplayTitle();
- s += " - ";
s += GAMEMAN->NotesTypeToString(pSteps->m_StepsType);
s += " ";
s += DifficultyToString(pSteps->GetDifficulty());
- TABLE_LINE3(i+1, s, pProfile->GetStepsNumTimesPlayed(pSteps) );
+ TABLE_LINE5(i+1, pSong->GetDisplayMainTitle(), pSong->GetDisplaySubTitle(), s, pProfile->GetStepsNumTimesPlayed(pSteps) );
}
END_TABLE;
}
@@ -612,6 +652,27 @@ void PrintBookkeeping( RageFile &f, const Profile *pProfile, CString sTitle, vec
PRINT_CLOSE(f);
}
+void PrintScreenshots( RageFile &f, const Profile *pProfile, CString sTitle, CString sProfileDir )
+{
+ PRINT_OPEN(f, sTitle );
+ {
+ CStringArray asFiles;
+ GetDirListing( sProfileDir+"Screenshots/*.jpg", asFiles );
+
+ BEGIN_TABLE(2);
+ for( int i=0; i
", sFile.c_str(), sFile.c_str() );
+
+ TABLE_LINE1( sImgTag );
+ }
+ END_TABLE;
+ }
+ PRINT_CLOSE(f);
+}
+
enum SaveType { SAVE_TYPE_PLAYER, SAVE_TYPE_MACHINE };
void SaveStatsWebPageToDir( CString sDir, SaveType saveType, const Profile *pProfile, const Profile *pProfileMachine )
@@ -719,7 +780,7 @@ function expandIt(whichEl)\n\
\n\
\n\
",
-STATS_TITLE.c_str(), STYLE_CSS ) );
+TITLE.c_str(), STYLE_CSS ) );
}
CString sType;
@@ -738,7 +799,7 @@ STATS_TITLE.c_str(), STYLE_CSS ) );
f.Write( ssprintf(
"\n",
- STATS_TITLE.c_str(), sType.c_str(), sName.c_str(), sTime.c_str() ) );
+ TITLE.c_str(), sType.c_str(), sName.c_str(), sTime.c_str() ) );
CString sPlayerName = pProfile->GetDisplayName();
CString sMachineName = pProfileMachine->GetDisplayName();
@@ -749,6 +810,7 @@ STATS_TITLE.c_str(), STYLE_CSS ) );
PrintStatistics( f, pProfile, sPlayerName+"'s Statistics", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
PrintPopularity( f, pProfile, sPlayerName+"'s Popularity", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
PrintHighScores( f, pProfile, sPlayerName+"'s High Scores", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
+ PrintScreenshots( f, pProfile, sPlayerName+"'s Screenshots", sDir );
PrintPopularity( f, pProfileMachine, sMachineName+"'s Popularity", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
PrintHighScores( f, pProfileMachine, sMachineName+"'s High Scores", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
break;
@@ -764,7 +826,7 @@ STATS_TITLE.c_str(), STYLE_CSS ) );
ASSERT(0);
}
- f.PutLine( ssprintf("\n", STATS_FOOTER.c_str()) );
+ f.PutLine( ssprintf("\n", FOOTER.c_str()) );
f.PutLine( "" );
f.PutLine( "