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.

88 lines
2.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #if defined( REPLAY_ENABLED )
  8. #ifndef REPLAYBROWSER_MAIN_PANEL_H
  9. #define REPLAYBROWSER_MAIN_PANEL_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "vgui_controls/PropertyDialog.h"
  14. #include "replay/replayhandle.h"
  15. #include "GameEventListener.h"
  16. #include "replaybrowseritemmanager.h"
  17. //-----------------------------------------------------------------------------
  18. class CReplayBrowserBasePage;
  19. class CConfirmDeleteDialog;
  20. class CExButton;
  21. //-----------------------------------------------------------------------------
  22. class CReplayBrowserPanel : public vgui::PropertyDialog,
  23. public CGameEventListener
  24. {
  25. DECLARE_CLASS_SIMPLE( CReplayBrowserPanel, vgui::PropertyDialog );
  26. public:
  27. CReplayBrowserPanel( Panel *parent );
  28. virtual ~CReplayBrowserPanel();
  29. void OnSaveReplay( ReplayHandle_t hNewReplay );
  30. void OnDeleteReplay( ReplayHandle_t hDeletedReplay );
  31. void DeleteReplay( ReplayHandle_t hReplay );
  32. virtual void CleanupUIForReplayItem( ReplayItemHandle_t hReplay ); // After a replay has been deleted - deletes all UI (thumbnail, but maybe also row and/or collection as well)
  33. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  34. virtual void PerformLayout( void );
  35. virtual void OnCommand( const char *command );
  36. virtual void ShowPanel( bool bShow, ReplayHandle_t hReplayDetails = REPLAY_HANDLE_INVALID, int iPerformance = -1 );
  37. virtual void OnKeyCodeTyped(vgui::KeyCode code);
  38. virtual void OnKeyCodePressed(vgui::KeyCode code);
  39. virtual void FireGameEvent( IGameEvent *event );
  40. MESSAGE_FUNC_PARAMS( OnConfirmDelete, "ConfirmDlgResult", data );
  41. void AttemptToDeleteReplayItem( Panel *pHandler, ReplayItemHandle_t hReplayItem, IReplayItemManager *pItemManager, int iPerformance );
  42. CReplayBrowserBasePage *m_pReplaysPage;
  43. CConfirmDeleteDialog *m_pConfirmDeleteDialog;
  44. struct DeleteInfo_t
  45. {
  46. ReplayItemHandle_t m_hReplayItem;
  47. IReplayItemManager *m_pItemManager;
  48. vgui::VPANEL m_hHandler;
  49. int m_iPerformance;
  50. };
  51. DeleteInfo_t m_DeleteInfo;
  52. float GetTimeOpened( void ){ return m_flTimeOpened; }
  53. private:
  54. void ShowDeleteReplayDenialDlg();
  55. void ConfirmReplayItemDelete( Panel *pHandler, ReplayItemHandle_t hReplayItem, IReplayItemManager *pItemManager, int iPerformance );
  56. float m_flTimeOpened;
  57. };
  58. //-----------------------------------------------------------------------------
  59. CReplayBrowserPanel *ReplayUI_GetBrowserPanel();
  60. void ReplayUI_ReloadBrowser( ReplayHandle_t hReplay = REPLAY_HANDLE_INVALID, int iPerformance = -1 );
  61. void ReplayUI_CloseReplayBrowser();
  62. //-----------------------------------------------------------------------------
  63. #endif // REPLAYBROWSER_MAIN_PANEL_H
  64. #endif