summaryrefslogtreecommitdiff
path: root/game/client/train.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/train.cpp
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'game/client/train.cpp')
-rw-r--r--game/client/train.cpp113
1 files changed, 113 insertions, 0 deletions
diff --git a/game/client/train.cpp b/game/client/train.cpp
new file mode 100644
index 0000000..9e928e8
--- /dev/null
+++ b/game/client/train.cpp
@@ -0,0 +1,113 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+//
+// Train.cpp
+//
+// implementation of CHudAmmo class
+//
+#include "cbase.h"
+#include "hudelement.h"
+#include "hud_macros.h"
+#include "iclientmode.h"
+#include <vgui_controls/Controls.h>
+#include <vgui_controls/Panel.h>
+#include <vgui/ISurface.h>
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+using namespace vgui;
+
+class CHudTrain: public CHudElement, public vgui::Panel
+{
+ DECLARE_CLASS_SIMPLE( CHudTrain, vgui::Panel );
+public:
+ CHudTrain( const char *pElementName );
+ void Init( void );
+ void VidInit( void );
+ bool ShouldDraw( void );
+ virtual void ApplySchemeSettings( vgui::IScheme *scheme );
+ virtual void Paint( void );
+ void MsgFunc_Train(bf_read &msg);
+
+private:
+ int m_iPos;
+
+};
+
+//
+//-----------------------------------------------------
+//
+
+DECLARE_HUDELEMENT( CHudTrain );
+DECLARE_HUD_MESSAGE( CHudTrain, Train )
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+CHudTrain::CHudTrain( const char *pElementName ) :
+ CHudElement( pElementName ), BaseClass( NULL, "HudTrain" )
+{
+ vgui::Panel *pParent = g_pClientMode->GetViewport();
+ SetParent( pParent );
+
+ SetHiddenBits( HIDEHUD_MISCSTATUS );
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : *scheme -
+//-----------------------------------------------------------------------------
+void CHudTrain::ApplySchemeSettings( IScheme *scheme )
+{
+ BaseClass::ApplySchemeSettings( scheme );
+
+ SetPaintBackgroundEnabled( false );
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+void CHudTrain::Init(void)
+{
+ HOOK_HUD_MESSAGE( CHudTrain, Train );
+
+ m_iPos = 0;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+void CHudTrain::VidInit(void)
+{
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+bool CHudTrain::ShouldDraw( void )
+{
+ return ( CHudElement::ShouldDraw() && m_iPos );
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+void CHudTrain::Paint()
+{
+ // FIXME: Rewrite using vgui materials if we still do this type of train UI!!!
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+void CHudTrain::MsgFunc_Train( bf_read &msg )
+{
+ // update Train data
+ m_iPos = msg.ReadByte();
+}