summaryrefslogtreecommitdiff
path: root/public/panorama/uischeduleddel.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/panorama/uischeduleddel.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'public/panorama/uischeduleddel.h')
-rw-r--r--public/panorama/uischeduleddel.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/public/panorama/uischeduleddel.h b/public/panorama/uischeduleddel.h
new file mode 100644
index 0000000..2103c30
--- /dev/null
+++ b/public/panorama/uischeduleddel.h
@@ -0,0 +1,44 @@
+//=========== Copyright Valve Corporation, All rights reserved. ===============//
+//
+// Purpose:
+//=============================================================================//
+
+#ifndef UISCHEDULEDDEL_H
+#define UISCHEDULEDDEL_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "tier1/utldelegate.h"
+
+namespace panorama
+{
+
+
+// Panorama wrapper around CUtlSymbol which always creates symbol in panorama.dll module
+class CUIScheduledDel
+{
+public:
+ // constructor, destructor
+ CUIScheduledDel( CUtlDelegate< void() > del );
+ ~CUIScheduledDel();
+
+ void Schedule( double flSecondsToRunIn );
+
+ void Cancel();
+
+ bool BScheduled();
+
+ double GetSecondsUntilScheduled() { return MAX( m_flNextScheduled - UIEngine()->GetCurrentFrameTime(), 0.0 ); }
+
+private:
+
+ double m_flNextScheduled;
+ int m_iScheduledIndex;
+ CUtlDelegate< void() > m_del;
+};
+
+} // namespace panorama
+
+#endif // UISCHEDULEDDEL_H \ No newline at end of file