write grade to Profile as string
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include "Grade.h"
|
#include "Grade.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
#include "RageLog.h"
|
||||||
|
|
||||||
CString GradeToThemedString( Grade g )
|
CString GradeToThemedString( Grade g )
|
||||||
{
|
{
|
||||||
@@ -65,7 +66,7 @@ Grade StringToGrade( const CString &sGrade )
|
|||||||
if( sscanf(sGrade.c_str(),"TIER%02d",&iTier) == 1 )
|
if( sscanf(sGrade.c_str(),"TIER%02d",&iTier) == 1 )
|
||||||
return (Grade)(iTier-1);
|
return (Grade)(iTier-1);
|
||||||
|
|
||||||
ASSERT(0);
|
LOG->Warn( "Invalid grade: %s", sGrade.c_str() );
|
||||||
return GRADE_NO_DATA;
|
return GRADE_NO_DATA;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ XNode* HighScore::CreateNode() const
|
|||||||
|
|
||||||
// TRICKY: Don't write "name to fill in" markers.
|
// TRICKY: Don't write "name to fill in" markers.
|
||||||
pNode->AppendChild( "Name", IsRankingToFillIn(sName) ? "" : sName );
|
pNode->AppendChild( "Name", IsRankingToFillIn(sName) ? "" : sName );
|
||||||
pNode->AppendChild( "Grade", grade );
|
pNode->AppendChild( "Grade", GradeToString(grade) );
|
||||||
pNode->AppendChild( "Score", iScore );
|
pNode->AppendChild( "Score", iScore );
|
||||||
pNode->AppendChild( "PercentDP", fPercentDP );
|
pNode->AppendChild( "PercentDP", fPercentDP );
|
||||||
pNode->AppendChild( "SurviveSeconds", fSurviveSeconds );
|
pNode->AppendChild( "SurviveSeconds", fSurviveSeconds );
|
||||||
@@ -69,7 +69,12 @@ void HighScore::LoadFromNode( const XNode* pNode )
|
|||||||
child++ )
|
child++ )
|
||||||
{
|
{
|
||||||
if( (*child)->name == "Name" ) (*child)->GetValue( sName );
|
if( (*child)->name == "Name" ) (*child)->GetValue( sName );
|
||||||
else if( (*child)->name == "Grade" ) (*child)->GetValue( (int&)grade );
|
else if( (*child)->name == "Grade" )
|
||||||
|
{
|
||||||
|
CString sGrade;
|
||||||
|
(*child)->GetValue( sGrade );
|
||||||
|
grade = StringToGrade( sGrade );
|
||||||
|
}
|
||||||
else if( (*child)->name == "Score" ) (*child)->GetValue( iScore );
|
else if( (*child)->name == "Score" ) (*child)->GetValue( iScore );
|
||||||
else if( (*child)->name == "PercentDP" ) (*child)->GetValue( fPercentDP );
|
else if( (*child)->name == "PercentDP" ) (*child)->GetValue( fPercentDP );
|
||||||
else if( (*child)->name == "SurviveSeconds" ) (*child)->GetValue( fSurviveSeconds );
|
else if( (*child)->name == "SurviveSeconds" ) (*child)->GetValue( fSurviveSeconds );
|
||||||
|
|||||||
Reference in New Issue
Block a user