summaryrefslogtreecommitdiff
path: root/game/client/dod/dod_hud_capturepanel.h
blob: 014236ca274cc5c411ab2b6830f4696b10de8d8a (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
79
80
81
82
83
84
85
86
87
88
89
90
91
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

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

//-----------------------------------------------------------------------------
// Purpose: Draws the progress bar
//-----------------------------------------------------------------------------
class CDoDCapturePanelProgressBar : public vgui::ImagePanel
{
public:
	DECLARE_CLASS_SIMPLE( CDoDCapturePanelProgressBar, vgui::ImagePanel );

	CDoDCapturePanelProgressBar( vgui::Panel *parent, const char *name );

	virtual void Paint();

	void SetPercentage( float flPercentage ){ m_flPercent = flPercentage; }

private:

	float	m_flPercent;
	int		m_iTexture;

	CPanelAnimationVar( Color, m_clrActive, "color_active", "HudCaptureProgressBar.Active" );
	CPanelAnimationVar( Color, m_clrInActive, "color_inactive", "HudCaptureProgressBar.InActive" );
};

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
class CDoDCapturePanelIcon : public vgui::ImagePanel
{
public:
	DECLARE_CLASS_SIMPLE( CDoDCapturePanelIcon, vgui::ImagePanel );

	CDoDCapturePanelIcon( vgui::Panel *parent, const char *name );

	virtual void Paint();

	void SetActive( bool state ){ m_bActive = state; }

private:

	bool	m_bActive;
	int		m_iTexture;

	CPanelAnimationVar( Color, m_clrActive, "color_active", "HudCaptureIcon.Active" );
	CPanelAnimationVar( Color, m_clrInActive, "color_inactive", "HudCaptureIcon.InActive" );
};

//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
class CDoDHudCapturePanel : public CHudElement, public vgui::EditablePanel
{
public:
	DECLARE_CLASS_SIMPLE( CDoDHudCapturePanel, vgui::EditablePanel );

	CDoDHudCapturePanel( const char *pElementName );

	virtual void OnThink();
	virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
	virtual void OnScreenSizeChanged( int iOldWide, int iOldTall );

private:
    
	CDoDCapturePanelProgressBar			*m_pProgressBar;

	CUtlVector<CDoDCapturePanelIcon *>	m_PlayerIcons;

	vgui::ImagePanel					*m_pAlliesFlag;
	vgui::ImagePanel					*m_pAxisFlag;
	vgui::ImagePanel					*m_pNeutralFlag;

	vgui::Label							*m_pMessage;

	vgui::Panel							*m_pBackground;

	CPanelAnimationVarAliasType( float, m_nSpaceBetweenIcons, "icon_space", "2", "proportional_float" );
};

#endif // DOD_HUD_CAPTUREPANEL_H