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.

120 lines
3.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef REPLAYBROWSER_PREVIEWPANEL_H
  8. #define REPLAYBROWSER_PREVIEWPANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <game/client/iviewport.h>
  13. #include "vgui_controls/PropertyPage.h"
  14. #include "vgui_controls/Button.h"
  15. #include "vgui_controls/PanelListPanel.h"
  16. #include "vgui_controls/EditablePanel.h"
  17. #include "replaybrowseritemmanager.h"
  18. #include "replay/genericclassbased_replay.h"
  19. using namespace vgui;
  20. //-----------------------------------------------------------------------------
  21. // Forward declarations
  22. //-----------------------------------------------------------------------------
  23. class CExLabel;
  24. class CBaseThumbnailCollection;
  25. class CReplayDetailsPanel;
  26. class CReplayScreenshotSlideshowPanel;
  27. //-----------------------------------------------------------------------------
  28. // Purpose: Preview balloon
  29. //-----------------------------------------------------------------------------
  30. class CGenericClassBasedReplay;
  31. class CCrossfadableImagePanel;
  32. class CSlideshowPanel;
  33. class CReplayPreviewPanelBase : public EditablePanel
  34. {
  35. DECLARE_CLASS_SIMPLE( CReplayPreviewPanelBase, EditablePanel );
  36. public:
  37. CReplayPreviewPanelBase( Panel *pParent, QueryableReplayItemHandle_t hItem, IReplayItemManager *pItemManager );
  38. ~CReplayPreviewPanelBase();
  39. virtual void ApplySchemeSettings( IScheme *pScheme );
  40. virtual void PerformLayout();
  41. ReplayHandle_t GetReplayHandle();
  42. protected:
  43. CGenericClassBasedReplay *GetReplay();
  44. virtual bool ShoudlUseLargeClassImage() { return false; }
  45. virtual void LayoutView( int &nWide, int &nTall, int &nCurY );
  46. protected:
  47. IReplayItemManager *m_pItemManager;
  48. QueryableReplayItemHandle_t m_hItem;
  49. private:
  50. ImagePanel *m_pClassImage;
  51. vgui::EditablePanel *m_pInfoPanel;
  52. CExLabel *m_pMapLabel;
  53. CExLabel *m_pDateTimeLabel;
  54. enum ELabels
  55. {
  56. LABEL_PLAYED_AS,
  57. LABEL_KILLED_BY,
  58. LABEL_LIFE_LENGTH,
  59. NUM_INFO_LABELS
  60. };
  61. CExLabel *m_pReplayInfoLabels[NUM_INFO_LABELS][2];
  62. };
  63. //-----------------------------------------------------------------------------
  64. // Purpose: Preview balloon for slideshows (actual replays)
  65. //-----------------------------------------------------------------------------
  66. class CReplayPreviewPanelSlideshow : public CReplayPreviewPanelBase
  67. {
  68. DECLARE_CLASS_SIMPLE( CReplayPreviewPanelSlideshow, CReplayPreviewPanelBase );
  69. public:
  70. CReplayPreviewPanelSlideshow( Panel *pParent, QueryableReplayItemHandle_t hItem, IReplayItemManager *pItemManager );
  71. private:
  72. virtual void PerformLayout();
  73. virtual void LayoutView( int &nWide, int &nTall, int &nCurY );
  74. CReplayScreenshotSlideshowPanel *m_pScreenshotPanel;
  75. CExLabel *m_pNoScreenshotLabel;
  76. };
  77. //-----------------------------------------------------------------------------
  78. // Purpose: Preview balloon for movies (rendered replays)
  79. //-----------------------------------------------------------------------------
  80. class CMoviePlayerPanel;
  81. class IReplayMovie;
  82. class CReplayPreviewPanelMovie : public CReplayPreviewPanelBase
  83. {
  84. DECLARE_CLASS_SIMPLE( CReplayPreviewPanelMovie, CReplayPreviewPanelBase );
  85. public:
  86. CReplayPreviewPanelMovie( Panel *pParent, QueryableReplayItemHandle_t hItem, IReplayItemManager *pItemManager );
  87. ~CReplayPreviewPanelMovie();
  88. private:
  89. virtual void OnTick();
  90. virtual void LayoutView( int &nWide, int &nTall, int &nCurY );
  91. virtual IReplayMovie *GetReplayMovie();
  92. CMoviePlayerPanel *m_pMoviePlayerPanel;
  93. float m_flCreateTime;
  94. };
  95. #endif // REPLAYBROWSER_PREVIEWPANEL_H