summaryrefslogtreecommitdiff
path: root/game/client/tf/vgui/tf_asyncpanel.h
diff options
context:
space:
mode:
Diffstat (limited to 'game/client/tf/vgui/tf_asyncpanel.h')
-rw-r--r--game/client/tf/vgui/tf_asyncpanel.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/game/client/tf/vgui/tf_asyncpanel.h b/game/client/tf/vgui/tf_asyncpanel.h
new file mode 100644
index 0000000..478c83f
--- /dev/null
+++ b/game/client/tf/vgui/tf_asyncpanel.h
@@ -0,0 +1,40 @@
+#ifndef TF_ASYNCPANEL
+#define TF_ASYNCPANEL
+
+#include "vgui_controls/EditablePanel.h"
+
+using namespace vgui;
+
+//-----------------------------------------------------------------------------
+// Purpose:
+//-----------------------------------------------------------------------------
+class CBaseASyncPanel : public EditablePanel
+{
+ DECLARE_CLASS_SIMPLE( CBaseASyncPanel, EditablePanel );
+public:
+ CBaseASyncPanel( Panel *pParent, const char *pszPanelName );
+ virtual ~CBaseASyncPanel() {}
+
+ bool IsInitialized() const;
+ void CheckForData();
+ virtual void OnTick() OVERRIDE;
+ virtual void ApplySchemeSettings( IScheme *pScheme ) OVERRIDE;
+ virtual void PerformLayout() OVERRIDE;
+ virtual void LoadControlSettings(const char *dialogResourceName, const char *pathID = NULL, KeyValues *pPreloadedKeyValues = NULL, KeyValues *pConditions = NULL) OVERRIDE;
+protected:
+ virtual void OnChildSettingsApplied( KeyValues *pInResourceData, Panel *pChild ) OVERRIDE;
+
+private:
+ void PresentDataIfReady();
+ virtual bool CheckForData_Internal() = 0;
+
+ bool m_bDataInitialized;
+ bool m_bSettingsApplied;
+ float m_flLastRequestTime;
+ float m_flLastUpdatedTime;
+ CUtlVector< PHandle > m_vecLoadingPanels;
+ CUtlVector< PHandle > m_vecPanelsToShow;
+ CPanelAnimationVar( float, m_flRefreshDelay, "refresh_delay", "-1.f" );
+};
+
+#endif //TF_ASYNCPANEL \ No newline at end of file