From 6a22aba2c0e2f327a3ea491eaa78af4788b53dd1 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sun, 18 Jul 2004 21:54:19 +0000 Subject: [PATCH] add LastPlayedDate --- stepmania/src/Profile.cpp | 6 +++++- stepmania/src/Profile.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index bb758e07a2..0873b6358f 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -89,6 +89,7 @@ void Profile::InitGeneralData() m_iNumToasties = 0; m_UnlockedSongs.clear(); m_sLastPlayedMachineGuid = ""; + m_LastPlayedDate = DateTime::GetNowDate(); m_iTotalTapsAndHolds = 0; m_iTotalJumps = 0; m_iTotalHolds = 0; @@ -642,6 +643,7 @@ bool Profile::LoadAllFromDir( CString sDir, bool bRequireSignature ) bool Profile::SaveAllToDir( CString sDir, bool bSignData ) const { m_sLastPlayedMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid; + m_LastPlayedDate = DateTime::GetNowDate(); // Save editable.xml SaveEditableDataToDir( sDir ); @@ -736,6 +738,7 @@ XNode* Profile::SaveGeneralDataCreateNode() const pGeneralDataNode->AppendChild( "CurrentCombo", m_iCurrentCombo ); pGeneralDataNode->AppendChild( "TotalCaloriesBurned", m_fTotalCaloriesBurned ); pGeneralDataNode->AppendChild( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid ); + pGeneralDataNode->AppendChild( "LastPlayedDate", m_LastPlayedDate ); pGeneralDataNode->AppendChild( "TotalDancePoints", m_iTotalDancePoints ); pGeneralDataNode->AppendChild( "NumExtraStagesPassed", m_iNumExtraStagesPassed ); pGeneralDataNode->AppendChild( "NumExtraStagesFailed", m_iNumExtraStagesFailed ); @@ -879,6 +882,7 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode ) pNode->GetChildValue( "CurrentCombo", m_iCurrentCombo ); pNode->GetChildValue( "TotalCaloriesBurned", m_fTotalCaloriesBurned ); pNode->GetChildValue( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid ); + pNode->GetChildValue( "LastPlayedDate", m_LastPlayedDate ); pNode->GetChildValue( "TotalDancePoints", m_iTotalDancePoints ); pNode->GetChildValue( "NumExtraStagesPassed", m_iNumExtraStagesPassed ); pNode->GetChildValue( "NumExtraStagesFailed", m_iNumExtraStagesFailed ); @@ -1323,7 +1327,7 @@ XNode* Profile::SaveCalorieDataCreateNode() const { XNode* pCaloriesBurned = pNode->AppendChild( "CaloriesBurned", i->second ); - pCaloriesBurned->AppendAttr( "Date", i->first.GetDateString() ); + pCaloriesBurned->AppendAttr( "Date", i->first.GetString() ); } return pNode; diff --git a/stepmania/src/Profile.h b/stepmania/src/Profile.h index 4550974103..4310125deb 100644 --- a/stepmania/src/Profile.h +++ b/stepmania/src/Profile.h @@ -107,6 +107,7 @@ public: int m_iTotalHands; set m_UnlockedSongs; mutable CString m_sLastPlayedMachineGuid; // mutable because we overwrite this on save, and I don't want to remove const from the whole save chain. -Chris + mutable DateTime m_LastPlayedDate; int m_iNumSongsPlayedByPlayMode[NUM_PLAY_MODES]; map m_iNumSongsPlayedByStyle; int m_iNumSongsPlayedByDifficulty[NUM_DIFFICULTIES];