From 22b8a10cbe2c50696fae1601c1136352ef4b5f91 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 22 Feb 2004 03:11:22 +0000 Subject: [PATCH] CategoryScores: save NotesType as a string, so we don't lose compat if we move NotesTypes around --- stepmania/src/Profile.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index df7b549cff..aabd1aeb7e 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -1060,7 +1060,8 @@ XNode* Profile::SaveCategoryScoresCreateNode() const if( pProfile->GetCategoryNumTimesPlayed( st ) == 0 ) continue; - XNode* pStepsTypeNode = pNode->AppendChild( "StepsType", st ); + XNode* pStepsTypeNode = pNode->AppendChild( "StepsType" ); + pStepsTypeNode->AppendAttr( "Type", GameManager::NotesTypeToString(st) ); FOREACH_RankingCategory( rc ) { @@ -1092,8 +1093,12 @@ void Profile::LoadCategoryScoresFromNode( const XNode* pNode ) if( (*stepsType)->name != "StepsType" ) continue; - StepsType st; - (*stepsType)->GetValue((int&)st); + LPXAttr TypeAttr = (*stepsType)->GetAttr( "Type" ); + if( TypeAttr == NULL ) + WARN_AND_CONTINUE; + StepsType st = GameManager::StringToNotesType( TypeAttr->value ); + if( st == STEPS_TYPE_INVALID ) + WARN_AND_CONTINUE; for( XNodes::iterator radarCategory = (*stepsType)->childs.begin(); radarCategory != (*stepsType)->childs.end();