summaryrefslogtreecommitdiff
path: root/game/client/tf2/vgui_healthbar.h
diff options
context:
space:
mode:
Diffstat (limited to 'game/client/tf2/vgui_healthbar.h')
-rw-r--r--game/client/tf2/vgui_healthbar.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/game/client/tf2/vgui_healthbar.h b/game/client/tf2/vgui_healthbar.h
new file mode 100644
index 0000000..4b68f26
--- /dev/null
+++ b/game/client/tf2/vgui_healthbar.h
@@ -0,0 +1,46 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $Workfile: $
+// $Date: $
+// $NoKeywords: $
+//=============================================================================//
+#ifndef VGUI_HEALTHBAR_H
+#define VGUI_HEALTHBAR_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include <vgui_controls/Panel.h>
+
+class KeyValues;
+
+class CHealthBarPanel : public vgui::Panel
+{
+public:
+ CHealthBarPanel( vgui::Panel *pParent = NULL );
+ virtual ~CHealthBarPanel( void );
+
+ // Setup
+ bool Init( KeyValues* pInitData );
+ void SetGoodColor( int r, int g, int b, int a );
+ void SetBadColor( int r, int g, int b, int a );
+ void SetVertical( bool bVertical );
+
+ // Health is expected to go from 0 to 1
+ void SetHealth( float health );
+
+ virtual void Paint( void );
+ virtual void PaintBackground( void ) {}
+
+private:
+ float m_Health;
+ Color m_Ok;
+ Color m_Bad;
+ bool m_bVertical; // True if this bar should be vertical
+};
+
+#endif // VGUI_HEALTHBAR_H \ No newline at end of file