show cumulative calorie number

This commit is contained in:
Chris Danford
2005-02-17 19:35:06 +00:00
parent f7c031ec3c
commit 25c88d3aa0
2 changed files with 12 additions and 2 deletions
+10 -2
View File
@@ -36,6 +36,8 @@ void ScoreDisplayCalories::LoadFromNode( const CString& sDir, const XNode* pNode
m_sMessageOnStep = ssprintf("StepP%d",m_PlayerNumber+1);
UpdateNumber();
MESSAGEMAN->Subscribe( this, m_sMessageOnStep );
}
@@ -43,13 +45,19 @@ void ScoreDisplayCalories::PlayCommand( const CString &sCommandName )
{
if( sCommandName == m_sMessageOnStep )
{
float fCals = STATSMAN->m_CurStageStats.m_player[m_PlayerNumber].fCaloriesBurned;
this->SetTargetNumber( fCals );
UpdateNumber();
}
RollingNumbers::PlayCommand( sCommandName );
}
void ScoreDisplayCalories::UpdateNumber()
{
float fCals = STATSMAN->m_CurStageStats.m_player[m_PlayerNumber].fCaloriesBurned;
fCals += STATSMAN->GetAccumStageStats().m_player[m_PlayerNumber].fCaloriesBurned;
SetTargetNumber( fCals );
}
/*
* (c) 2001-2004 Chris Danford
* All rights reserved.