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.

39 lines
1.3 KiB

  1. #ifndef TF_ASYNCPANEL
  2. #define TF_ASYNCPANEL
  3. #include "vgui_controls/EditablePanel.h"
  4. using namespace vgui;
  5. //-----------------------------------------------------------------------------
  6. // Purpose:
  7. //-----------------------------------------------------------------------------
  8. class CBaseASyncPanel : public EditablePanel
  9. {
  10. DECLARE_CLASS_SIMPLE( CBaseASyncPanel, EditablePanel );
  11. public:
  12. CBaseASyncPanel( Panel *pParent, const char *pszPanelName );
  13. virtual ~CBaseASyncPanel() {}
  14. bool IsInitialized() const;
  15. void CheckForData();
  16. virtual void OnTick() OVERRIDE;
  17. virtual void ApplySchemeSettings( IScheme *pScheme ) OVERRIDE;
  18. virtual void PerformLayout() OVERRIDE;
  19. virtual void LoadControlSettings(const char *dialogResourceName, const char *pathID = NULL, KeyValues *pPreloadedKeyValues = NULL, KeyValues *pConditions = NULL) OVERRIDE;
  20. protected:
  21. virtual void OnChildSettingsApplied( KeyValues *pInResourceData, Panel *pChild ) OVERRIDE;
  22. private:
  23. void PresentDataIfReady();
  24. virtual bool CheckForData_Internal() = 0;
  25. bool m_bDataInitialized;
  26. bool m_bSettingsApplied;
  27. float m_flLastRequestTime;
  28. float m_flLastUpdatedTime;
  29. CUtlVector< PHandle > m_vecLoadingPanels;
  30. CUtlVector< PHandle > m_vecPanelsToShow;
  31. CPanelAnimationVar( float, m_flRefreshDelay, "refresh_delay", "-1.f" );
  32. };
  33. #endif //TF_ASYNCPANEL