add LastPlayedDate

This commit is contained in:
Chris Danford
2004-07-18 21:54:19 +00:00
parent 7715553d35
commit 6a22aba2c0
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -89,6 +89,7 @@ void Profile::InitGeneralData()
m_iNumToasties = 0; m_iNumToasties = 0;
m_UnlockedSongs.clear(); m_UnlockedSongs.clear();
m_sLastPlayedMachineGuid = ""; m_sLastPlayedMachineGuid = "";
m_LastPlayedDate = DateTime::GetNowDate();
m_iTotalTapsAndHolds = 0; m_iTotalTapsAndHolds = 0;
m_iTotalJumps = 0; m_iTotalJumps = 0;
m_iTotalHolds = 0; m_iTotalHolds = 0;
@@ -642,6 +643,7 @@ bool Profile::LoadAllFromDir( CString sDir, bool bRequireSignature )
bool Profile::SaveAllToDir( CString sDir, bool bSignData ) const bool Profile::SaveAllToDir( CString sDir, bool bSignData ) const
{ {
m_sLastPlayedMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid; m_sLastPlayedMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid;
m_LastPlayedDate = DateTime::GetNowDate();
// Save editable.xml // Save editable.xml
SaveEditableDataToDir( sDir ); SaveEditableDataToDir( sDir );
@@ -736,6 +738,7 @@ XNode* Profile::SaveGeneralDataCreateNode() const
pGeneralDataNode->AppendChild( "CurrentCombo", m_iCurrentCombo ); pGeneralDataNode->AppendChild( "CurrentCombo", m_iCurrentCombo );
pGeneralDataNode->AppendChild( "TotalCaloriesBurned", m_fTotalCaloriesBurned ); pGeneralDataNode->AppendChild( "TotalCaloriesBurned", m_fTotalCaloriesBurned );
pGeneralDataNode->AppendChild( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid ); pGeneralDataNode->AppendChild( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid );
pGeneralDataNode->AppendChild( "LastPlayedDate", m_LastPlayedDate );
pGeneralDataNode->AppendChild( "TotalDancePoints", m_iTotalDancePoints ); pGeneralDataNode->AppendChild( "TotalDancePoints", m_iTotalDancePoints );
pGeneralDataNode->AppendChild( "NumExtraStagesPassed", m_iNumExtraStagesPassed ); pGeneralDataNode->AppendChild( "NumExtraStagesPassed", m_iNumExtraStagesPassed );
pGeneralDataNode->AppendChild( "NumExtraStagesFailed", m_iNumExtraStagesFailed ); pGeneralDataNode->AppendChild( "NumExtraStagesFailed", m_iNumExtraStagesFailed );
@@ -879,6 +882,7 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode )
pNode->GetChildValue( "CurrentCombo", m_iCurrentCombo ); pNode->GetChildValue( "CurrentCombo", m_iCurrentCombo );
pNode->GetChildValue( "TotalCaloriesBurned", m_fTotalCaloriesBurned ); pNode->GetChildValue( "TotalCaloriesBurned", m_fTotalCaloriesBurned );
pNode->GetChildValue( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid ); pNode->GetChildValue( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid );
pNode->GetChildValue( "LastPlayedDate", m_LastPlayedDate );
pNode->GetChildValue( "TotalDancePoints", m_iTotalDancePoints ); pNode->GetChildValue( "TotalDancePoints", m_iTotalDancePoints );
pNode->GetChildValue( "NumExtraStagesPassed", m_iNumExtraStagesPassed ); pNode->GetChildValue( "NumExtraStagesPassed", m_iNumExtraStagesPassed );
pNode->GetChildValue( "NumExtraStagesFailed", m_iNumExtraStagesFailed ); pNode->GetChildValue( "NumExtraStagesFailed", m_iNumExtraStagesFailed );
@@ -1323,7 +1327,7 @@ XNode* Profile::SaveCalorieDataCreateNode() const
{ {
XNode* pCaloriesBurned = pNode->AppendChild( "CaloriesBurned", i->second ); XNode* pCaloriesBurned = pNode->AppendChild( "CaloriesBurned", i->second );
pCaloriesBurned->AppendAttr( "Date", i->first.GetDateString() ); pCaloriesBurned->AppendAttr( "Date", i->first.GetString() );
} }
return pNode; return pNode;
+1
View File
@@ -107,6 +107,7 @@ public:
int m_iTotalHands; int m_iTotalHands;
set<int> m_UnlockedSongs; set<int> 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 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]; int m_iNumSongsPlayedByPlayMode[NUM_PLAY_MODES];
map<StyleID,int> m_iNumSongsPlayedByStyle; map<StyleID,int> m_iNumSongsPlayedByStyle;
int m_iNumSongsPlayedByDifficulty[NUM_DIFFICULTIES]; int m_iNumSongsPlayedByDifficulty[NUM_DIFFICULTIES];