PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
NotificationSystem Class Reference

Private Member Functions

void NotificationSystem ()
 
protected NotificationData GetNotificationData (NotificationType type)
 

Static Private Member Functions

static void InitInstance ()
 
static void CleanupInstance ()
 
static NotificationSystem GetInstance ()
 
static void SendNotificationToPlayerExtended (Man player, float show_time, string title_text, string detail_text="", string icon="")
 Send custom notification to player from server.
 
static void SendNotificationToPlayerIdentityExtended (PlayerIdentity player, float show_time, string title_text, string detail_text="", string icon="")
 Send custom notification to player identity from server.
 
static void SendNotificationToPlayer (Man player, NotificationType type, float show_time, string detail_text="")
 Send notification from default types to player from server.
 
static void SendNotificationToPlayerIdentity (PlayerIdentity player, NotificationType type, float show_time, string detail_text="")
 Send notification from default types to player identity from server.
 
static void AddNotification (NotificationType type, float show_time, string detail_text="")
 Send notification from default types to local player.
 
static void AddNotificationExtended (float show_time, string title_text, string detail_text="", string icon="")
 Send custom notification from to local player.
 
static void Update (float timeslice)
 
static void LoadNotificationData ()
 

Private Attributes

const int DEFAULT_TIME_DISPLAYED = 10
 
const float NOTIFICATION_FADE_TIME = 3.0
 
protected ref array< ref NotificationRuntimeDatam_TimeArray
 
protected ref array< ref NotificationRuntimeDatam_DeferredArray
 
protected ref map< NotificationType, ref NotificationDatam_DataArray
 
protected float m_TimeElapsed
 
ref ScriptInvoker m_OnNotificationAdded = new ScriptInvoker()
 
ref ScriptInvoker m_OnNotificationRemoved = new ScriptInvoker()
 

Static Private Attributes

static protected const string JSON_FILE_PATH = "scripts/data/notifications.json"
 
static protected const int MAX_NOTIFICATIONS = 5
 
static private const float UPDATE_INTERVAL_THRESHOLD = 1.0
 
static protected ref NotificationSystem m_Instance
 

Constructor & Destructor Documentation

◆ NotificationSystem()

void NotificationSystem ( )
inlineprivate

References m_DeferredArray, m_TimeArray, and m_TimeElapsed.

Referenced by InitInstance().

Member Function Documentation

◆ AddNotification()

static void AddNotification ( NotificationType  type,
float  show_time,
string  detail_text = "" 
)
inlinestaticprivate

Send notification from default types to local player.

Parameters
typethe type of notification to send - these can be viewed in /Scripts/Data/Notifications.json
show_timeamount of time this notification is displayed
detail_textadditional text that can be added to the notification under the title - will not display additional text if not set

References GetNotificationData(), ScriptInvoker::Invoke(), m_DeferredArray, m_Instance, m_OnNotificationAdded, m_TimeArray, MAX_NOTIFICATIONS, and NotificationRuntimeData().

Referenced by CGame::DisconnectSessionEx(), OnlineServices::OnFriendsAsync(), BiosSessionService::OnGetGameplaySession(), CGame::OnRPC(), and BiosUserManager::SelectUserEx().

◆ AddNotificationExtended()

static void AddNotificationExtended ( float  show_time,
string  title_text,
string  detail_text = "",
string  icon = "" 
)
inlinestaticprivate

Send custom notification from to local player.

Parameters
show_timeamount of time this notification is displayed
title_textthe title text that is displayed in the notification
detail_textadditional text that can be added to the notification under the title - will not display additional text if not set
iconthe icon that is displayed in the notification - will use default icon if not set

References ScriptInvoker::Invoke(), m_DeferredArray, m_Instance, m_OnNotificationAdded, m_TimeArray, MAX_NOTIFICATIONS, and NotificationRuntimeData().

Referenced by CGame::OnRPC().

◆ CleanupInstance()

static void CleanupInstance ( )
inlinestaticprivate

References m_Instance.

Referenced by CGame::~DayZGame().

◆ GetInstance()

static NotificationSystem GetInstance ( )
inlinestaticprivate

◆ GetNotificationData()

