Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
NotificationSystem Class Reference

Protected Member Functions

void NotificationSystem ()
NotificationData GetNotificationData (NotificationType type)

Static Protected Member Functions

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 CleanupInstance ()
static NotificationSystem GetInstance ()
static void InitInstance ()
static void LoadNotificationData ()
static void SendNotificationToPlayer (Man player, NotificationType type, float show_time, string detail_text="")
 Send notification from default types to player from server.
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 SendNotificationToPlayerIdentity (PlayerIdentity player, NotificationType type, float show_time, string detail_text="")
 Send notification from default types to player identity 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 Update (float timeslice)

Protected Attributes

ref map< NotificationType, ref NotificationDatam_DataArray
ref array< ref NotificationRuntimeDatam_DeferredArray
ref ScriptInvoker m_OnNotificationAdded = new ScriptInvoker()
ref ScriptInvoker m_OnNotificationRemoved = new ScriptInvoker()
ref array< ref NotificationRuntimeDatam_TimeArray
float m_TimeElapsed

Static Protected Attributes

static const string JSON_FILE_PATH = "scripts/data/notifications.json"
static ref NotificationSystem m_Instance
static const int MAX_NOTIFICATIONS = 5

Private Attributes

const int DEFAULT_TIME_DISPLAYED = 10
const float NOTIFICATION_FADE_TIME = 3.0

Static Private Attributes

static const float UPDATE_INTERVAL_THRESHOLD = 1.0

Detailed Description

Definition at line 69 of file notificationsystem.c.

Constructor & Destructor Documentation

◆ NotificationSystem()

void NotificationSystem ( )
inlineprotected

Definition at line 109 of file notificationsystem.c.

References m_DeferredArray, m_TimeArray, and m_TimeElapsed.

Referenced by GetInstance(), and InitInstance().

Member Function Documentation

◆ AddNotification()

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

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

Definition at line 192 of file notificationsystem.c.

References m_Instance, MAX_NOTIFICATIONS, and NotificationRuntimeData().

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

◆ AddNotificationExtended()

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

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

Definition at line 215 of file notificationsystem.c.

References m_Instance, MAX_NOTIFICATIONS, and NotificationRuntimeData().

Referenced by CGame::OnRPC().

◆ CleanupInstance()

void CleanupInstance ( )
inlinestaticprotected

Definition at line 99 of file notificationsystem.c.

References m_Instance.

Referenced by CGame::~DayZGame().

◆ GetInstance()

NotificationSystem GetInstance ( )
inlinestaticprotected

◆ GetNotificationData()

NotificationData GetNotificationData ( NotificationType type)
inlineprotected

Definition at line 272 of file notificationsystem.c.

References m_DataArray.

◆ InitInstance()

void InitInstance ( )
inlinestaticprotected

Definition at line 90 of file notificationsystem.c.

References NotificationSystem(), and m_Instance.

Referenced by CGame::InitNotifications().

◆ LoadNotificationData()

void LoadNotificationData ( )
inlinestaticprotected

Definition at line 280 of file notificationsystem.c.

References ErrorEx, JSON_FILE_PATH, and m_Instance.

◆ SendNotificationToPlayer()

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

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

Definition at line 160 of file notificationsystem.c.

References SendNotificationToPlayerIdentity().

◆ SendNotificationToPlayerExtended()

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

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

Definition at line 125 of file notificationsystem.c.

References SendNotificationToPlayerIdentityExtended().

◆ SendNotificationToPlayerIdentity()

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

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

Definition at line 175 of file notificationsystem.c.

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

Referenced by SendNotificationToPlayer().

◆ SendNotificationToPlayerIdentityExtended()

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

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

Definition at line 141 of file notificationsystem.c.

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

Referenced by SendNotificationToPlayerExtended().

◆ Update()

void Update ( float timeslice)
inlinestaticprotected

Field Documentation

◆ DEFAULT_TIME_DISPLAYED

◆ JSON_FILE_PATH

const string JSON_FILE_PATH = "scripts/data/notifications.json"
staticprotected

Definition at line 74 of file notificationsystem.c.

Referenced by LoadNotificationData().

◆ m_DataArray

ref map<NotificationType, ref NotificationData> m_DataArray
protected

Definition at line 83 of file notificationsystem.c.

Referenced by GetNotificationData().

◆ m_DeferredArray

ref array<ref NotificationRuntimeData> m_DeferredArray
protected

Definition at line 82 of file notificationsystem.c.

Referenced by NotificationSystem().

◆ m_Instance

◆ m_OnNotificationAdded

ref ScriptInvoker m_OnNotificationAdded = new ScriptInvoker()
protected

◆ m_OnNotificationRemoved

ref ScriptInvoker m_OnNotificationRemoved = new ScriptInvoker()
protected

◆ m_TimeArray

ref array<ref NotificationRuntimeData> m_TimeArray
protected

Definition at line 81 of file notificationsystem.c.

Referenced by NotificationSystem().

◆ m_TimeElapsed

float m_TimeElapsed
protected

Definition at line 85 of file notificationsystem.c.

Referenced by NotificationSystem().

◆ MAX_NOTIFICATIONS

const int MAX_NOTIFICATIONS = 5
staticprotected

Definition at line 75 of file notificationsystem.c.

Referenced by AddNotification(), and AddNotificationExtended().

◆ NOTIFICATION_FADE_TIME

const float NOTIFICATION_FADE_TIME = 3.0
private

Definition at line 72 of file notificationsystem.c.

Referenced by NotificationUI::Update().

◆ UPDATE_INTERVAL_THRESHOLD

const float UPDATE_INTERVAL_THRESHOLD = 1.0
staticprivate

Definition at line 77 of file notificationsystem.c.

Referenced by Update().


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