summaryrefslogtreecommitdiff
path: root/game/client/tf2/hintitemorderbase.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/tf2/hintitemorderbase.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/tf2/hintitemorderbase.cpp')
-rw-r--r--game/client/tf2/hintitemorderbase.cpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/game/client/tf2/hintitemorderbase.cpp b/game/client/tf2/hintitemorderbase.cpp
new file mode 100644
index 0000000..6b3073d
--- /dev/null
+++ b/game/client/tf2/hintitemorderbase.cpp
@@ -0,0 +1,71 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+#include "cbase.h"
+#include "hintitemorderbase.h"
+#include "paneleffect.h"
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : *parent -
+// *panelName -
+//-----------------------------------------------------------------------------
+CHintItemOrderBase::CHintItemOrderBase( vgui::Panel *parent, const char *panelName )
+: BaseClass( parent, panelName )
+{
+ m_bEffects = false;
+ m_LineEffect = EFFECT_INVALID_HANDLE;
+ m_FlashEffect = EFFECT_INVALID_HANDLE;
+
+ DrawAxialLineToOrder();
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+void CHintItemOrderBase::DrawAxialLineToOrder( void )
+{
+ // Derived class already set up effects
+ if ( m_bEffects )
+ return;
+
+ m_bEffects = true;
+
+ // Flash for vote order
+ m_FlashEffect = CreateFlashEffect( this, NULL );
+ // Flash the hint panel itself
+ CreateFlashEffect( this, GetParent() );
+ // Point from hint to vote order panel
+ m_LineEffect = CreateAxialLineEffect( this, GetParent(), NULL );
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : *panel -
+//-----------------------------------------------------------------------------
+void CHintItemOrderBase::SetHintTarget( vgui::Panel *panel )
+{
+ BaseClass::SetHintTarget( panel );
+
+ if ( !m_bEffects )
+ return;
+
+ // Update effect target
+ if ( !panel || !g_pTF2RootPanel )
+ return;
+
+ CPanelEffect *e = g_pTF2RootPanel->FindEffect( m_LineEffect );
+ if ( e )
+ {
+ e->SetPanelOther( panel );
+ }
+
+ e = g_pTF2RootPanel->FindEffect( m_FlashEffect );
+ if ( e )
+ {
+ e->SetPanel( panel );
+ }
+} \ No newline at end of file