add GoalCalories
This commit is contained in:
@@ -50,6 +50,7 @@ void GameCommand::Init()
|
|||||||
m_vsScreensToPrepare.clear();
|
m_vsScreensToPrepare.clear();
|
||||||
m_bDeletePreparedScreens = false;
|
m_bDeletePreparedScreens = false;
|
||||||
m_iWeightPounds = -1;
|
m_iWeightPounds = -1;
|
||||||
|
m_iGoalCalories = -1;
|
||||||
m_iStopCourseAtSeconds = -1;
|
m_iStopCourseAtSeconds = -1;
|
||||||
|
|
||||||
m_bClearBookkeepingData = false;
|
m_bClearBookkeepingData = false;
|
||||||
@@ -125,6 +126,8 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const
|
|||||||
return false;
|
return false;
|
||||||
if( m_iWeightPounds != -1 && PROFILEMAN->IsUsingProfile(pn) && PROFILEMAN->GetProfile(pn)->m_iWeightPounds != m_iWeightPounds )
|
if( m_iWeightPounds != -1 && PROFILEMAN->IsUsingProfile(pn) && PROFILEMAN->GetProfile(pn)->m_iWeightPounds != m_iWeightPounds )
|
||||||
return false;
|
return false;
|
||||||
|
if( m_iGoalCalories != -1 && PROFILEMAN->IsUsingProfile(pn) && PROFILEMAN->GetProfile(pn)->m_iGoalCalories != m_iGoalCalories )
|
||||||
|
return false;
|
||||||
if( m_iStopCourseAtSeconds != -1 && GAMESTATE->m_iStopCourseAtSeconds != m_iStopCourseAtSeconds )
|
if( m_iStopCourseAtSeconds != -1 && GAMESTATE->m_iStopCourseAtSeconds != m_iStopCourseAtSeconds )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -304,6 +307,11 @@ void GameCommand::Load( int iIndex, const Commands& cmds )
|
|||||||
m_iWeightPounds = atoi( sValue );
|
m_iWeightPounds = atoi( sValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if( sName == "goalcalories" )
|
||||||
|
{
|
||||||
|
m_iGoalCalories = atoi( sValue );
|
||||||
|
}
|
||||||
|
|
||||||
else if( sName == "stopcourseatseconds" )
|
else if( sName == "stopcourseatseconds" )
|
||||||
{
|
{
|
||||||
m_iStopCourseAtSeconds = atoi( sValue );
|
m_iStopCourseAtSeconds = atoi( sValue );
|
||||||
@@ -644,6 +652,10 @@ void GameCommand::Apply( const vector<PlayerNumber> &vpns ) const
|
|||||||
FOREACH_CONST( PlayerNumber, vpns, pn )
|
FOREACH_CONST( PlayerNumber, vpns, pn )
|
||||||
if( PROFILEMAN->IsUsingProfile(*pn) )
|
if( PROFILEMAN->IsUsingProfile(*pn) )
|
||||||
PROFILEMAN->GetProfile(*pn)->m_iWeightPounds = m_iWeightPounds;
|
PROFILEMAN->GetProfile(*pn)->m_iWeightPounds = m_iWeightPounds;
|
||||||
|
if( m_iGoalCalories != -1 )
|
||||||
|
FOREACH_CONST( PlayerNumber, vpns, pn )
|
||||||
|
if( PROFILEMAN->IsUsingProfile(*pn) )
|
||||||
|
PROFILEMAN->GetProfile(*pn)->m_iGoalCalories = m_iGoalCalories;
|
||||||
if( m_iStopCourseAtSeconds != -1 )
|
if( m_iStopCourseAtSeconds != -1 )
|
||||||
GAMESTATE->m_iStopCourseAtSeconds = m_iStopCourseAtSeconds;
|
GAMESTATE->m_iStopCourseAtSeconds = m_iStopCourseAtSeconds;
|
||||||
|
|
||||||
@@ -787,6 +799,7 @@ bool GameCommand::IsZero() const
|
|||||||
!m_sSongGroup.empty() ||
|
!m_sSongGroup.empty() ||
|
||||||
m_SortOrder != SORT_INVALID ||
|
m_SortOrder != SORT_INVALID ||
|
||||||
m_iWeightPounds != -1 ||
|
m_iWeightPounds != -1 ||
|
||||||
|
m_iGoalCalories != -1 ||
|
||||||
m_iStopCourseAtSeconds != -1
|
m_iStopCourseAtSeconds != -1
|
||||||
)
|
)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ public:
|
|||||||
vector<CString> m_vsScreensToPrepare;
|
vector<CString> m_vsScreensToPrepare;
|
||||||
bool m_bDeletePreparedScreens;
|
bool m_bDeletePreparedScreens;
|
||||||
int m_iWeightPounds; // -1 == none specified
|
int m_iWeightPounds; // -1 == none specified
|
||||||
|
int m_iGoalCalories; // -1 == none specified
|
||||||
int m_iStopCourseAtSeconds; // -1 == none specified
|
int m_iStopCourseAtSeconds; // -1 == none specified
|
||||||
|
|
||||||
bool m_bClearBookkeepingData;
|
bool m_bClearBookkeepingData;
|
||||||
|
|||||||
+13
-10
@@ -77,6 +77,7 @@ void Profile::InitGeneralData()
|
|||||||
m_iTotalGameplaySeconds = 0;
|
m_iTotalGameplaySeconds = 0;
|
||||||
m_iCurrentCombo = 0;
|
m_iCurrentCombo = 0;
|
||||||
m_fTotalCaloriesBurned = 0;
|
m_fTotalCaloriesBurned = 0;
|
||||||
|
m_iGoalCalories = 0;
|
||||||
m_iTotalDancePoints = 0;
|
m_iTotalDancePoints = 0;
|
||||||
m_iNumExtraStagesPassed = 0;
|
m_iNumExtraStagesPassed = 0;
|
||||||
m_iNumExtraStagesFailed = 0;
|
m_iNumExtraStagesFailed = 0;
|
||||||
@@ -787,6 +788,7 @@ XNode* Profile::SaveGeneralDataCreateNode() const
|
|||||||
pGeneralDataNode->AppendChild( "TotalGameplaySeconds", m_iTotalGameplaySeconds );
|
pGeneralDataNode->AppendChild( "TotalGameplaySeconds", m_iTotalGameplaySeconds );
|
||||||
pGeneralDataNode->AppendChild( "CurrentCombo", m_iCurrentCombo );
|
pGeneralDataNode->AppendChild( "CurrentCombo", m_iCurrentCombo );
|
||||||
pGeneralDataNode->AppendChild( "TotalCaloriesBurned", m_fTotalCaloriesBurned );
|
pGeneralDataNode->AppendChild( "TotalCaloriesBurned", m_fTotalCaloriesBurned );
|
||||||
|
pGeneralDataNode->AppendChild( "GoalCalories", m_iGoalCalories );
|
||||||
pGeneralDataNode->AppendChild( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid );
|
pGeneralDataNode->AppendChild( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid );
|
||||||
pGeneralDataNode->AppendChild( "LastPlayedDate", m_LastPlayedDate );
|
pGeneralDataNode->AppendChild( "LastPlayedDate", m_LastPlayedDate );
|
||||||
pGeneralDataNode->AppendChild( "TotalDancePoints", m_iTotalDancePoints );
|
pGeneralDataNode->AppendChild( "TotalDancePoints", m_iTotalDancePoints );
|
||||||
@@ -862,16 +864,6 @@ XNode* Profile::SaveGeneralDataCreateNode() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
XNode* pNumStagesPassedByGrade = pGeneralDataNode->AppendChild("NumStagesPassedByGrade");
|
|
||||||
FOREACH_Grade( g )
|
|
||||||
{
|
|
||||||
if( !m_iNumStagesPassedByGrade[g] )
|
|
||||||
continue;
|
|
||||||
pNumStagesPassedByGrade->AppendChild( GradeToString(g), m_iNumStagesPassedByGrade[g] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
XNode* pNumStagesPassedByPlayMode = pGeneralDataNode->AppendChild("NumStagesPassedByPlayMode");
|
XNode* pNumStagesPassedByPlayMode = pGeneralDataNode->AppendChild("NumStagesPassedByPlayMode");
|
||||||
FOREACH_PlayMode( pm )
|
FOREACH_PlayMode( pm )
|
||||||
@@ -883,6 +875,16 @@ XNode* Profile::SaveGeneralDataCreateNode() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
XNode* pNumStagesPassedByGrade = pGeneralDataNode->AppendChild("NumStagesPassedByGrade");
|
||||||
|
FOREACH_Grade( g )
|
||||||
|
{
|
||||||
|
if( !m_iNumStagesPassedByGrade[g] )
|
||||||
|
continue;
|
||||||
|
pNumStagesPassedByGrade->AppendChild( GradeToString(g), m_iNumStagesPassedByGrade[g] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return pGeneralDataNode;
|
return pGeneralDataNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -936,6 +938,7 @@ void Profile::LoadGeneralDataFromNode( const XNode* pNode )
|
|||||||
pNode->GetChildValue( "TotalGameplaySeconds", m_iTotalGameplaySeconds );
|
pNode->GetChildValue( "TotalGameplaySeconds", m_iTotalGameplaySeconds );
|
||||||
pNode->GetChildValue( "CurrentCombo", m_iCurrentCombo );
|
pNode->GetChildValue( "CurrentCombo", m_iCurrentCombo );
|
||||||
pNode->GetChildValue( "TotalCaloriesBurned", m_fTotalCaloriesBurned );
|
pNode->GetChildValue( "TotalCaloriesBurned", m_fTotalCaloriesBurned );
|
||||||
|
pNode->GetChildValue( "GoalCalories", m_iGoalCalories );
|
||||||
pNode->GetChildValue( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid );
|
pNode->GetChildValue( "LastPlayedMachineGuid", m_sLastPlayedMachineGuid );
|
||||||
pNode->GetChildValue( "LastPlayedDate", m_LastPlayedDate );
|
pNode->GetChildValue( "LastPlayedDate", m_LastPlayedDate );
|
||||||
pNode->GetChildValue( "TotalDancePoints", m_iTotalDancePoints );
|
pNode->GetChildValue( "TotalDancePoints", m_iTotalDancePoints );
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public:
|
|||||||
//
|
//
|
||||||
CString m_sDisplayName;
|
CString m_sDisplayName;
|
||||||
CString m_sLastUsedHighScoreName; // this doesn't really belong in "editable", but we need it in the smaller editable file so that it can be ready quickly.
|
CString m_sLastUsedHighScoreName; // this doesn't really belong in "editable", but we need it in the smaller editable file so that it can be ready quickly.
|
||||||
int m_iWeightPounds; // 0 == invalid
|
int m_iWeightPounds; // 0 == not set
|
||||||
|
|
||||||
//
|
//
|
||||||
// General data
|
// General data
|
||||||
@@ -103,6 +103,7 @@ public:
|
|||||||
int m_iTotalGameplaySeconds;
|
int m_iTotalGameplaySeconds;
|
||||||
int m_iCurrentCombo;
|
int m_iCurrentCombo;
|
||||||
float m_fTotalCaloriesBurned;
|
float m_fTotalCaloriesBurned;
|
||||||
|
int m_iGoalCalories;
|
||||||
int m_iTotalDancePoints;
|
int m_iTotalDancePoints;
|
||||||
int m_iNumExtraStagesPassed;
|
int m_iNumExtraStagesPassed;
|
||||||
int m_iNumExtraStagesFailed;
|
int m_iNumExtraStagesFailed;
|
||||||
|
|||||||
Reference in New Issue
Block a user