mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-17 06:03:02 +00:00
1
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user