diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/tf/vgui/tf_mapinfomenu.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/tf/vgui/tf_mapinfomenu.h')
| -rw-r--r-- | game/client/tf/vgui/tf_mapinfomenu.h | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/game/client/tf/vgui/tf_mapinfomenu.h b/game/client/tf/vgui/tf_mapinfomenu.h new file mode 100644 index 0000000..4f982ea --- /dev/null +++ b/game/client/tf/vgui/tf_mapinfomenu.h @@ -0,0 +1,85 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef TF_MAPINFOMENU_H +#define TF_MAPINFOMENU_H +#ifdef _WIN32 +#pragma once +#endif + +#include <vgui_controls/Frame.h> +#include "vgui_controls/KeyRepeat.h" + +//----------------------------------------------------------------------------- +// Purpose: displays the MapInfo menu +//----------------------------------------------------------------------------- + +class CTFMapInfoMenu : public vgui::Frame, public IViewPortPanel +{ +private: + DECLARE_CLASS_SIMPLE( CTFMapInfoMenu, vgui::Frame ); + +public: + CTFMapInfoMenu( IViewPort *pViewPort ); + virtual ~CTFMapInfoMenu(); + + virtual const char *GetName( void ){ return PANEL_MAPINFO; } + virtual void SetData( KeyValues *data ){} + virtual void Reset(){ Update(); } + virtual void Update(); + virtual bool NeedsUpdate( void ){ return false; } + virtual bool HasInputElements( void ){ return true; } + virtual void ShowPanel( bool bShow ); + + // both vgui::Frame and IViewPortPanel define these, so explicitly define them here as passthroughs to vgui + vgui::VPANEL GetVPanel( void ){ return BaseClass::GetVPanel(); } + virtual bool IsVisible(){ return BaseClass::IsVisible(); } + virtual void SetParent( vgui::VPANEL parent ){ BaseClass::SetParent( parent ); } + + virtual GameActionSet_t GetPreferredActionSet() { return GAME_ACTION_SET_IN_GAME_HUD; } + +protected: + virtual void OnKeyCodePressed(vgui::KeyCode code); + virtual void ApplySchemeSettings( vgui::IScheme *pScheme ); + virtual void OnCommand( const char *command ); + virtual void OnKeyCodeReleased( vgui::KeyCode code ); + virtual void OnThink(); + +private: + // helper functions + void LoadMapPage(); + void SetMapTitle(); + bool HasViewedMovieForMap(); + bool CheckForIntroMovie(); + void CheckIntroState(); + void CheckBackContinueButtons(); + +protected: + IViewPort *m_pViewPort; + CExLabel *m_pTitle; + CExRichText *m_pMapInfo; + +#ifdef _X360 + CTFFooter *m_pFooter; +#else + CExButton *m_pContinue; + CExButton *m_pBack; + CExButton *m_pIntro; + CSCHintIcon *m_pContinueHintIcon; + CSCHintIcon *m_pBackHintIcon; + CSCHintIcon *m_pIntroHintIcon; +#endif + + vgui::ImagePanel *m_pMapImage; + + char m_szMapName[MAX_PATH]; + + vgui::CKeyRepeatHandler m_KeyRepeat; +}; + + +#endif // TF_MAPINFOMENU_H |