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_PLAYERSTATUS_STAMINA_H
#define DOD_HUD_PLAYERSTATUS_STAMINA_H
#ifdef _WIN32
#pragma once
#endif
//-----------------------------------------------------------------------------
// Purpose: Stamina progress bar
//-----------------------------------------------------------------------------
class CDoDHudStaminaProgressBar : public vgui::Panel
{
DECLARE_CLASS_SIMPLE( CDoDHudStaminaProgressBar, vgui::Panel );
public:
CDoDHudStaminaProgressBar( vgui::Panel *parent, const char *name ) : vgui::Panel( parent, name ){}
virtual void Paint();
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
void SetPercentage( float flPercentage ){ m_flPercentage = flPercentage; }
private:
float m_flPercentage;
Color m_clrActive;
Color m_clrActiveLow;
Color m_clrInactive;
Color m_clrInactiveLow;
CPanelAnimationVarAliasType( float, m_flSliceWidth, "slice_width", "5", "proportional_float" );
CPanelAnimationVarAliasType( float, m_flSliceSpacer, "slice_spacer", "2", "proportional_float" );
CPanelAnimationVar( float, m_flWarningLevel, "warning_level", "0.25" );
};
//-----------------------------------------------------------------------------
// Purpose: Stamina icon
//-----------------------------------------------------------------------------
class CDoDHudStaminaIcon : public vgui::ImagePanel
{
DECLARE_CLASS_SIMPLE( CDoDHudStaminaIcon, vgui::ImagePanel );
public:
CDoDHudStaminaIcon( vgui::Panel *parent, const char *name );
virtual void Paint();
virtual void ApplySettings( KeyValues *inResourceData );
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
void SetPercentage( float flPercentage ){ m_flPercentage = flPercentage; }
private:
float m_flPercentage;
CHudTexture *m_icon;
CPanelAnimationVar( float, m_flWarningLevel, "warning_level", "0.25" );
char m_szIcon[128];
Color m_clrActive;
Color m_clrActiveLow;
};
//-----------------------------------------------------------------------------
// Purpose: Stamina panel
//-----------------------------------------------------------------------------
class CDoDHudStamina : public vgui::EditablePanel
{
DECLARE_CLASS_SIMPLE( CDoDHudStamina, vgui::EditablePanel );
public:
CDoDHudStamina( vgui::Panel *parent, const char *name );
virtual void OnThink();
virtual void OnScreenSizeChanged( int iOldWide, int iOldTall );
private:
CDoDCutEditablePanel *m_pBackground;
CDoDHudStaminaIcon *m_pIcon;
CDoDHudStaminaProgressBar *m_pProgressBar;
};
#endif // DOD_HUD_PLAYERSTATUS_STAMINA_H
|