"LastScores"->"RecentScores"
add recent scores to HTML
This commit is contained in:
@@ -233,6 +233,15 @@ void CourseID::LoadFromNode( const XNode* pNode )
|
|||||||
pNode->GetAttrValue("Name", sName);
|
pNode->GetAttrValue("Name", sName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CString CourseID::ToString() const
|
||||||
|
{
|
||||||
|
if( !sPath.empty() )
|
||||||
|
return sPath;
|
||||||
|
if( !sName.empty() )
|
||||||
|
return sName;
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
bool CourseID::IsValid() const
|
bool CourseID::IsValid() const
|
||||||
{
|
{
|
||||||
return !sPath.empty() || !sName.empty();
|
return !sPath.empty() || !sName.empty();
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public:
|
|||||||
|
|
||||||
XNode* CreateNode() const;
|
XNode* CreateNode() const;
|
||||||
void LoadFromNode( const XNode* pNode );
|
void LoadFromNode( const XNode* pNode );
|
||||||
|
CString ToString() const;
|
||||||
bool IsValid() const;
|
bool IsValid() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+27
-27
@@ -47,7 +47,7 @@ const int SM_390A12_COURSE_SCORES_VERSION = 8;
|
|||||||
|
|
||||||
#define GUID_SIZE_BYTES 8
|
#define GUID_SIZE_BYTES 8
|
||||||
|
|
||||||
#define MAX_LAST_SCORES_TO_SAVE 100
|
#define MAX_RECENT_SCORES_TO_SAVE 100
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
#pragma warning (disable : 4706) // assignment within conditional expression
|
#pragma warning (disable : 4706) // assignment within conditional expression
|
||||||
@@ -158,14 +158,14 @@ void Profile::InitAwards()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::InitLastSongScores()
|
void Profile::InitRecentSongScores()
|
||||||
{
|
{
|
||||||
m_vLastStepsScores.clear();
|
m_vRecentStepsScores.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::InitLastCourseScores()
|
void Profile::InitRecentCourseScores()
|
||||||
{
|
{
|
||||||
m_vLastCourseScores.clear();
|
m_vRecentCourseScores.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
CString Profile::GetDisplayName() const
|
CString Profile::GetDisplayName() const
|
||||||
@@ -643,8 +643,8 @@ bool Profile::LoadAllFromDir( CString sDir, bool bRequireSignature )
|
|||||||
LOAD_NODE( ScreenshotData );
|
LOAD_NODE( ScreenshotData );
|
||||||
LOAD_NODE( CalorieData );
|
LOAD_NODE( CalorieData );
|
||||||
LOAD_NODE( Awards );
|
LOAD_NODE( Awards );
|
||||||
LOAD_NODE( LastSongScores );
|
LOAD_NODE( RecentSongScores );
|
||||||
LOAD_NODE( LastCourseScores );
|
LOAD_NODE( RecentCourseScores );
|
||||||
}
|
}
|
||||||
|
|
||||||
return true; // FIXME? Investigate what happens if we always return true.
|
return true; // FIXME? Investigate what happens if we always return true.
|
||||||
@@ -670,8 +670,8 @@ bool Profile::SaveAllToDir( CString sDir, bool bSignData ) const
|
|||||||
xml.AppendChild( SaveScreenshotDataCreateNode() );
|
xml.AppendChild( SaveScreenshotDataCreateNode() );
|
||||||
xml.AppendChild( SaveCalorieDataCreateNode() );
|
xml.AppendChild( SaveCalorieDataCreateNode() );
|
||||||
xml.AppendChild( SaveAwardsCreateNode() );
|
xml.AppendChild( SaveAwardsCreateNode() );
|
||||||
xml.AppendChild( SaveLastSongScoresCreateNode() );
|
xml.AppendChild( SaveRecentSongScoresCreateNode() );
|
||||||
xml.AppendChild( SaveLastCourseScoresCreateNode() );
|
xml.AppendChild( SaveRecentCourseScoresCreateNode() );
|
||||||
bool bSaved = xml.SaveToFile(fn);
|
bool bSaved = xml.SaveToFile(fn);
|
||||||
|
|
||||||
// Update file cache, or else IsAFile in CryptManager won't see this new file.
|
// Update file cache, or else IsAFile in CryptManager won't see this new file.
|
||||||
@@ -1960,11 +1960,11 @@ void Profile::HighScoreForASongAndSteps::LoadFromNode( const XNode* pNode )
|
|||||||
hs.LoadFromNode( p );
|
hs.LoadFromNode( p );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::LoadLastSongScoresFromNode( const XNode* pNode )
|
void Profile::LoadRecentSongScoresFromNode( const XNode* pNode )
|
||||||
{
|
{
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
|
|
||||||
ASSERT( pNode->name == "LastSongScores" );
|
ASSERT( pNode->name == "RecentSongScores" );
|
||||||
for( XNodes::const_iterator p = pNode->childs.begin();
|
for( XNodes::const_iterator p = pNode->childs.begin();
|
||||||
p != pNode->childs.end();
|
p != pNode->childs.end();
|
||||||
p++ )
|
p++ )
|
||||||
@@ -1974,14 +1974,14 @@ void Profile::LoadLastSongScoresFromNode( const XNode* pNode )
|
|||||||
HighScoreForASongAndSteps h;
|
HighScoreForASongAndSteps h;
|
||||||
h.LoadFromNode( *p );
|
h.LoadFromNode( *p );
|
||||||
|
|
||||||
m_vLastStepsScores.push_back( h );
|
m_vRecentStepsScores.push_back( h );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
WARN_AND_CONTINUE;
|
WARN_AND_CONTINUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
XNode* Profile::SaveLastSongScoresCreateNode() const
|
XNode* Profile::SaveRecentSongScoresCreateNode() const
|
||||||
{
|
{
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
|
|
||||||
@@ -1989,25 +1989,25 @@ XNode* Profile::SaveLastSongScoresCreateNode() const
|
|||||||
ASSERT( pProfile );
|
ASSERT( pProfile );
|
||||||
|
|
||||||
XNode* pNode = new XNode;
|
XNode* pNode = new XNode;
|
||||||
pNode->name = "LastSongScores";
|
pNode->name = "RecentSongScores";
|
||||||
|
|
||||||
unsigned uNumToSave = min( m_vLastStepsScores.size(), (unsigned)MAX_LAST_SCORES_TO_SAVE );
|
unsigned uNumToSave = min( m_vRecentStepsScores.size(), (unsigned)MAX_RECENT_SCORES_TO_SAVE );
|
||||||
|
|
||||||
for( unsigned i=0; i<uNumToSave; i++ )
|
for( unsigned i=0; i<uNumToSave; i++ )
|
||||||
{
|
{
|
||||||
pNode->AppendChild( m_vLastStepsScores[i].CreateNode() );
|
pNode->AppendChild( m_vRecentStepsScores[i].CreateNode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return pNode;
|
return pNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::AddStepsLastScore( const Song* pSong, const Steps* pSteps, HighScore hs )
|
void Profile::AddStepsRecentScore( const Song* pSong, const Steps* pSteps, HighScore hs )
|
||||||
{
|
{
|
||||||
HighScoreForASongAndSteps h;
|
HighScoreForASongAndSteps h;
|
||||||
h.songID.FromSong( pSong );
|
h.songID.FromSong( pSong );
|
||||||
h.stepsID.FromSteps( pSteps );
|
h.stepsID.FromSteps( pSteps );
|
||||||
h.hs = hs;
|
h.hs = hs;
|
||||||
m_vLastStepsScores.push_back( h );
|
m_vRecentStepsScores.push_back( h );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2034,11 +2034,11 @@ void Profile::HighScoreForACourse::LoadFromNode( const XNode* pNode )
|
|||||||
hs.LoadFromNode( p );
|
hs.LoadFromNode( p );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::LoadLastCourseScoresFromNode( const XNode* pNode )
|
void Profile::LoadRecentCourseScoresFromNode( const XNode* pNode )
|
||||||
{
|
{
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
|
|
||||||
ASSERT( pNode->name == "LastCourseScores" );
|
ASSERT( pNode->name == "RecentCourseScores" );
|
||||||
for( XNodes::const_iterator p = pNode->childs.begin();
|
for( XNodes::const_iterator p = pNode->childs.begin();
|
||||||
p != pNode->childs.end();
|
p != pNode->childs.end();
|
||||||
p++ )
|
p++ )
|
||||||
@@ -2048,14 +2048,14 @@ void Profile::LoadLastCourseScoresFromNode( const XNode* pNode )
|
|||||||
HighScoreForACourse h;
|
HighScoreForACourse h;
|
||||||
h.LoadFromNode( *p );
|
h.LoadFromNode( *p );
|
||||||
|
|
||||||
m_vLastCourseScores.push_back( h );
|
m_vRecentCourseScores.push_back( h );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
WARN_AND_CONTINUE;
|
WARN_AND_CONTINUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
XNode* Profile::SaveLastCourseScoresCreateNode() const
|
XNode* Profile::SaveRecentCourseScoresCreateNode() const
|
||||||
{
|
{
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
|
|
||||||
@@ -2063,24 +2063,24 @@ XNode* Profile::SaveLastCourseScoresCreateNode() const
|
|||||||
ASSERT( pProfile );
|
ASSERT( pProfile );
|
||||||
|
|
||||||
XNode* pNode = new XNode;
|
XNode* pNode = new XNode;
|
||||||
pNode->name = "LastCourseScores";
|
pNode->name = "RecentCourseScores";
|
||||||
|
|
||||||
unsigned uNumToSave = min( m_vLastCourseScores.size(), (unsigned)MAX_LAST_SCORES_TO_SAVE );
|
unsigned uNumToSave = min( m_vRecentCourseScores.size(), (unsigned)MAX_RECENT_SCORES_TO_SAVE );
|
||||||
|
|
||||||
for( unsigned i=0; i<uNumToSave; i++ )
|
for( unsigned i=0; i<uNumToSave; i++ )
|
||||||
{
|
{
|
||||||
pNode->AppendChild( m_vLastCourseScores[i].CreateNode() );
|
pNode->AppendChild( m_vRecentCourseScores[i].CreateNode() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return pNode;
|
return pNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::AddCourseLastScore( const Course* pCourse, StepsType st, CourseDifficulty cd, HighScore hs )
|
void Profile::AddCourseRecentScore( const Course* pCourse, StepsType st, CourseDifficulty cd, HighScore hs )
|
||||||
{
|
{
|
||||||
HighScoreForACourse h;
|
HighScoreForACourse h;
|
||||||
h.courseID.FromCourse( pCourse );
|
h.courseID.FromCourse( pCourse );
|
||||||
h.hs = hs;
|
h.hs = hs;
|
||||||
m_vLastCourseScores.push_back( h );
|
m_vRecentCourseScores.push_back( h );
|
||||||
}
|
}
|
||||||
|
|
||||||
const Profile::HighScoresForASong *Profile::GetHighScoresForASong( const SongID& songID ) const
|
const Profile::HighScoresForASong *Profile::GetHighScoresForASong( const SongID& songID ) const
|
||||||
|
|||||||
+14
-14
@@ -243,7 +243,7 @@ public:
|
|||||||
bool HasPeakComboAward( PeakComboAward pca );
|
bool HasPeakComboAward( PeakComboAward pca );
|
||||||
|
|
||||||
//
|
//
|
||||||
// LastSongScores
|
// RecentSongScores
|
||||||
//
|
//
|
||||||
struct HighScoreForASongAndSteps
|
struct HighScoreForASongAndSteps
|
||||||
{
|
{
|
||||||
@@ -257,11 +257,11 @@ public:
|
|||||||
XNode* CreateNode() const;
|
XNode* CreateNode() const;
|
||||||
void LoadFromNode( const XNode* pNode );
|
void LoadFromNode( const XNode* pNode );
|
||||||
};
|
};
|
||||||
vector<HighScoreForASongAndSteps> m_vLastStepsScores;
|
vector<HighScoreForASongAndSteps> m_vRecentStepsScores;
|
||||||
void AddStepsLastScore( const Song* pSong, const Steps* pSteps, HighScore hs );
|
void AddStepsRecentScore( const Song* pSong, const Steps* pSteps, HighScore hs );
|
||||||
|
|
||||||
//
|
//
|
||||||
// LastCourseScores
|
// RecentCourseScores
|
||||||
//
|
//
|
||||||
struct HighScoreForACourse
|
struct HighScoreForACourse
|
||||||
{
|
{
|
||||||
@@ -274,8 +274,8 @@ public:
|
|||||||
XNode* CreateNode() const;
|
XNode* CreateNode() const;
|
||||||
void LoadFromNode( const XNode* pNode );
|
void LoadFromNode( const XNode* pNode );
|
||||||
};
|
};
|
||||||
vector<HighScoreForACourse> m_vLastCourseScores;
|
vector<HighScoreForACourse> m_vRecentCourseScores;
|
||||||
void AddCourseLastScore( const Course* pCourse, StepsType st, CourseDifficulty cd, HighScore hs );
|
void AddCourseRecentScore( const Course* pCourse, StepsType st, CourseDifficulty cd, HighScore hs );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Init'ing
|
// Init'ing
|
||||||
@@ -290,8 +290,8 @@ public:
|
|||||||
InitScreenshotData();
|
InitScreenshotData();
|
||||||
InitCalorieData();
|
InitCalorieData();
|
||||||
InitAwards();
|
InitAwards();
|
||||||
InitLastSongScores();
|
InitRecentSongScores();
|
||||||
InitLastCourseScores();
|
InitRecentCourseScores();
|
||||||
}
|
}
|
||||||
void InitEditableData();
|
void InitEditableData();
|
||||||
void InitGeneralData();
|
void InitGeneralData();
|
||||||
@@ -301,8 +301,8 @@ public:
|
|||||||
void InitScreenshotData();
|
void InitScreenshotData();
|
||||||
void InitCalorieData();
|
void InitCalorieData();
|
||||||
void InitAwards();
|
void InitAwards();
|
||||||
void InitLastSongScores();
|
void InitRecentSongScores();
|
||||||
void InitLastCourseScores();
|
void InitRecentCourseScores();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Loading and saving
|
// Loading and saving
|
||||||
@@ -323,8 +323,8 @@ public:
|
|||||||
void LoadScreenshotDataFromNode( const XNode* pNode );
|
void LoadScreenshotDataFromNode( const XNode* pNode );
|
||||||
void LoadCalorieDataFromNode( const XNode* pNode );
|
void LoadCalorieDataFromNode( const XNode* pNode );
|
||||||
void LoadAwardsFromNode( const XNode* pNode );
|
void LoadAwardsFromNode( const XNode* pNode );
|
||||||
void LoadLastSongScoresFromNode( const XNode* pNode );
|
void LoadRecentSongScoresFromNode( const XNode* pNode );
|
||||||
void LoadLastCourseScoresFromNode( const XNode* pNode );
|
void LoadRecentCourseScoresFromNode( const XNode* pNode );
|
||||||
|
|
||||||
void SaveEditableDataToDir( CString sDir ) const;
|
void SaveEditableDataToDir( CString sDir ) const;
|
||||||
XNode* SaveGeneralDataCreateNode() const;
|
XNode* SaveGeneralDataCreateNode() const;
|
||||||
@@ -334,8 +334,8 @@ public:
|
|||||||
XNode* SaveScreenshotDataCreateNode() const;
|
XNode* SaveScreenshotDataCreateNode() const;
|
||||||
XNode* SaveCalorieDataCreateNode() const;
|
XNode* SaveCalorieDataCreateNode() const;
|
||||||
XNode* SaveAwardsCreateNode() const;
|
XNode* SaveAwardsCreateNode() const;
|
||||||
XNode* SaveLastSongScoresCreateNode() const;
|
XNode* SaveRecentSongScoresCreateNode() const;
|
||||||
XNode* SaveLastCourseScoresCreateNode() const;
|
XNode* SaveRecentCourseScoresCreateNode() const;
|
||||||
|
|
||||||
void DeleteProfileDataFromDirSM390a12( CString sDir ) const;
|
void DeleteProfileDataFromDirSM390a12( CString sDir ) const;
|
||||||
void DeleteSongScoresFromDirSM390a12( CString sDir ) const;
|
void DeleteSongScoresFromDirSM390a12( CString sDir ) const;
|
||||||
|
|||||||
@@ -47,6 +47,20 @@ const CString STYLE_CSS = "Style.css";
|
|||||||
|
|
||||||
#define NEWLINE "\r\n"
|
#define NEWLINE "\r\n"
|
||||||
|
|
||||||
|
CString HighScoreToString( const HighScore& hs )
|
||||||
|
{
|
||||||
|
CStringArray asTokens;
|
||||||
|
asTokens.push_back( hs.sName.empty() ? "????" : hs.sName );
|
||||||
|
if( SHOW_HIGH_SCORE_GRADE )
|
||||||
|
asTokens.push_back( GradeToThemedString(hs.grade) );
|
||||||
|
if( SHOW_HIGH_SCORE_SCORE )
|
||||||
|
asTokens.push_back( ssprintf("%i", hs.iScore) );
|
||||||
|
if( SHOW_HIGH_SCORE_PERCENT )
|
||||||
|
asTokens.push_back( ssprintf("%05.2f%%", hs.fPercentDP*100) );
|
||||||
|
|
||||||
|
return join(", ",asTokens);
|
||||||
|
}
|
||||||
|
|
||||||
void TranslatedWrite( RageFile &f, CString s )
|
void TranslatedWrite( RageFile &f, CString s )
|
||||||
{
|
{
|
||||||
s.Replace("\n",NEWLINE);
|
s.Replace("\n",NEWLINE);
|
||||||
@@ -198,6 +212,13 @@ inline void PrintTable(RageFile &f,Table &table)
|
|||||||
TranslatedWrite(f,"</tr>\n</table>\n");
|
TranslatedWrite(f,"</tr>\n</table>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PrintEmptyTable( RageFile &f )
|
||||||
|
{
|
||||||
|
BEGIN_TABLE(1);
|
||||||
|
TABLE_LINE1("empty");
|
||||||
|
END_TABLE;
|
||||||
|
}
|
||||||
|
|
||||||
#define STRING_AS_LINK(s) CString("<a href='"+s+"'>"+s+"</a>")
|
#define STRING_AS_LINK(s) CString("<a href='"+s+"'>"+s+"</a>")
|
||||||
|
|
||||||
void PrintInstructions( RageFile &f, const Profile *pProfile, CString sTitle )
|
void PrintInstructions( RageFile &f, const Profile *pProfile, CString sTitle )
|
||||||
@@ -552,11 +573,7 @@ bool PrintSongsInGroup( RageFile &f, const Profile *pProfile, CString sGroup, Fn
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !bPrintedAny )
|
if( !bPrintedAny )
|
||||||
{
|
PrintEmptyTable(f);
|
||||||
BEGIN_TABLE(1);
|
|
||||||
TABLE_LINE1("empty");
|
|
||||||
END_TABLE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
PRINT_CLOSE(f);
|
PRINT_CLOSE(f);
|
||||||
|
|
||||||
@@ -582,11 +599,7 @@ bool PrintGroups( RageFile &f, const Profile *pProfile, CString sTitle, FnPrintG
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !bPrintedAny )
|
if( !bPrintedAny )
|
||||||
{
|
PrintEmptyTable(f);
|
||||||
BEGIN_TABLE(1);
|
|
||||||
TABLE_LINE1("empty");
|
|
||||||
END_TABLE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
PRINT_CLOSE(f);
|
PRINT_CLOSE(f);
|
||||||
|
|
||||||
@@ -612,11 +625,7 @@ bool PrintCourses( RageFile &f, const Profile *pProfile, CString sTitle, FnPrint
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !bPrintedAny )
|
if( !bPrintedAny )
|
||||||
{
|
PrintEmptyTable(f);
|
||||||
BEGIN_TABLE(1);
|
|
||||||
TABLE_LINE1("empty");
|
|
||||||
END_TABLE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
PRINT_CLOSE(f);
|
PRINT_CLOSE(f);
|
||||||
|
|
||||||
@@ -649,14 +658,8 @@ void PrintHighScoreListTable( RageFile &f, const HighScoreList& hsl )
|
|||||||
|
|
||||||
CStringArray asTokens;
|
CStringArray asTokens;
|
||||||
asTokens.push_back( hs.sName.empty() ? "????" : hs.sName );
|
asTokens.push_back( hs.sName.empty() ? "????" : hs.sName );
|
||||||
if( SHOW_HIGH_SCORE_GRADE )
|
|
||||||
asTokens.push_back( GradeToThemedString(hs.grade) );
|
|
||||||
if( SHOW_HIGH_SCORE_SCORE )
|
|
||||||
asTokens.push_back( ssprintf("%i", hs.iScore) );
|
|
||||||
if( SHOW_HIGH_SCORE_PERCENT )
|
|
||||||
asTokens.push_back( ssprintf("%05.2f%%", hs.fPercentDP*100) );
|
|
||||||
|
|
||||||
TABLE_LINE2( sName, join(", ",asTokens) );
|
TABLE_LINE2( sName, HighScoreToString(hs) );
|
||||||
}
|
}
|
||||||
END_TABLE;
|
END_TABLE;
|
||||||
}
|
}
|
||||||
@@ -766,7 +769,6 @@ bool PrintPercentCompleteForStepsType( RageFile &f, const Profile *pProfile, Ste
|
|||||||
TABLE_LINE2( "Actual Course Points", pProfile->GetActualCourseDancePointsForStepsType(st) );
|
TABLE_LINE2( "Actual Course Points", pProfile->GetActualCourseDancePointsForStepsType(st) );
|
||||||
TABLE_LINE2( "Possible Song Points", pProfile->GetPossibleSongDancePointsForStepsType(st) );
|
TABLE_LINE2( "Possible Song Points", pProfile->GetPossibleSongDancePointsForStepsType(st) );
|
||||||
TABLE_LINE2( "Possible Course Points", pProfile->GetPossibleCourseDancePointsForStepsType(st) );
|
TABLE_LINE2( "Possible Course Points", pProfile->GetPossibleCourseDancePointsForStepsType(st) );
|
||||||
// FIXME
|
|
||||||
END_TABLE;
|
END_TABLE;
|
||||||
|
|
||||||
PRINT_OPEN(f, "Songs" );
|
PRINT_OPEN(f, "Songs" );
|
||||||
@@ -897,6 +899,48 @@ void PrintPercentComplete( RageFile &f, const Profile *pProfile, CString sTitle,
|
|||||||
PrintStepsTypes( f, pProfile, sTitle, vStepsTypesToShow, PrintPercentCompleteForStepsType );
|
PrintStepsTypes( f, pProfile, sTitle, vStepsTypesToShow, PrintPercentCompleteForStepsType );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PrintRecentScores( RageFile &f, const Profile *pProfile, CString sTitle, vector<Song*> &vpSongs, vector<Steps*> &vpAllSteps, vector<StepsType> &vStepsTypesToShow, map<Steps*,Song*> mapStepsToSong, vector<Course*> vpCourses )
|
||||||
|
{
|
||||||
|
PRINT_OPEN(f, sTitle );
|
||||||
|
{
|
||||||
|
PRINT_OPEN(f, "Songs" );
|
||||||
|
{
|
||||||
|
for( unsigned i=0; i<pProfile->m_vRecentStepsScores.size(); i++ )
|
||||||
|
{
|
||||||
|
const Profile::HighScoreForASongAndSteps hsfas = pProfile->m_vRecentStepsScores[i];
|
||||||
|
|
||||||
|
BEGIN_TABLE(1);
|
||||||
|
TABLE_LINE2( "Song", hsfas.songID.ToString() );
|
||||||
|
TABLE_LINE2( "Steps", hsfas.stepsID.ToString() );
|
||||||
|
TABLE_LINE2( "Results", HighScoreToString(hsfas.hs) );
|
||||||
|
END_TABLE;
|
||||||
|
}
|
||||||
|
if( pProfile->m_vRecentStepsScores.empty() )
|
||||||
|
PrintEmptyTable(f);
|
||||||
|
}
|
||||||
|
PRINT_CLOSE(f);
|
||||||
|
|
||||||
|
PRINT_OPEN(f, "Courses" );
|
||||||
|
{
|
||||||
|
for( unsigned i=0; i<pProfile->m_vRecentCourseScores.size(); i++ )
|
||||||
|
{
|
||||||
|
const Profile::HighScoreForACourse hsfac = pProfile->m_vRecentCourseScores[i];
|
||||||
|
|
||||||
|
BEGIN_TABLE(1);
|
||||||
|
TABLE_LINE2( "Course", hsfac.courseID.ToString() );
|
||||||
|
TABLE_LINE2( "Results", HighScoreToString(hsfac.hs) );
|
||||||
|
END_TABLE;
|
||||||
|
}
|
||||||
|
if( pProfile->m_vRecentCourseScores.empty() )
|
||||||
|
PrintEmptyTable(f);
|
||||||
|
}
|
||||||
|
PRINT_CLOSE(f);
|
||||||
|
}
|
||||||
|
PRINT_CLOSE(f);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool PrintInventoryForSong( RageFile &f, const Profile *pProfile, Song* pSong )
|
bool PrintInventoryForSong( RageFile &f, const Profile *pProfile, Song* pSong )
|
||||||
{
|
{
|
||||||
if( pSong->NeverDisplayed() || UNLOCKMAN->SongIsLocked(pSong) )
|
if( pSong->NeverDisplayed() || UNLOCKMAN->SongIsLocked(pSong) )
|
||||||
@@ -1109,9 +1153,7 @@ void PrintScreenshots( RageFile &f, const Profile *pProfile, CString sTitle, CSt
|
|||||||
|
|
||||||
if( pProfile->m_vScreenshots.empty() )
|
if( pProfile->m_vScreenshots.empty() )
|
||||||
{
|
{
|
||||||
BEGIN_TABLE(1);
|
PrintEmptyTable(f);
|
||||||
TABLE_LINE1("empty");
|
|
||||||
END_TABLE;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1358,9 +1400,10 @@ TITLE.c_str(), STYLE_CSS.c_str() ) );
|
|||||||
PrintScreenshots( f, pProfile, "My Screenshots", sDir );
|
PrintScreenshots( f, pProfile, "My Screenshots", sDir );
|
||||||
PrintCaloriesBurned( f, pProfile, "My Calories Burned", sDir );
|
PrintCaloriesBurned( f, pProfile, "My Calories Burned", sDir );
|
||||||
PrintPercentComplete( f, pProfile, "My Percent Complete", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
PrintPercentComplete( f, pProfile, "My Percent Complete", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
||||||
PrintPopularity( f, pProfile, "Last Machine Popularity", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
PrintRecentScores( f, pProfile, "My Recent Scores", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
||||||
PrintSongHighScores( f, pProfile, "Last Machine Song High Scores", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
PrintPopularity( f, pProfile, "Last Machine's Popularity", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
||||||
PrintCourseHighScores( f, pProfile, "Last Machine Course High Scores", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
PrintSongHighScores( f, pProfile, "Last Machine's Song High Scores", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
||||||
|
PrintCourseHighScores( f, pProfile, "Last Machine's Course High Scores",vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
||||||
break;
|
break;
|
||||||
case HTML_TYPE_MACHINE:
|
case HTML_TYPE_MACHINE:
|
||||||
PrintStatistics( f, pProfile, "Statistics", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
PrintStatistics( f, pProfile, "Statistics", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
||||||
@@ -1370,6 +1413,7 @@ TITLE.c_str(), STYLE_CSS.c_str() ) );
|
|||||||
PrintScreenshots( f, pProfile, "Screenshots", sDir );
|
PrintScreenshots( f, pProfile, "Screenshots", sDir );
|
||||||
PrintCaloriesBurned( f, pProfile, "Calories Burned", sDir );
|
PrintCaloriesBurned( f, pProfile, "Calories Burned", sDir );
|
||||||
PrintPercentComplete( f, pProfile, "Percent Complete", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
PrintPercentComplete( f, pProfile, "Percent Complete", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
||||||
|
PrintRecentScores( f, pProfile, "Most Scores", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
||||||
PrintInventoryList( f, pProfile, "Song Information", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
PrintInventoryList( f, pProfile, "Song Information", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
||||||
PrintBookkeeping( f, pProfile, "Bookkeeping", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
PrintBookkeeping( f, pProfile, "Bookkeeping", vpSongs, vpAllSteps, vStepsTypesToShow, mapStepsToSong, vpCourses );
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -464,8 +464,8 @@ void ProfileManager::AddStepsScore( const Song* pSong, const Steps* pSteps, Play
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( PROFILEMAN->IsUsingProfile(pn) )
|
if( PROFILEMAN->IsUsingProfile(pn) )
|
||||||
PROFILEMAN->GetProfile(pn)->AddStepsLastScore( pSong, pSteps, hs );
|
PROFILEMAN->GetProfile(pn)->AddStepsRecentScore( pSong, pSteps, hs );
|
||||||
PROFILEMAN->GetMachineProfile()->AddStepsLastScore( pSong, pSteps, hs );
|
PROFILEMAN->GetMachineProfile()->AddStepsRecentScore( pSong, pSteps, hs );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileManager::IncrementStepsPlayCount( const Song* pSong, const Steps* pSteps, PlayerNumber pn )
|
void ProfileManager::IncrementStepsPlayCount( const Song* pSong, const Steps* pSteps, PlayerNumber pn )
|
||||||
@@ -507,8 +507,8 @@ void ProfileManager::AddCourseScore( const Course* pCourse, StepsType st, Course
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( PROFILEMAN->IsUsingProfile(pn) )
|
if( PROFILEMAN->IsUsingProfile(pn) )
|
||||||
PROFILEMAN->GetProfile(pn)->AddCourseLastScore( pCourse, st, cd, hs );
|
PROFILEMAN->GetProfile(pn)->AddCourseRecentScore( pCourse, st, cd, hs );
|
||||||
PROFILEMAN->GetMachineProfile()->AddCourseLastScore( pCourse, st, cd, hs );
|
PROFILEMAN->GetMachineProfile()->AddCourseRecentScore( pCourse, st, cd, hs );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileManager::IncrementCoursePlayCount( const Course* pCourse, StepsType st, CourseDifficulty cd, PlayerNumber pn )
|
void ProfileManager::IncrementCoursePlayCount( const Course* pCourse, StepsType st, CourseDifficulty cd, PlayerNumber pn )
|
||||||
|
|||||||
@@ -387,6 +387,11 @@ void SongID::LoadFromNode( const XNode* pNode )
|
|||||||
pNode->GetAttrValue("Dir", sDir);
|
pNode->GetAttrValue("Dir", sDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CString SongID::ToString() const
|
||||||
|
{
|
||||||
|
return sDir;
|
||||||
|
}
|
||||||
|
|
||||||
bool SongID::IsValid() const
|
bool SongID::IsValid() const
|
||||||
{
|
{
|
||||||
return !sDir.empty();
|
return !sDir.empty();
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public:
|
|||||||
|
|
||||||
XNode* CreateNode() const;
|
XNode* CreateNode() const;
|
||||||
void LoadFromNode( const XNode* pNode );
|
void LoadFromNode( const XNode* pNode );
|
||||||
|
CString ToString() const;
|
||||||
bool IsValid() const;
|
bool IsValid() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -209,6 +209,18 @@ void StepsID::LoadFromNode( const XNode* pNode )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CString StepsID::ToString() const
|
||||||
|
{
|
||||||
|
CString s = GameManager::NotesTypeToString(st);
|
||||||
|
s += " " + DifficultyToString(dc);
|
||||||
|
if( dc == DIFFICULTY_EDIT )
|
||||||
|
{
|
||||||
|
s += " " + sDescription;
|
||||||
|
s += ssprintf(" %u", uHash );
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
bool StepsID::IsValid() const
|
bool StepsID::IsValid() const
|
||||||
{
|
{
|
||||||
return st != STEPS_TYPE_INVALID && dc != DIFFICULTY_INVALID;
|
return st != STEPS_TYPE_INVALID && dc != DIFFICULTY_INVALID;
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public:
|
|||||||
|
|
||||||
XNode* CreateNode() const;
|
XNode* CreateNode() const;
|
||||||
void LoadFromNode( const XNode* pNode );
|
void LoadFromNode( const XNode* pNode );
|
||||||
|
CString ToString() const;
|
||||||
bool IsValid() const;
|
bool IsValid() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user