Profile name cleanup
This commit is contained in:
+20
-20
@@ -71,13 +71,13 @@ void Profile::InitGeneralData()
|
||||
m_iTotalPlaySeconds = 0;
|
||||
m_iTotalGameplaySeconds = 0;
|
||||
m_iCurrentCombo = 0;
|
||||
m_fCaloriesBurned = 0;
|
||||
m_fTotalCaloriesBurned = 0;
|
||||
m_iTotalDancePoints = 0;
|
||||
m_iNumExtraStagesPassed = 0;
|
||||
m_iNumExtraStagesFailed = 0;
|
||||
m_iNumToasties = 0;
|
||||
m_UnlockedSongs.clear();
|
||||
m_sLastMachinePlayed = "";
|
||||
m_sLastPlayedMachineName = "";
|
||||
m_iTotalTapsAndHolds = 0;
|
||||
m_iTotalJumps = 0;
|
||||
m_iTotalHolds = 0;
|
||||
@@ -130,12 +130,12 @@ CString Profile::GetDisplayName() const
|
||||
return "NoName";
|
||||
}
|
||||
|
||||
CString Profile::GetDisplayCaloriesBurned() const
|
||||
CString Profile::GetDisplayTotalCaloriesBurned() const
|
||||
{
|
||||
if( m_fWeightPounds == 0 ) // weight not entered
|
||||
return "N/A";
|
||||
else
|
||||
return ssprintf("%0.3fCal",m_fCaloriesBurned);
|
||||
return ssprintf("%0.3fCal",m_fTotalCaloriesBurned);
|
||||
}
|
||||
|
||||
int Profile::GetTotalNumSongsPlayed() const
|
||||
@@ -392,7 +392,7 @@ bool Profile::LoadAllFromDir( CString sDir )
|
||||
|
||||
bool Profile::SaveAllToDir( CString sDir ) const
|
||||
{
|
||||
m_sLastMachinePlayed = PREFSMAN->m_sMachineName;
|
||||
m_sLastPlayedMachineName = PREFSMAN->m_sMachineName;
|
||||
|
||||
// Save editable.xml
|
||||
SaveEditableDataToDir( sDir );
|
||||
@@ -459,8 +459,8 @@ void Profile::LoadProfileDataFromDirSM390a12( CString sDir )
|
||||
ini.GetValue( "Profile", "TotalGameplaySeconds", m_iTotalGameplaySeconds );
|
||||
ini.GetValue( "Profile", "CurrentCombo", m_iCurrentCombo );
|
||||
ini.GetValue( "Profile", "WeightPounds", m_fWeightPounds );
|
||||
ini.GetValue( "Profile", "CaloriesBurned", m_fCaloriesBurned );
|
||||
ini.GetValue( "Profile", "LastMachinePlayed", m_sLastMachinePlayed );
|
||||
ini.GetValue( "Profile", "CaloriesBurned", m_fTotalCaloriesBurned );
|
||||
ini.GetValue( "Profile", "LastPlayedMachineName", m_sLastPlayedMachineName );
|
||||
|
||||
unsigned i;
|
||||
for( i=0; i<NUM_PLAY_MODES; i++ )
|
||||
@@ -497,17 +497,17 @@ XNode* Profile::SaveGeneralDataCreateNode() const
|
||||
pGeneralDataNode->AppendChild( "TotalPlaySeconds", m_iTotalPlaySeconds );
|
||||
pGeneralDataNode->AppendChild( "TotalGameplaySeconds", m_iTotalGameplaySeconds );
|
||||
pGeneralDataNode->AppendChild( "CurrentCombo", m_iCurrentCombo );
|
||||
pGeneralDataNode->AppendChild( "CaloriesBurned", m_fCaloriesBurned );
|
||||
pGeneralDataNode->AppendChild( "LastMachinePlayed", m_sLastMachinePlayed );
|
||||
pGeneralDataNode->AppendChild( "TotalCaloriesBurned", m_fTotalCaloriesBurned );
|
||||
pGeneralDataNode->AppendChild( "LastPlayedMachineName", m_sLastPlayedMachineName );
|
||||
pGeneralDataNode->AppendChild( "TotalDancePoints", m_iTotalDancePoints );
|
||||
pGeneralDataNode->AppendChild( "NumExtraStagesPassed", m_iNumExtraStagesPassed );
|
||||
pGeneralDataNode->AppendChild( "NumExtraStagesFailed", m_iNumExtraStagesFailed );
|
||||
pGeneralDataNode->AppendChild( "NumToasties", m_iNumToasties );
|
||||
pGeneralDataNode->AppendChild( "TotalTapsAndHolds", m_iTotalTapsAndHolds );
|
||||
pGeneralDataNode->AppendChild( "TotalJumps", m_iTotalJumps );
|
||||
pGeneralDataNode->AppendChild( "TotalHolds", m_iTotalHolds );
|
||||
pGeneralDataNode->AppendChild( "TotalMines", m_iTotalMines );
|
||||
pGeneralDataNode->AppendChild( "TotalHands", m_iTotalHands );
|
||||
pGeneralDataNode->AppendChild( "TotalJumps", m_iTotalJumps );
|
||||
pGeneralDataNode->AppendChild( "TotalHolds", m_iTotalHolds );
|
||||
pGeneralDataNode->AppendChild( "TotalMines", m_iTotalMines );
|
||||
pGeneralDataNode->AppendChild( "TotalHands", m_iTotalHands );
|
||||
|
||||
{
|
||||
XNode* pUnlockedSongs = pGeneralDataNode->AppendChild("UnlockedSongs");
|
||||
@@ -642,8 +642,8 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode )
|
||||
pNode->GetChildValue( "TotalPlaySeconds", m_iTotalPlaySeconds );
|
||||
pNode->GetChildValue( "TotalGameplaySeconds", m_iTotalGameplaySeconds );
|
||||
pNode->GetChildValue( "CurrentCombo", m_iCurrentCombo );
|
||||
pNode->GetChildValue( "CaloriesBurned", m_fCaloriesBurned );
|
||||
pNode->GetChildValue( "LastMachinePlayed", m_sLastMachinePlayed );
|
||||
pNode->GetChildValue( "TotalCaloriesBurned", m_fTotalCaloriesBurned );
|
||||
pNode->GetChildValue( "LastPlayedMachineName", m_sLastPlayedMachineName );
|
||||
pNode->GetChildValue( "TotalDancePoints", m_iTotalDancePoints );
|
||||
pNode->GetChildValue( "NumExtraStagesPassed", m_iNumExtraStagesPassed );
|
||||
pNode->GetChildValue( "NumExtraStagesFailed", m_iNumExtraStagesFailed );
|
||||
@@ -752,7 +752,7 @@ void Profile::AddStepTotals( int iTotalTapsAndHolds, int iTotalJumps, int iTotal
|
||||
SCALE( m_fWeightPounds, 100.f, 200.f, 0.029f, 0.052f ) * iTotalHolds +
|
||||
SCALE( m_fWeightPounds, 100.f, 200.f, 0.000f, 0.000f ) * iTotalMines +
|
||||
SCALE( m_fWeightPounds, 100.f, 200.f, 0.222f, 0.386f ) * iTotalHands;
|
||||
m_fCaloriesBurned += fCals;
|
||||
m_fTotalCaloriesBurned += fCals;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1420,7 +1420,7 @@ void Profile::LoadScreenshotDataFromNode( const XNode* pNode )
|
||||
if( !(*screenshot)->GetChildValue("Time",(int&)ss.time) ) // time_t is a signed long on Win32. Is this ok on other platforms?
|
||||
WARN;
|
||||
|
||||
if( !(*screenshot)->GetChildValue("Location",ss.sLocation) )
|
||||
if( !(*screenshot)->GetChildValue("MachineName",ss.sMachineName) )
|
||||
WARN;
|
||||
|
||||
m_vScreenshots.push_back( ss );
|
||||
@@ -1444,9 +1444,9 @@ XNode* Profile::SaveScreenshotDataCreateNode() const
|
||||
XNode* pScreenshotNode = pNode->AppendChild( "Screenshot" );
|
||||
|
||||
pScreenshotNode->AppendChild( "FileName", ss.sFileName );
|
||||
pScreenshotNode->AppendChild( "MD5", ss.sMD5);
|
||||
pScreenshotNode->AppendChild( "Time", (int) ss.time);
|
||||
pScreenshotNode->AppendChild( "Location", ss.sLocation);
|
||||
pScreenshotNode->AppendChild( "MD5", ss.sMD5 );
|
||||
pScreenshotNode->AppendChild( "Time", (int) ss.time );
|
||||
pScreenshotNode->AppendChild( "MachineName", ss.sMachineName );
|
||||
}
|
||||
|
||||
return pNode;
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
// smart accessors
|
||||
//
|
||||
CString GetDisplayName() const;
|
||||
CString GetDisplayCaloriesBurned() const;
|
||||
CString GetDisplayTotalCaloriesBurned() const;
|
||||
int GetTotalNumSongsPlayed() const;
|
||||
int GetTotalNumSongsPassed() const;
|
||||
static CString GetProfileDisplayNameFromDir( CString sDir );
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
int m_iTotalPlaySeconds;
|
||||
int m_iTotalGameplaySeconds;
|
||||
int m_iCurrentCombo;
|
||||
int m_fCaloriesBurned;
|
||||
int m_fTotalCaloriesBurned;
|
||||
int m_iTotalDancePoints;
|
||||
int m_iNumExtraStagesPassed;
|
||||
int m_iNumExtraStagesFailed;
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
int m_iTotalMines;
|
||||
int m_iTotalHands;
|
||||
set<int> m_UnlockedSongs;
|
||||
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
|
||||
mutable CString m_sLastPlayedMachineName; // 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];
|
||||
int m_iNumSongsPlayedByStyle[NUM_STYLES];
|
||||
int m_iNumSongsPlayedByDifficulty[NUM_DIFFICULTIES];
|
||||
@@ -162,10 +162,10 @@ public:
|
||||
//
|
||||
struct Screenshot
|
||||
{
|
||||
CString sFileName; // no directory part - just the file name
|
||||
CString sMD5; // MD5 hash of the screenshot file
|
||||
time_t time; // return value of time() when screenshot was taken
|
||||
CString sLocation; // location name where this screenshot was taken
|
||||
CString sFileName; // no directory part - just the file name
|
||||
CString sMD5; // MD5 hash of the screenshot file
|
||||
time_t time; // return value of time() when screenshot was taken
|
||||
CString sMachineName; // where this screenshot was taken
|
||||
};
|
||||
vector<Screenshot> m_vScreenshots;
|
||||
void AddScreenshot( Screenshot screenshot );
|
||||
|
||||
@@ -277,8 +277,8 @@ void PrintStatistics( RageFile &f, const Profile *pProfile, CString sTitle, vect
|
||||
TABLE_LINE2( "TotalPlay", SecondsToHHMMSS(pProfile->m_iTotalPlaySeconds) );
|
||||
TABLE_LINE2( "TotalGameplay", SecondsToHHMMSS(pProfile->m_iTotalGameplaySeconds) );
|
||||
TABLE_LINE2( "CurrentCombo", pProfile->m_iCurrentCombo );
|
||||
TABLE_LINE2( "CaloriesBurned", pProfile->GetDisplayCaloriesBurned() );
|
||||
TABLE_LINE2( "LastMachinePlayed", pProfile->m_sLastMachinePlayed );
|
||||
TABLE_LINE2( "TotalCaloriesBurned", pProfile->GetDisplayTotalCaloriesBurned() );
|
||||
TABLE_LINE2( "LastPlayedMachineName", pProfile->m_sLastPlayedMachineName );
|
||||
TABLE_LINE2( "TotalTapsAndHolds", pProfile->m_iTotalTapsAndHolds );
|
||||
TABLE_LINE2( "TotalJumps", pProfile->m_iTotalJumps );
|
||||
TABLE_LINE2( "TotalHolds", pProfile->m_iTotalHolds );
|
||||
@@ -916,7 +916,7 @@ void PrintScreenshot( RageFile &f, const Profile::Screenshot &ss )
|
||||
TABLE_LINE2( "File", ss.sFileName );
|
||||
TABLE_LINE2( "MD5", ss.sMD5 );
|
||||
TABLE_LINE2( "Time", (CString)ctime(&ss.time) );
|
||||
TABLE_LINE2( "Location", ss.sLocation );
|
||||
TABLE_LINE2( "MachineName", ss.sMachineName );
|
||||
|
||||
END_TABLE;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ CString GetStatsLineValue( PlayerNumber pn, int iLine )
|
||||
switch( iLine )
|
||||
{
|
||||
case 0:
|
||||
return pProfile->GetDisplayCaloriesBurned();
|
||||
return pProfile->GetDisplayTotalCaloriesBurned();
|
||||
case 1:
|
||||
return ssprintf( "%d", pProfile->GetTotalNumSongsPlayed() ); // fixme
|
||||
case 2:
|
||||
|
||||
@@ -1296,7 +1296,7 @@ void ScreenEvaluation::Input( const DeviceInput& DeviceI, const InputEventType t
|
||||
screenshot.sFileName = sFileName;
|
||||
screenshot.sMD5 = CRYPTMAN->GetMD5( sPath );
|
||||
screenshot.time = time(NULL);
|
||||
screenshot.sLocation = PREFSMAN->m_sMachineName;
|
||||
screenshot.sMachineName = PREFSMAN->m_sMachineName;
|
||||
pProfile->AddScreenshot( screenshot );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user