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.

80 lines
2.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef REPLAYBROWSER_LISTPANEL_H
  5. #define REPLAYBROWSER_LISTPANEL_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. #include <game/client/iviewport.h>
  10. #include "vgui_controls/PropertyPage.h"
  11. #include "vgui_controls/Button.h"
  12. #include "vgui_controls/PanelListPanel.h"
  13. #include "vgui_controls/EditablePanel.h"
  14. #include "replaybrowseritemmanager.h"
  15. #include "replay/genericclassbased_replay.h"
  16. using namespace vgui;
  17. //-----------------------------------------------------------------------------
  18. // Forward declarations
  19. //-----------------------------------------------------------------------------
  20. class CBaseThumbnailCollection;
  21. class CReplayPreviewPanelBase;
  22. //-----------------------------------------------------------------------------
  23. // Purpose:
  24. //-----------------------------------------------------------------------------
  25. class CReplayBrowserThumbnail;
  26. class CExLabel;
  27. class CReplayListPanel : public PanelListPanel
  28. {
  29. DECLARE_CLASS_SIMPLE( CReplayListPanel, PanelListPanel );
  30. public:
  31. CReplayListPanel( Panel *pParent, const char *pName );
  32. ~CReplayListPanel();
  33. virtual void ApplySchemeSettings( IScheme *pScheme );
  34. virtual void PerformLayout();
  35. void AddReplayItem( ReplayItemHandle_t hItem );
  36. void CleanupUIForReplayItem( ReplayItemHandle_t hReplayItem );
  37. void AddReplaysToList();
  38. void RemoveCollection( CBaseThumbnailCollection *pCollection );
  39. virtual void OnTick();
  40. void OnItemPanelEntered( Panel *pPanel );
  41. void OnItemPanelExited( Panel *pPanel );
  42. void SetupBorderArrow( bool bLeft );
  43. void ClearPreviewPanel();
  44. void ApplyFilter( const wchar_t *pFilterText );
  45. protected:
  46. virtual void OnMouseWheeled(int delta);
  47. private:
  48. const IQueryableReplayItem *FindItem( ReplayItemHandle_t hItem, int *pItemManagerIndex );
  49. CBaseThumbnailCollection *FindOrAddReplayThumbnailCollection( const IQueryableReplayItem *pItem, IReplayItemManager *pItemManager );
  50. CReplayBrowserThumbnail *FindThumbnailAtCursor( int x, int y );
  51. bool PassesFilter( IQueryableReplayItem *pItem );
  52. CBaseThumbnailCollection *m_pReplaysCollection;
  53. CBaseThumbnailCollection *m_pMoviesCollection;
  54. CUtlVector< CBaseThumbnailCollection * > m_vecCollections;
  55. CReplayPreviewPanelBase *m_pPreviewPanel;
  56. Panel *m_pPrevHoverPanel;
  57. ImagePanel *m_pBorderArrowImg;
  58. int m_aBorderArrowDims[2];
  59. wchar_t m_wszFilter[256];
  60. };
  61. #endif // REPLAYBROWSER_LISTPANEL_H