Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TF_MAPINFOMENU_H
  8. #define TF_MAPINFOMENU_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/Frame.h>
  13. #include "vgui_controls/KeyRepeat.h"
  14. //-----------------------------------------------------------------------------
  15. // Purpose: displays the MapInfo menu
  16. //-----------------------------------------------------------------------------
  17. class CTFMapInfoMenu : public vgui::Frame, public IViewPortPanel
  18. {
  19. private:
  20. DECLARE_CLASS_SIMPLE( CTFMapInfoMenu, vgui::Frame );
  21. public:
  22. CTFMapInfoMenu( IViewPort *pViewPort );
  23. virtual ~CTFMapInfoMenu();
  24. virtual const char *GetName( void ){ return PANEL_MAPINFO; }
  25. virtual void SetData( KeyValues *data ){}
  26. virtual void Reset(){ Update(); }
  27. virtual void Update();
  28. virtual bool NeedsUpdate( void ){ return false; }
  29. virtual bool HasInputElements( void ){ return true; }
  30. virtual void ShowPanel( bool bShow );
  31. // both vgui::Frame and IViewPortPanel define these, so explicitly define them here as passthroughs to vgui
  32. vgui::VPANEL GetVPanel( void ){ return BaseClass::GetVPanel(); }
  33. virtual bool IsVisible(){ return BaseClass::IsVisible(); }
  34. virtual void SetParent( vgui::VPANEL parent ){ BaseClass::SetParent( parent ); }
  35. virtual GameActionSet_t GetPreferredActionSet() { return GAME_ACTION_SET_IN_GAME_HUD; }
  36. protected:
  37. virtual void OnKeyCodePressed(vgui::KeyCode code);
  38. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  39. virtual void OnCommand( const char *command );
  40. virtual void OnKeyCodeReleased( vgui::KeyCode code );
  41. virtual void OnThink();
  42. private:
  43. // helper functions
  44. void LoadMapPage();
  45. void SetMapTitle();
  46. bool HasViewedMovieForMap();
  47. bool CheckForIntroMovie();
  48. void CheckIntroState();
  49. void CheckBackContinueButtons();
  50. protected:
  51. IViewPort *m_pViewPort;
  52. CExLabel *m_pTitle;
  53. CExRichText *m_pMapInfo;
  54. #ifdef _X360
  55. CTFFooter *m_pFooter;
  56. #else
  57. CExButton *m_pContinue;
  58. CExButton *m_pBack;
  59. CExButton *m_pIntro;
  60. CSCHintIcon *m_pContinueHintIcon;
  61. CSCHintIcon *m_pBackHintIcon;
  62. CSCHintIcon *m_pIntroHintIcon;
  63. #endif
  64. vgui::ImagePanel *m_pMapImage;
  65. char m_szMapName[MAX_PATH];
  66. vgui::CKeyRepeatHandler m_KeyRepeat;
  67. };
  68. #endif // TF_MAPINFOMENU_H