AttackDisplay work

This commit is contained in:
Glenn Maynard
2003-12-28 21:48:43 +00:00
parent 5aa2a3dff4
commit 4ff430076c
2 changed files with 17 additions and 9 deletions
+15 -8
View File
@@ -13,8 +13,7 @@
#include "AttackDisplay.h"
#include "ThemeManager.h"
#include "GameState.h"
#define TEXT_ON_COMMAND( p ) THEME->GetMetric("AttackDisplay",ssprintf("TextP%dOnCommand",p+1))
#include "ActorUtil.h"
AttackDisplay::AttackDisplay()
@@ -23,11 +22,18 @@ AttackDisplay::AttackDisplay()
GAMESTATE->m_PlayMode != PLAY_MODE_RAVE )
return;
m_textAttack.SetName( ssprintf("TextP%d",m_PlayerNumber+1) );
m_textAttack.LoadFromFont( THEME->GetPathToF("AttackDisplay") );
m_textAttack.SetDiffuseAlpha( 0 ); // invisible
this->AddChild( &m_textAttack );
}
void AttackDisplay::Init( PlayerNumber pn )
{
m_PlayerNumber = pn;
}
void AttackDisplay::Update( float fDelta )
{
ActorFrame::Update( fDelta );
@@ -52,13 +58,14 @@ void AttackDisplay::Update( float fDelta )
if( GAMESTATE->m_ActiveAttacks[m_PlayerNumber][s].IsBlank() )
continue;
CString sText = GAMESTATE->m_ActiveAttacks[m_PlayerNumber][s].sModifier;
m_textAttack.SetDiffuseAlpha( 1 );
m_textAttack.SetText( sText );
m_textAttack.Command( TEXT_ON_COMMAND(m_PlayerNumber) );
SetAttack( GAMESTATE->m_ActiveAttacks[m_PlayerNumber][s].sModifier );
break;
}
}
void AttackDisplay::SetAttack( const CString &sText )
{
m_textAttack.SetDiffuseAlpha( 1 );
m_textAttack.SetText( sText );
UtilOnCommand( m_textAttack, "AttackDisplay" );
}
+2 -1
View File
@@ -23,7 +23,8 @@ class AttackDisplay : public ActorFrame
public:
AttackDisplay();
void Init( PlayerNumber pn ) { m_PlayerNumber = pn; }
void Init( PlayerNumber pn );
void SetAttack( const CString &mod );
virtual void Update( float fDelta );