standardize element names

This commit is contained in:
Chris Danford
2008-03-19 11:38:14 +00:00
parent 2a90706887
commit 0cbbcebd39
4 changed files with 38 additions and 34 deletions
+20 -22
View File
@@ -20,8 +20,6 @@ static RString LIFE_PERCENT_CHANGE_NAME( size_t i ) { return "LifePercentChang
LifeMeterBar::LifeMeterBar()
{
METER_WIDTH.Load ("LifeMeterBar","MeterWidth");
METER_HEIGHT.Load ("LifeMeterBar","MeterHeight");
DANGER_THRESHOLD.Load ("LifeMeterBar","DangerThreshold");
INITIAL_VALUE.Load ("LifeMeterBar","InitialValue");
MIN_STAY_ALIVE.Load ("LifeMeterBar","MinStayAlive");
@@ -57,29 +55,29 @@ LifeMeterBar::LifeMeterBar()
// set up combotoregainlife
m_iComboToRegainLife = 0;
m_sprBackground.Load( THEME->GetPathG(sType,"background") );
m_sprBackground->SetName( "Background" );
m_sprBackground->ZoomToWidth( METER_WIDTH );
m_sprBackground->ZoomToHeight( METER_HEIGHT );
this->AddChild( m_sprBackground );
m_quadDangerGlow.ZoomToWidth( METER_WIDTH );
m_quadDangerGlow.ZoomToHeight( METER_HEIGHT );
m_quadDangerGlow.SetEffectDiffuseShift();
m_quadDangerGlow.SetEffectColor1( RageColor(1,0,0,0.8f) );
m_quadDangerGlow.SetEffectColor2( RageColor(1,0,0,0) );
m_quadDangerGlow.SetEffectClock( Actor::CLOCK_BGM_BEAT );
this->AddChild( &m_quadDangerGlow );
m_pStream = new StreamDisplay;
bool bExtra = GAMESTATE->IsAnExtraStage();
RString sExtra = bExtra ? "extra " : "";
m_sprUnder.Load( THEME->GetPathG(sType,sExtra+"Under") );
m_sprUnder->SetName( "Under" );
ActorUtil::LoadAllCommandsAndSetXY( m_sprUnder, sType );
this->AddChild( m_sprUnder );
m_sprDanger.Load( THEME->GetPathG(sType,sExtra+"Danger") );
m_sprDanger->SetName( "Danger" );
ActorUtil::LoadAllCommandsAndSetXY( m_sprDanger, sType );
this->AddChild( m_sprDanger );
m_pStream = new StreamDisplay;
m_pStream->Load( bExtra ? "StreamDisplayExtra" : "StreamDisplay" );
m_pStream->SetName( "Stream" );
ActorUtil::LoadAllCommandsAndSetXY( m_pStream, sType );
this->AddChild( m_pStream );
m_sprFrame.Load( THEME->GetPathG(sType,sExtra+"frame") );
m_sprFrame->SetName( "Frame" );
this->AddChild( m_sprFrame );
m_sprOver.Load( THEME->GetPathG(sType,sExtra+"Over") );
m_sprOver->SetName( "Over" );
ActorUtil::LoadAllCommandsAndSetXY( m_sprOver, sType );
this->AddChild( m_sprOver );
}
LifeMeterBar::~LifeMeterBar()
@@ -277,9 +275,9 @@ void LifeMeterBar::Update( float fDeltaTime )
m_pStream->SetHotAlpha( m_fHotAlpha );
if( m_pPlayerState->m_HealthState == HealthState_Danger )
m_quadDangerGlow.SetDiffuseAlpha( 1 );
m_sprDanger->SetVisible( true );
else
m_quadDangerGlow.SetDiffuseAlpha( 0 );
m_sprDanger->SetVisible( false );
}
+3 -5
View File
@@ -34,18 +34,16 @@ public:
// this function is solely for HowToPlay
private:
ThemeMetric<float> METER_WIDTH;
ThemeMetric<float> METER_HEIGHT;
ThemeMetric<float> DANGER_THRESHOLD;
ThemeMetric<float> INITIAL_VALUE;
ThemeMetric<TapNoteScore> MIN_STAY_ALIVE;
ThemeMetric1D<float> m_fLifePercentChange;
AutoActor m_sprBackground;
Quad m_quadDangerGlow;
AutoActor m_sprUnder;
AutoActor m_sprDanger;
StreamDisplay* m_pStream;
AutoActor m_sprFrame;
AutoActor m_sprOver;
float m_fLifePercentage;
+13 -5
View File
@@ -7,19 +7,27 @@
#include "PlayerState.h"
#include "StatsManager.h"
#include "CommonMetrics.h"
#include "ActorUtil.h"
ScoreDisplayNormal::ScoreDisplayNormal()
{
LOG->Trace( "ScoreDisplayNormal::ScoreDisplayNormal()" );
m_sprFrame.Load( THEME->GetPathG("ScoreDisplayNormal","frame") );
this->AddChild( &m_sprFrame );
RString sType = "ScoreDisplayNormal";
m_sprFrame.Load( THEME->GetPathG(sType,"Frame") );
m_sprFrame->SetName( "Frame" );
ActorUtil::LoadAllCommandsAndSetXY( m_sprFrame, sType );
this->AddChild( m_sprFrame );
// init the text
m_text.LoadFromFont( THEME->GetPathF("ScoreDisplayNormal","numbers") );
m_text.LoadFromFont( THEME->GetPathF("ScoreDisplayNormal","Text") );
m_text.SetName( "Text" );
m_text.SetShadowLength( 0 );
m_text.UpdateText();
ActorUtil::LoadAllCommandsAndSetXY( m_text, sType );
this->AddChild( &m_text );
}
@@ -28,9 +36,9 @@ void ScoreDisplayNormal::Init( const PlayerState* pPlayerState, const PlayerStag
ScoreDisplay::Init( pPlayerState, pPlayerStageStats );
// TODO: Remove use of PlayerNumber.
PlayerNumber pn = pPlayerState->m_PlayerNumber;
//PlayerNumber pn = pPlayerState->m_PlayerNumber;
m_text.RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(pn) );
//m_text.RunCommands( CommonMetrics::PLAYER_COLOR.GetValue(pn) );
}
void ScoreDisplayNormal::SetScore( int iNewScore )
+2 -2
View File
@@ -5,7 +5,7 @@
#include "ScoreDisplay.h"
#include "RollingNumbers.h"
#include "Sprite.h"
#include "AutoActor.h"
class ScoreDisplayNormal : public ScoreDisplay
{
@@ -18,7 +18,7 @@ public:
virtual void SetText( RString s ) { m_text.SetText(s); }
protected:
Sprite m_sprFrame;
AutoActor m_sprFrame;
RollingNumbers m_text;
};