protected NotificationData GetNotificationData ( NotificationType  type)
inlineprivate

References m_DataArray.

Referenced by AddNotification().

◆ InitInstance()

static void InitInstance ( )
inlinestaticprivate

◆ LoadNotificationData()

static void LoadNotificationData ( )
inlinestaticprivate

References ErrorEx, JSON_FILE_PATH, m_DataArray, and m_Instance.

Referenced by InitInstance().

◆ SendNotificationToPlayer()

static void SendNotificationToPlayer ( Man  player,
NotificationType  type,
float  show_time,
string  detail_text = "" 
)
inlinestaticprivate

Send notification from default types to player from server.

Parameters
playerthe target player to send notification to
typethe type of notification to send - these can be viewed in /Scripts/Data/Notifications.json
show_timeamount of time this notification is displayed
detail_textadditional text that can be added to the notification under the title - will not display additional text if not set

References SendNotificationToPlayerIdentity().

◆ SendNotificationToPlayerExtended()

static void SendNotificationToPlayerExtended ( Man  player,
float  show_time,
string  title_text,
string  detail_text = "",
string  icon = "" 
)
inlinestaticprivate

Send custom notification to player from server.

Parameters
playerthe target player to send notification to
show_timeamount of time this notification is displayed
title_textthe title text that is displayed in the notification
detail_textadditional text that can be added to the notification under the title - will not display additional text if not set
iconthe icon that is displayed in the notification - will use default icon if not set

References SendNotificationToPlayerIdentityExtended().

◆ SendNotificationToPlayerIdentity()

static void SendNotificationToPlayerIdentity ( PlayerIdentity  player,
NotificationType  type,
float  show_time,
string  detail_text = "" 
)
inlinestaticprivate

Send notification from default types to player identity from server.

Parameters
playerthe target player to send notification to - if null, will send to all players
typethe type of notification to send - these can be viewed in /Scripts/Data/Notifications.json
show_timeamount of time this notification is displayed
detail_textadditional text that can be added to the notification under the title - will not display additional text if not set

References ScriptRPC::Send(), and Serializer::Write().

Referenced by SendNotificationToPlayer().

◆ SendNotificationToPlayerIdentityExtended()

static void SendNotificationToPlayerIdentityExtended ( PlayerIdentity  player,
float  show_time,
string  title_text,
string  detail_text = "",
string  icon = "" 
)
inlinestaticprivate

Send custom notification to player identity from server.

Parameters
playerthe target player to send notification to - if null, will send to all players
show_timeamount of time this notification is displayed
title_textthe title text that is displayed in the notification
detail_textadditional text that can be added to the notification under the title - will not display additional text if not set
iconthe icon that is displayed in the notification - will use default icon if not set

References ScriptRPC::Send(), and Serializer::Write().

Referenced by SendNotificationToPlayerExtended().

◆ Update()

Field Documentation

◆ DEFAULT_TIME_DISPLAYED

◆ JSON_FILE_PATH

protected const string JSON_FILE_PATH = "scripts/data/notifications.json"
staticprivate

Referenced by LoadNotificationData().

◆ m_DataArray

protected ref map<NotificationType, ref NotificationData> m_DataArray
private

◆ m_DeferredArray

protected ref array<ref NotificationRuntimeData> m_DeferredArray
private

◆ m_Instance

◆ m_OnNotificationAdded

◆ m_OnNotificationRemoved

ref ScriptInvoker m_OnNotificationRemoved = new ScriptInvoker()
private

◆ m_TimeArray

protected ref array<ref NotificationRuntimeData> m_TimeArray
private

◆ m_TimeElapsed

protected float m_TimeElapsed
private

Referenced by NotificationSystem(), and Update().

◆ MAX_NOTIFICATIONS

protected const int MAX_NOTIFICATIONS = 5
staticprivate

◆ NOTIFICATION_FADE_TIME

const float NOTIFICATION_FADE_TIME = 3.0
private

Referenced by NotificationUI::Update().

◆ UPDATE_INTERVAL_THRESHOLD

private const float UPDATE_INTERVAL_THRESHOLD = 1.0
staticprivate

Referenced by Update().


The documentation for this class was generated from the following file: