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.

84 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //----------------------------------------------------------------------------------------
  4. #ifndef REPLAYMESSAGEPANEL_H
  5. #define REPLAYMESSAGEPANEL_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. #include "vgui_controls/EditablePanel.h"
  10. using namespace vgui;
  11. //----------------------------------------------------------------------------------------
  12. // Purpose:
  13. //----------------------------------------------------------------------------------------
  14. extern ConVar replay_msgduration_startrecord;
  15. extern ConVar replay_msgduration_stoprecord;
  16. extern ConVar replay_msgduration_replaysavailable;
  17. extern ConVar replay_msgduration_error;
  18. extern ConVar replay_msgduration_misc;
  19. extern ConVar replay_msgduration_connectrecording;
  20. //----------------------------------------------------------------------------------------
  21. // Purpose: Forward declarations
  22. //----------------------------------------------------------------------------------------
  23. class CExLabel;
  24. class CExButton;
  25. class CReplayMessageDlg : public EditablePanel
  26. {
  27. DECLARE_CLASS_SIMPLE( CReplayMessageDlg, EditablePanel );
  28. public:
  29. CReplayMessageDlg( const char *pText );
  30. ~CReplayMessageDlg();
  31. virtual void ApplySchemeSettings( IScheme *pScheme );
  32. virtual void PerformLayout();
  33. virtual void OnKeyCodeTyped( KeyCode nCode );
  34. virtual void OnCommand( const char *pCommand );
  35. private:
  36. void Close();
  37. Panel *m_pDlg;
  38. CExLabel *m_pMsgLabel;
  39. CExButton *m_pOKButton;
  40. };
  41. //----------------------------------------------------------------------------------------
  42. // Purpose: A panel for display messages from the replay system during gameplay
  43. //----------------------------------------------------------------------------------------
  44. class CReplayMessagePanel : public EditablePanel
  45. {
  46. DECLARE_CLASS_SIMPLE( CReplayMessagePanel, EditablePanel );
  47. public:
  48. CReplayMessagePanel( const char *pLocalizeName, float flDuration, bool bUrgent );
  49. virtual ~CReplayMessagePanel();
  50. void Show();
  51. virtual void OnTick();
  52. static int InstanceCount();
  53. static void RemoveAll();
  54. private:
  55. virtual void ApplySchemeSettings( IScheme *pScheme );
  56. virtual void PerformLayout();
  57. CExLabel *m_pMessageLabel;
  58. CExLabel *m_pReplayLabel;
  59. ImagePanel *m_pIcon;
  60. float m_flShowStartTime;
  61. float m_flShowDuration;
  62. bool m_bUrgent;
  63. #if defined( TF_CLIENT_DLL )
  64. char m_szBorderName[ 64 ];
  65. #endif
  66. };
  67. #endif // REPLAYMESSAGEPANEL_H