summaryrefslogtreecommitdiff
path: root/game/client/tf/vgui/tf_playerpanel.h
blob: 96bc3abce4bde2420ac332f2b7cb12808a0a5e9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================

#ifndef TF_PLAYERPANEL_H
#define TF_PLAYERPANEL_H
#ifdef _WIN32
#pragma once
#endif

#include "tf_spectatorgui.h"

//-----------------------------------------------------------------------------
// Purpose: Custom health panel used to show spectator target's health in Tournament HUD
//-----------------------------------------------------------------------------
class CTFPlayerPanelGUIHealth : public CTFSpectatorGUIHealth
{
public:
	CTFPlayerPanelGUIHealth( Panel *parent, const char *name ) : CTFSpectatorGUIHealth( parent, name )
	{
	}

	virtual const char *GetResFilename( void ) 
	{ 
		return "resource/UI/SpectatorTournamentGUIHealth.res"; 
	}
};

//-----------------------------------------------------------------------------
// Purpose: A panel representing a player, shown in tournament mode Spec GUI
//-----------------------------------------------------------------------------
class CTFPlayerPanel : public vgui::EditablePanel
{
	DECLARE_CLASS_SIMPLE( CTFPlayerPanel, vgui::EditablePanel );
public:
	CTFPlayerPanel( vgui::Panel *parent, const char *name );

	virtual void	Reset( void );
	virtual void	ApplySchemeSettings( vgui::IScheme *pScheme );

	virtual bool	Update( void );
	void	SetPlayerIndex( int iIndex );
	int		GetPlayerIndex( void ) { return m_iPlayerIndex; }
	void	Setup( int iPlayerIndex, CSteamID steamID, const char *pszPlayerName, int nLobbyTeam = TEAM_INVALID );
	void	SetSpecIndex( int iIndex );
	int		GetSpecIndex( void ) { return m_iSpecIndex; }
	virtual void	UpdateBorder( void );
	int		GetTeam( void );

	inline	CSteamID GetSteamID() const { return m_steamID; }

protected:
	int						m_iPlayerIndex;
	CUtlString				m_sPlayerName;
	CSteamID				m_steamID;
	int						m_iSpecIndex;
	CTFClassImage			*m_pClassImage;
	CTFPlayerPanelGUIHealth	*m_pHealthIcon;
	int						m_iPrevHealth;
	bool					m_bPrevAlive;
	int						m_iPrevClass;
	int						m_iPrevRespawnWait;
	int						m_iPrevCharge;
	vgui::ScalableImagePanel		*m_pReadyBG;
	vgui::ImagePanel				*m_pReadyImage;

	// Ready state
	bool					m_bPrevReady;
	int						m_iPrevState;
	bool					m_bPlayerReadyModeActive;
	int						m_nGCTeam;
};



#endif // TF_PLAYERPANEL_H