//----------------------------------------------------------------------------- // Purpose: Attach the jetpack bar to the main panel //----------------------------------------------------------------------------- void CHudEMP::Init( void ) { if ( !m_pEMPIcon ) { m_pEMPIcon = materials->FindMaterial( "Hud/emp/emp_damage", TEXTURE_GROUP_VGUI ); assert( m_pEMPIcon ); m_pEMPIcon->IncrementReferenceCount(); m_pFrameVar = m_pEMPIcon->FindVar( "$frame", NULL, false ); m_nNumFrames = m_pEMPIcon->GetNumAnimationFrames(); } SetPos( HUDEMP_LEFT, HUDEMP_TOP ); SetSize( HUDEMP_WIDTH, HUDEMP_HEIGHT ); vgui::Panel *pParent = GetClientModeNormal()->GetViewport(); SetParent(pParent); }