working on Rave
This commit is contained in:
@@ -18,38 +18,41 @@
|
||||
#include "GameState.h"
|
||||
#include "ThemeManager.h"
|
||||
|
||||
|
||||
const float LEVEL_WIDTH = 50;
|
||||
|
||||
|
||||
ScoreDisplayRave::ScoreDisplayRave()
|
||||
{
|
||||
LOG->Trace( "ScoreDisplayRave::ScoreDisplayRave()" );
|
||||
|
||||
m_sprFrame.Load( THEME->GetPathToG("ScoreDisplayRave frame") );
|
||||
this->AddChild( &m_sprFrame );
|
||||
for( int i=0; i<NUM_ATTACK_LEVELS; i++ )
|
||||
{
|
||||
m_LevelStream[i].Load( THEME->GetPathToG(ssprintf("ScoreDisplayRave stream level%d",i+1)), LEVEL_WIDTH );
|
||||
float fSpan = (NUM_ATTACK_LEVELS-1)*LEVEL_WIDTH;
|
||||
float fX = SCALE(i,0.f,NUM_ATTACK_LEVELS-1.f, -fSpan/2, fSpan/2 );
|
||||
m_LevelStream[i].SetX( fX );
|
||||
this->AddChild( &m_LevelStream[i] );
|
||||
}
|
||||
|
||||
m_textCurrentAttack.LoadFromFont( THEME->GetPathToF("Common normal") );
|
||||
this->AddChild( &m_textCurrentAttack );
|
||||
this->AddChild( &m_sprFrame );
|
||||
}
|
||||
|
||||
void ScoreDisplayRave::Init( PlayerNumber pn )
|
||||
{
|
||||
ScoreDisplay::Init( pn );
|
||||
|
||||
m_sprFrame.Load( THEME->GetPathToG(ssprintf("ScoreDisplayRave frame p%d",pn+1)) );
|
||||
}
|
||||
|
||||
void ScoreDisplayRave::Update( float fDelta )
|
||||
{
|
||||
ScoreDisplay::Update( fDelta );
|
||||
|
||||
CString sNewAttack = GAMESTATE->m_ActiveAttacks[m_PlayerNumber][0].sModifier;
|
||||
|
||||
if( sNewAttack != m_sLastSeenAttack )
|
||||
for( int i=0; i<NUM_ATTACK_LEVELS; i++ )
|
||||
{
|
||||
m_textCurrentAttack.SetText( sNewAttack );
|
||||
m_textCurrentAttack.StopTweening();
|
||||
m_textCurrentAttack.Command( "diffuse,1,1,1,1;zoom,1;"
|
||||
"sleep,0.1;linear,0;diffusealpha,0;"
|
||||
"sleep,0.1;linear,0;diffusealpha,1;"
|
||||
"sleep,0.1;linear,0;diffusealpha,0;"
|
||||
"sleep,0.1;linear,0;diffusealpha,1;"
|
||||
"sleep,0.1;linear,0;diffusealpha,0;"
|
||||
"sleep,0.1;linear,0;diffusealpha,1;" );
|
||||
float fLevelPercent = GAMESTATE->m_fSuperMeter[m_PlayerNumber] - i;
|
||||
CLAMP( fLevelPercent, 0 ,1 );
|
||||
m_LevelStream[i].SetPercent( fLevelPercent );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user