summaryrefslogtreecommitdiff
path: root/game/client/tf/c_tf_notification.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 /game/client/tf/c_tf_notification.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/tf/c_tf_notification.h')
-rw-r--r--game/client/tf/c_tf_notification.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/game/client/tf/c_tf_notification.h b/game/client/tf/c_tf_notification.h
new file mode 100644
index 0000000..95e94e8
--- /dev/null
+++ b/game/client/tf/c_tf_notification.h
@@ -0,0 +1,72 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Interface for the client to acknowledge/view notifications sent from the GC
+//
+// $NoKeywords: $
+//=============================================================================
+
+#ifndef C_TF_NOTIFICATIONS_H
+#define C_TF_NOTIFICATIONS_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "econ/econ_notifications.h"
+#include "tf_notification.h"
+
+
+class CClientNotification : public CEconNotification
+{
+ friend class CTFSupportNotificationDialog;
+public:
+ CClientNotification();
+ virtual ~CClientNotification() OVERRIDE;
+
+ virtual EType NotificationType() OVERRIDE;
+ virtual void Deleted() OVERRIDE;
+ virtual void Expired() OVERRIDE;
+ virtual void Trigger() OVERRIDE;
+
+ virtual bool BHighPriority() OVERRIDE;
+
+ // Should show up on the main menu only -- these go away on dismissal
+ virtual bool BShowInGameElements() const OVERRIDE { return false; }
+
+ void Update( const CTFNotification* notification );
+ uint64 NotificationID() const { return m_ulNotificationID; }
+
+private:
+ void OnDialogAcknowledged();
+ void GCAcknowledge();
+
+ uint64 m_ulNotificationID;
+ uint32 m_unAccountID;
+ // m_pText sometimes points to a static string we don't own, so this guy owns any text that we do.
+ CUtlString m_strText;
+
+ // Is this a support message? If so, the user must trigger the notification to view the message in a pop-up before they can dismiss.
+ bool m_bSupportMessage;
+
+};
+
+class CAutobalanceVolunteerNotification : public CEconNotification
+{
+public:
+ CAutobalanceVolunteerNotification() : CEconNotification() {}
+
+ virtual ~CAutobalanceVolunteerNotification() OVERRIDE {}
+
+ virtual bool BShowInGameElements() const OVERRIDE { return true; }
+ virtual EType NotificationType() OVERRIDE { return eType_AcceptDecline; }
+
+ virtual void Accept() OVERRIDE { SendResponse( true ); }
+ virtual void Decline() OVERRIDE { SendResponse( false ); }
+ virtual void Expired() OVERRIDE { Decline(); }
+
+ static bool IsNotificationType( CEconNotification *pNotification ) { return dynamic_cast<CAutobalanceVolunteerNotification *>( pNotification ) != NULL; }
+
+private:
+ void SendResponse( bool bResponse );
+};
+
+#endif // C_TF_NOTIFICATIONS_H