save RankingCategory as strings; save to attr to make navigation easier
This commit is contained in:
@@ -1069,7 +1069,8 @@ XNode* Profile::SaveCategoryScoresCreateNode() const
|
|||||||
if( pProfile->GetCategoryHighScoreList(st,rc).iNumTimesPlayed == 0 )
|
if( pProfile->GetCategoryHighScoreList(st,rc).iNumTimesPlayed == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
XNode* pRankingCategoryNode = pStepsTypeNode->AppendChild( "RankingCategory", rc );
|
XNode* pRankingCategoryNode = pStepsTypeNode->AppendChild( "RankingCategory" );
|
||||||
|
pRankingCategoryNode->AppendAttr( "Type", RankingCategoryToString(rc) );
|
||||||
|
|
||||||
const HighScoreList &hsl = pProfile->GetCategoryHighScoreList( (StepsType)st, (RankingCategory)rc );
|
const HighScoreList &hsl = pProfile->GetCategoryHighScoreList( (StepsType)st, (RankingCategory)rc );
|
||||||
|
|
||||||
@@ -1107,8 +1108,12 @@ void Profile::LoadCategoryScoresFromNode( const XNode* pNode )
|
|||||||
if( (*radarCategory)->name != "RankingCategory" )
|
if( (*radarCategory)->name != "RankingCategory" )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
RankingCategory rc;
|
const LPXAttr TypeAttr = (*radarCategory)->GetAttr( "Type" );
|
||||||
(*radarCategory)->GetValue( (int&)rc );
|
if( TypeAttr == NULL )
|
||||||
|
WARN_AND_CONTINUE;
|
||||||
|
RankingCategory rc = StringToRankingCategory( TypeAttr->value );
|
||||||
|
if( rc == RANKING_INVALID )
|
||||||
|
WARN_AND_CONTINUE;
|
||||||
|
|
||||||
XNode *pHighScoreListNode = (*radarCategory)->GetChild("HighScoreList");
|
XNode *pHighScoreListNode = (*radarCategory)->GetChild("HighScoreList");
|
||||||
if( pHighScoreListNode == NULL )
|
if( pHighScoreListNode == NULL )
|
||||||
|
|||||||
Reference in New Issue
Block a user