//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ //=============================================================================// #include "cbase.h" #include "iclientmode.h" #include "hud.h" #include "hudelement.h" #include #include #include // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" using namespace vgui; //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- class CTFWaitingForPlayersPanel : public EditablePanel, public CHudElement { private: DECLARE_CLASS_SIMPLE( CTFWaitingForPlayersPanel, EditablePanel ); public: CTFWaitingForPlayersPanel( const char *pElementName ); virtual void LevelInit(); virtual void Init(); virtual void FireGameEvent( IGameEvent * event ); virtual void ApplySchemeSettings( IScheme *pScheme ); virtual bool ShouldDraw( void ); private: Label *m_pWaitingForPlayersLabel; Label *m_pWaitingForPlayersEndingLabel; }; DECLARE_HUDELEMENT_DEPTH( CTFWaitingForPlayersPanel, 1 ); //----------------------------------------------------------------------------- // Purpose: Constructor //----------------------------------------------------------------------------- CTFWaitingForPlayersPanel::CTFWaitingForPlayersPanel( const char *pElementName ) : EditablePanel( NULL, "WaitingForPlayersPanel" ), CHudElement( pElementName ) { Panel *pParent = g_pClientMode->GetViewport(); SetParent( pParent ); SetScheme( "ClientScheme" ); } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTFWaitingForPlayersPanel::LevelInit() { SetVisible( false ); } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTFWaitingForPlayersPanel::Init() { // listen for events ListenForGameEvent( "teamplay_waiting_begins" ); ListenForGameEvent( "teamplay_waiting_ends" ); ListenForGameEvent( "teamplay_waiting_abouttoend" ); SetVisible( false ); CHudElement::Init(); } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTFWaitingForPlayersPanel::ApplySchemeSettings( IScheme *pScheme ) { BaseClass::ApplySchemeSettings( pScheme ); LoadControlSettings( "resource/UI/WaitingForPlayersPanel.res" ); m_pWaitingForPlayersLabel = dynamic_cast