mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-10 02:39:35 +00:00
1
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user