don't keep reloading PercentDisplay in ScreenNameEntryTraditional

This commit is contained in:
Chris Danford
2004-03-24 02:22:11 +00:00
parent 7bc830888b
commit 4e877f4f1c
6 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ void LifeMeterBattery::Load( PlayerNumber pn )
if( bPlayerEnabled ) if( bPlayerEnabled )
{ {
m_Percent.SetName( "LifeMeterBattery Percent" ); m_Percent.SetName( "LifeMeterBattery Percent" );
m_Percent.Load( pn, &g_CurStageStats ); m_Percent.Load( pn, &g_CurStageStats, true );
this->AddChild( &m_Percent ); this->AddChild( &m_Percent );
} }
+3 -1
View File
@@ -18,11 +18,12 @@ PercentageDisplay::PercentageDisplay()
m_pSource = NULL; m_pSource = NULL;
} }
void PercentageDisplay::Load( PlayerNumber pn, StageStats* pSource ) void PercentageDisplay::Load( PlayerNumber pn, StageStats* pSource, bool bAutoRefresh )
{ {
ASSERT( m_sName != "" ); // set this! ASSERT( m_sName != "" ); // set this!
m_PlayerNumber = pn; m_PlayerNumber = pn;
m_pSource = pSource; m_pSource = pSource;
m_bAutoRefresh = bAutoRefresh;
m_Last = -1; m_Last = -1;
if( PREFSMAN->m_bDancePointsForOni ) if( PREFSMAN->m_bDancePointsForOni )
@@ -57,6 +58,7 @@ void PercentageDisplay::Update( float fDeltaTime )
{ {
ActorFrame::Update( fDeltaTime ); ActorFrame::Update( fDeltaTime );
if( m_bAutoRefresh )
Refresh(); Refresh();
} }
+2 -1
View File
@@ -10,7 +10,7 @@ class PercentageDisplay: public ActorFrame
{ {
public: public:
PercentageDisplay(); PercentageDisplay();
void Load( PlayerNumber pn, StageStats *pSource ); void Load( PlayerNumber pn, StageStats *pSource, bool bAutoRefresh );
void Update( float fDeltaTime ); void Update( float fDeltaTime );
void TweenOffScreen(); void TweenOffScreen();
@@ -18,6 +18,7 @@ private:
void Refresh(); void Refresh();
PlayerNumber m_PlayerNumber; PlayerNumber m_PlayerNumber;
StageStats *m_pSource; StageStats *m_pSource;
bool m_bAutoRefresh;
int m_Last; int m_Last;
BitmapText m_textPercent; BitmapText m_textPercent;
BitmapText m_textPercentRemainder; BitmapText m_textPercentRemainder;
+1 -1
View File
@@ -15,5 +15,5 @@ ScoreDisplayPercentage::ScoreDisplayPercentage()
void ScoreDisplayPercentage::Init( PlayerNumber pn ) void ScoreDisplayPercentage::Init( PlayerNumber pn )
{ {
m_Percent.Load( pn, &g_CurStageStats ); m_Percent.Load( pn, &g_CurStageStats, true );
} }
+1 -1
View File
@@ -496,7 +496,7 @@ void ScreenEvaluation::Init()
/* Use "ScreenEvaluation Percent" for the [metric set], but position and /* Use "ScreenEvaluation Percent" for the [metric set], but position and
* tween it with "PercentP1X", etc. */ * tween it with "PercentP1X", etc. */
m_Percent[p].SetName( "ScreenEvaluation Percent" ); m_Percent[p].SetName( "ScreenEvaluation Percent" );
m_Percent[p].Load( (PlayerNumber) p, &g_CurStageStats ); m_Percent[p].Load( (PlayerNumber) p, &g_CurStageStats, true );
m_Percent[p].SetXY( THEME->GetMetricF(m_sName, ssprintf("PercentP%dX",p+1)), m_Percent[p].SetXY( THEME->GetMetricF(m_sName, ssprintf("PercentP%dX",p+1)),
THEME->GetMetricF(m_sName,ssprintf("PercentP%dY",p+1)) ); THEME->GetMetricF(m_sName,ssprintf("PercentP%dY",p+1)) );
m_Percent[p].Command( THEME->GetMetric(m_sName,ssprintf("PercentP%dOnCommand",p+1)) ); m_Percent[p].Command( THEME->GetMetric(m_sName,ssprintf("PercentP%dOnCommand",p+1)) );
+1 -1
View File
@@ -377,7 +377,7 @@ ScreenNameEntryTraditional::ScreenNameEntryTraditional( CString sClassName ) : S
this->AddChild( &m_FeatDisplay[p][i].m_Difficulty ); this->AddChild( &m_FeatDisplay[p][i].m_Difficulty );
m_FeatDisplay[p][i].m_textScore.SetName( "ScreenNameEntryTraditional Percent" ); m_FeatDisplay[p][i].m_textScore.SetName( "ScreenNameEntryTraditional Percent" );
m_FeatDisplay[p][i].m_textScore.Load( (PlayerNumber)p, &ss ); m_FeatDisplay[p][i].m_textScore.Load( (PlayerNumber)p, &ss, false );
m_FeatDisplay[p][i].m_textScore.SetName( ssprintf("ScoreP%i",p+1) ); m_FeatDisplay[p][i].m_textScore.SetName( ssprintf("ScoreP%i",p+1) );
SET_ON( m_FeatDisplay[p][i].m_textScore ); SET_ON( m_FeatDisplay[p][i].m_textScore );
this->AddChild( &m_FeatDisplay[p][i].m_textScore ); this->AddChild( &m_FeatDisplay[p][i].m_textScore );