//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CTFStatPanel::CTFStatPanel( const char *pElementName )
	: EditablePanel( NULL, "StatPanel" ), CHudElement( pElementName )
{
	// Assert that all defined stats are in our prioritized list or explicitly unused
	Assert( ARRAYSIZE( g_statPriority ) + ARRAYSIZE( g_statUnused ) == TFSTAT_MAX );

	ResetDisplayedStat();
	m_bStatsChanged = false;
	m_bLocalFileTrusted = false;
	m_flTimeLastSpawn = 0;
	vgui::Panel *pParent = g_pClientMode->GetViewport();
	SetParent( pParent );
	m_bShouldBeVisible = false;
	SetScheme( "ClientScheme" );
	statPanel = this;
	m_bNeedToCalcMaxs = false;

	m_pClassImage = new CTFClassImage( this, "StatPanelClassImage" );
	m_iClassCurrentLife = TF_CLASS_UNDEFINED;
	m_iTeamCurrentLife = TEAM_UNASSIGNED;

	// Read stats from disk.  (Definitive stat store for X360; for PC, whatever we get from Steam is authoritative.)
	ReadStats();

	RegisterForRenderGroup( "mid" );
}
Beispiel #2
0
//=======================================================================================================================
//  CHudElement
//	All hud elements are derived from this class.
//=======================================================================================================================
//-----------------------------------------------------------------------------
// Purpose: Registers the hud element in a global list, in CHud
//-----------------------------------------------------------------------------
CHudElement::CHudElement( const char *pElementName )
{
	m_bActive = false;
	m_iHiddenBits = 0;
	m_pElementName = pElementName;
	SetNeedsRemove( false );
	m_bIsParentedToClientDLLRootPanel = false;

	// Make this for all hud elements, but when its a bit safer
#if defined( TF_CLIENT_DLL ) || defined( DOD_DLL )
	RegisterForRenderGroup( "global" );
#endif
}
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CTFWinPanel::CTFWinPanel( const char *pElementName ) : EditablePanel( NULL, "WinPanel" ), CHudElement( pElementName )
{
	vgui::Panel *pParent = g_pClientMode->GetViewport();
	SetParent( pParent );
	m_bShouldBeVisible = false;
	SetAlpha( 0 );
	SetScheme( "ClientScheme" );

	m_pTeamScorePanel = new EditablePanel( this, "TeamScoresPanel" );
	m_flTimeUpdateTeamScore = 0;
	m_iBlueTeamScore = 0;
	m_iRedTeamScore = 0;

	RegisterForRenderGroup( "mid" );
}
CHudChat::CHudChat( const char *pElementName ) : BaseClass( pElementName )
{
#if defined ( _X360 )
	RegisterForRenderGroup( "mid" );
#endif
}