diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp
index 26fd08627a..fe3015ee01 100644
--- a/stepmania/src/GameManager.cpp
+++ b/stepmania/src/GameManager.cpp
@@ -1185,7 +1185,7 @@ StyleDef g_StyleDefs[NUM_STYLES] =
GAME_DANCE, // m_Game
false, // m_bUsedForGameplay
true, // m_bUsedForEdit
- "couple (edit)", // m_szName
+ "couple-edit", // m_szName
STEPS_TYPE_DANCE_COUPLE, // m_StepsType
StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType
{ 160, 480 }, // m_iCenterX
@@ -1405,7 +1405,7 @@ StyleDef g_StyleDefs[NUM_STYLES] =
GAME_PUMP, // m_Game
false, // m_bUsedForGameplay
true, // m_bUsedForEdit
- "couple (edit)", // m_szName
+ "couple-edit", // m_szName
STEPS_TYPE_PUMP_COUPLE, // m_StepsType
StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType
{ 160, 480 }, // m_iCenterX
@@ -1912,7 +1912,7 @@ StyleDef g_StyleDefs[NUM_STYLES] =
GAME_IIDX, // m_Game
false, // m_bUsedForGameplay
true, // m_bUsedForEdit
- "single5 (edit)", // m_szName
+ "single5-edit", // m_szName
STEPS_TYPE_IIDX_SINGLE5, // m_StepsType
StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType
{ 160, 480 }, // m_iCenterX
@@ -1947,7 +1947,7 @@ StyleDef g_StyleDefs[NUM_STYLES] =
GAME_IIDX, // m_Game
false, // m_bUsedForGameplay
true, // m_bUsedForEdit
- "double5 (edit)", // m_szName
+ "double5-edit", // m_szName
STEPS_TYPE_IIDX_DOUBLE5, // m_StepsType
StyleDef::ONE_PLAYER_TWO_CREDITS, // m_StyleType
{ 320, 320 }, // m_iCenterX
diff --git a/stepmania/src/HighScore.cpp b/stepmania/src/HighScore.cpp
index b738a31c8c..7184ce3887 100644
--- a/stepmania/src/HighScore.cpp
+++ b/stepmania/src/HighScore.cpp
@@ -54,19 +54,19 @@ XNode* HighScore::CreateNode() const
return pNode;
}
-void HighScore::LoadFromNode( XNode* pNode )
+void HighScore::LoadFromNode( const XNode* pNode )
{
ASSERT( pNode->name == "HighScore" );
- XNodes childs = pNode->GetChilds();
- for( unsigned i = 0 ; i < childs.size(); i++)
+ for( XNodes::const_iterator child = pNode->childs.begin();
+ child != pNode->childs.end();
+ child++ )
{
- XNode* pChild = childs[i];
- if( pChild->name == "Name" ) pChild->GetValue( sName );
- else if( pChild->name == "Grade" ) pChild->GetValue( (int&)grade );
- else if( pChild->name == "Score" ) pChild->GetValue( iScore );
- else if( pChild->name == "PercentDP" ) pChild->GetValue( fPercentDP );
- else if( pChild->name == "SurviveSeconds" ) pChild->GetValue( fSurviveSeconds );
- else if( pChild->name == "Modifiers" ) pChild->GetValue( sModifiers );
+ if( (*child)->name == "Name" ) (*child)->GetValue( sName );
+ else if( (*child)->name == "Grade" ) (*child)->GetValue( (int&)grade );
+ else if( (*child)->name == "Score" ) (*child)->GetValue( iScore );
+ else if( (*child)->name == "PercentDP" ) (*child)->GetValue( fPercentDP );
+ else if( (*child)->name == "SurviveSeconds" ) (*child)->GetValue( fSurviveSeconds );
+ else if( (*child)->name == "Modifiers" ) (*child)->GetValue( sModifiers );
}
}
@@ -124,12 +124,12 @@ XNode* HighScoreList::CreateNode() const
return pNode;
}
-void HighScoreList::LoadFromNode( XNode* pNode )
+void HighScoreList::LoadFromNode( const XNode* pNode )
{
Init();
ASSERT( pNode->name == "HighScoreList" );
- for( XNodes::iterator child = pNode->childs.begin();
+ for( XNodes::const_iterator child = pNode->childs.begin();
child != pNode->childs.end();
child++)
{
diff --git a/stepmania/src/HighScore.h b/stepmania/src/HighScore.h
index 862e7cf23c..9061bb1017 100644
--- a/stepmania/src/HighScore.h
+++ b/stepmania/src/HighScore.h
@@ -35,7 +35,7 @@ struct HighScore
bool operator>=( const HighScore& other ) const;
XNode* CreateNode() const;
- void LoadFromNode( XNode* pNode );
+ void LoadFromNode( const XNode* pNode );
};
struct HighScoreList
@@ -56,7 +56,7 @@ struct HighScoreList
const HighScore& GetTopScore() const;
XNode* CreateNode() const;
- void LoadFromNode( XNode* pNode );
+ void LoadFromNode( const XNode* pNode );
};
diff --git a/stepmania/src/Profile.h b/stepmania/src/Profile.h
index 48bd766441..e419866584 100644
--- a/stepmania/src/Profile.h
+++ b/stepmania/src/Profile.h
@@ -40,10 +40,15 @@ public:
static CString GetProfileDisplayNameFromDir( CString sDir );
int GetSongNumTimesPlayed( const Song* pSong ) const;
+ //
+ // Editable data
+ //
+ CString m_sDisplayName;
+ float m_fWeightPounds;
+
//
// General data
//
- CString m_sName;
CString m_sLastUsedHighScoreName;
bool m_bUsingProfileDefaultModifiers;
CString m_sDefaultModifiers;
@@ -51,7 +56,6 @@ public:
int m_iTotalPlaySeconds;
int m_iTotalGameplaySeconds;
int m_iCurrentCombo;
- float m_fWeightPounds;
int m_fCaloriesBurned;
mutable CString m_sLastMachinePlayed; // mutable because we overwrite this on save, and I don't want to remove const from the whole save chain. -Chris
int m_iNumSongsPlayedByPlayMode[NUM_PLAY_MODES];
@@ -124,12 +128,14 @@ public:
//
void InitAll()
{
+ InitEditableData();
InitGeneralData();
InitSongScores();
InitCourseScores();
InitCategoryScores();
InitScreenshotData();
}
+ void InitEditableData();
void InitGeneralData();
void InitSongScores();
void InitCourseScores();
@@ -139,32 +145,34 @@ public:
//
// Loading and saving
//
- bool LoadAllFromDir( CString sDir );
+ bool LoadAllFromDir( CString sDir ); // return false on
bool SaveAllToDir( CString sDir ) const;
- bool LoadGeneralDataFromDir( CString sDir );
- bool SaveGeneralDataToDir( CString sDir ) const;
-
+ void LoadProfileDataFromDirSM390a12( CString sDir );
void LoadSongScoresFromDirSM390a12( CString sDir );
- void LoadSongScoresFromDir( CString sDir );
- void SaveSongScoresToDir( CString sDir ) const;
- void DeleteSongScoresFromDirSM390a12( CString sDir ) const;
-
void LoadCourseScoresFromDirSM390a12( CString sDir );
- void LoadCourseScoresFromDir( CString sDir );
- void SaveCourseScoresToDir( CString sDir ) const;
- void DeleteCourseScoresFromDirSM390a12( CString sDir ) const;
-
void LoadCategoryScoresFromDirSM390a12( CString sDir );
- void LoadCategoryScoresFromDir( CString sDir );
- void SaveCategoryScoresToDir( CString sDir ) const;
+
+ void LoadEditableDataFromNode( const XNode* pNode );
+ void LoadGeneralDataFromNode( const XNode* pNode );
+ void LoadSongScoresFromNode( const XNode* pNode );
+ void LoadCourseScoresFromNode( const XNode* pNode );
+ void LoadCategoryScoresFromNode( const XNode* pNode );
+ void LoadScreenshotDataFromNode( const XNode* pNode );
+
+ XNode* SaveEditableDataCreateNode() const;
+ XNode* SaveGeneralDataCreateNode() const;
+ XNode* SaveSongScoresCreateNode() const;
+ XNode* SaveCourseScoresCreateNode() const;
+ XNode* SaveCategoryScoresCreateNode() const;
+ XNode* SaveScreenshotDataCreateNode() const;
+
+ void DeleteProfileDataFromDirSM390a12( CString sDir ) const;
+ void DeleteSongScoresFromDirSM390a12( CString sDir ) const;
+ void DeleteCourseScoresFromDirSM390a12( CString sDir ) const;
void DeleteCategoryScoresFromDirSM390a12( CString sDir ) const;
- void LoadScreenshotDataFromDir( CString sDir );
- void SaveScreenshotDataToDir( CString sDir ) const;
-
void SaveStatsWebPageToDir( CString sDir ) const;
-
void SaveMachinePublicKeyToDir( CString sDir ) const;
};
diff --git a/stepmania/src/ProfileHtml.cpp b/stepmania/src/ProfileHtml.cpp
index 2fdb18ced1..208fff5220 100644
--- a/stepmania/src/ProfileHtml.cpp
+++ b/stepmania/src/ProfileHtml.cpp
@@ -150,7 +150,7 @@ void PrintStatistics( RageFile &f, const Profile *pProfile, CString sTitle, vect
PRINT_OPEN(f,"General Info",true);
{
BEGIN_TABLE(2);
- TABLE_LINE2( "Name", pProfile->m_sName );
+ TABLE_LINE2( "DisplayName", pProfile->m_sDisplayName );
TABLE_LINE2( "LastUsedHighScoreName", pProfile->m_sLastUsedHighScoreName );
TABLE_LINE2( "UsingProfileDefaultModifiers", pProfile->m_bUsingProfileDefaultModifiers );
TABLE_LINE2( "DefaultModifiers", pProfile->m_sDefaultModifiers );
@@ -653,23 +653,32 @@ void PrintBookkeeping( RageFile &f, const Profile *pProfile, CString sTitle, vec
PRINT_CLOSE(f);
}
+void PrintScreenshot( RageFile &f, const Profile::Screenshot &ss )
+{
+ CString sHtmlPath = "Screenshots/"+ss.sFileName;
+ CString sImgTag = ssprintf("", sHtmlPath.c_str(), sHtmlPath.c_str() );
+ CString sDetails = "
This is a screenshot
\nWe have no idea where it came from
"; + + BEGIN_TABLE(1); + + TABLE_LINE2( sImgTag, sDetails ); + + END_TABLE; +} + 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( unsigned i=0; i