DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс NotificationSystem

Защищенные члены

void NotificationSystem ()
 
NotificationData GetNotificationData (NotificationType type)
 

Защищенные статические члены

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 ()
 

Защищенные данные

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

Статические защищенные данные

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

Закрытые данные

const int DEFAULT_TIME_DISPLAYED = 10
 
const float NOTIFICATION_FADE_TIME = 3.0
 

Закрытые статические данные

static const float UPDATE_INTERVAL_THRESHOLD = 1.0
 

Подробное описание

Конструктор(ы)

◆ NotificationSystem()

void NotificationSystem ( )
inlineprotected
110 {
111 m_TimeElapsed = 0.0;
112
115 }
float m_TimeElapsed
Definition NotificationSystem.c:85
ref array< ref NotificationRuntimeData > m_TimeArray
Definition NotificationSystem.c:81
ref array< ref NotificationRuntimeData > m_DeferredArray
Definition NotificationSystem.c:82
Definition EntityAI.c:95

Перекрестные ссылки m_DeferredArray, m_TimeArray и m_TimeElapsed.

Используется в InitInstance().

Методы

◆ AddNotification()

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

Send notification from default types to local player.

Аргументы
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
193 {
194 if (m_Instance.m_TimeArray.Count() < MAX_NOTIFICATIONS)
195 {
197
198 m_Instance.m_TimeArray.Insert(data);
199 m_Instance.m_OnNotificationAdded.Invoke(data);
200 }
201 else
202 {
204 m_Instance.m_DeferredArray.Insert(dataDeferred);
205 }
206 }
void NotificationRuntimeData(float time, NotificationData data, string detail_text)
Definition NotificationSystem.c:23
static ref NotificationSystem m_Instance
Definition NotificationSystem.c:79
static const int MAX_NOTIFICATIONS
Definition NotificationSystem.c:75

Перекрестные ссылки m_Instance, MAX_NOTIFICATIONS и NotificationRuntimeData().

Используется в CGame::DisconnectSessionEx(), OnlineServices::OnFriendsAsync(), BiosSessionService::OnGetGameplaySession(), CGame::OnRPC() и BiosUserManager::SelectUserEx().

◆ AddNotificationExtended()

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

Send custom notification from to local player.

Аргументы
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
216 {
217 if (m_Instance.m_TimeArray.Count() < MAX_NOTIFICATIONS)
218 {
221
222 m_Instance.m_TimeArray.Insert(data);
223 m_Instance.m_OnNotificationAdded.Invoke(data);
224 }
225 else
226 {
229 m_Instance.m_DeferredArray.Insert(dataDeferred);
230 }
231 }
Definition NotificationData.c:2

Перекрестные ссылки m_Instance, MAX_NOTIFICATIONS и NotificationRuntimeData().

Используется в CGame::OnRPC().

◆ CleanupInstance()

static void CleanupInstance ( )
inlinestaticprotected
100 {
102 }

Перекрестные ссылки m_Instance.

Используется в CGame::~DayZGame().

◆ GetInstance()

static NotificationSystem GetInstance ( )
inlinestaticprotected
105 {
106 return m_Instance;
107 }

Перекрестные ссылки m_Instance.

Используется в NotificationUI::NotificationUI() и NotificationUI::~NotificationUI().

◆ GetNotificationData()

NotificationData GetNotificationData ( NotificationType type)
inlineprotected
273 {
274 if (m_DataArray.Contains(type))
275 return m_DataArray.Get(type);
276
277 return null;
278 }
ref map< NotificationType, ref NotificationData > m_DataArray
Definition NotificationSystem.c:83

Перекрестные ссылки m_DataArray.

◆ InitInstance()

static void InitInstance ( )
inlinestaticprotected
91 {
92 if (!m_Instance)
93 {
95 m_Instance.LoadNotificationData();
96 }
97 }
void NotificationSystem()
Definition NotificationSystem.c:109

Перекрестные ссылки m_Instance и NotificationSystem().

Используется в CGame::InitNotifications().

◆ LoadNotificationData()

static void LoadNotificationData ( )
inlinestaticprotected
281 {
284 string errorMessage;
287
288 m_Instance.m_DataArray.Copy(dataArray);
289
292 while (notificationType != NotificationType.NOTIFICATIONS_END)
293 {
296 }
297
298 for (int i = 0; i < m_Instance.m_DataArray.Count(); ++i)
299 {
300 notificationTypes.RemoveItem(m_Instance.m_DataArray.GetKey(i));
301 }
302
303 if (notificationTypes.Count() > 0)
304 {
306 {
308 "please_add_an_icon",
309 "please_add_a_title",
310 "optional_description",
311 );
312
313 m_Instance.m_DataArray.Insert(notificationType2, notificationData);
314 }
315
318 }
319 }
NotificationType
DEPRECATED (moved into NotificationSystem)
Definition NotificationSystem.c:4
static const string JSON_FILE_PATH
Definition NotificationSystem.c:74
enum ShapeType ErrorEx

Перекрестные ссылки ErrorEx, JSON_FILE_PATH и m_Instance.

◆ SendNotificationToPlayer()

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

Send notification from default types to player from server.

Аргументы
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
161 {
162 if (player)
163 {
165 }
166 }
static void SendNotificationToPlayerIdentity(PlayerIdentity player, NotificationType type, float show_time, string detail_text="")
Send notification from default types to player identity from server.
Definition NotificationSystem.c:175

Перекрестные ссылки SendNotificationToPlayerIdentity().

◆ SendNotificationToPlayerExtended()

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

Send custom notification to player from server.

Аргументы
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
126 {
127 if (player)
128 {
130 }
131 }
static void SendNotificationToPlayerIdentityExtended(PlayerIdentity player, float show_time, string title_text, string detail_text="", string icon="")
Send custom notification to player identity from server.
Definition NotificationSystem.c:141

Перекрестные ссылки SendNotificationToPlayerIdentityExtended().

◆ SendNotificationToPlayerIdentity()

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

Send notification from default types to player identity from server.

Аргументы
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
176 {
177 ScriptRPC rpc = new ScriptRPC();
178
179 rpc.Write(type);
180 rpc.Write(show_time);
181 rpc.Write(detail_text);
182
183 rpc.Send(null, ERPCs.RPC_SEND_NOTIFICATION, true, player);
184 }
ERPCs
Definition ERPCs.c:2
Definition gameplay.c:105

Используется в SendNotificationToPlayer().

◆ SendNotificationToPlayerIdentityExtended()

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

Send custom notification to player identity from server.

Аргументы
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
142 {
143 ScriptRPC rpc = new ScriptRPC();
144
145 rpc.Write(show_time);
146 rpc.Write(title_text);
147 rpc.Write(detail_text);
148 rpc.Write(icon);
149
150 rpc.Send(null, ERPCs.RPC_SEND_NOTIFICATION_EXTENDED, true, player);
151 }

Используется в SendNotificationToPlayerExtended().

◆ Update()

static void Update ( float timeslice)
inlinestaticprotected
234 {
235 if (m_Instance)
236 {
237 if (g_Game.GetGameState() != DayZGameState.IN_GAME && g_Game.GetGameState() != DayZGameState.MAIN_MENU)
238 return;
239
240 m_Instance.m_TimeElapsed += timeslice;
241 if (m_Instance.m_TimeElapsed >= UPDATE_INTERVAL_THRESHOLD)
242 {
245 {
246 if (visibleNotificationData.GetRemainingTime() <= 0.0)
248 else
250 }
251
253 {
254 m_Instance.m_OnNotificationRemoved.Invoke(expiredNotificationData);
255 m_Instance.m_TimeArray.RemoveItem(expiredNotificationData);
256
257 if (m_Instance.m_DeferredArray.Count() > 0)
258 {
259 int count = m_Instance.m_DeferredArray.Count();
261 m_Instance.m_TimeArray.Insert(deferredNotificationData);
262 m_Instance.m_OnNotificationAdded.Invoke(deferredNotificationData);
263 m_Instance.m_DeferredArray.Remove(count - 1);
264 }
265 }
266
267 m_Instance.m_TimeElapsed = 0;
268 }
269 }
270 }
DayZGame g_Game
Definition DayZGame.c:3815
static const float UPDATE_INTERVAL_THRESHOLD
Definition NotificationSystem.c:77

Перекрестные ссылки g_Game, m_Instance, NotificationRuntimeData() и UPDATE_INTERVAL_THRESHOLD.

Используется в CGame::OnUpdate().

Поля

◆ DEFAULT_TIME_DISPLAYED

◆ JSON_FILE_PATH

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

Используется в LoadNotificationData().

◆ m_DataArray

ref map<NotificationType, ref NotificationData> m_DataArray
protected

Используется в GetNotificationData().

◆ m_DeferredArray

ref array<ref NotificationRuntimeData> m_DeferredArray
protected

Используется в 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

Используется в NotificationSystem().

◆ m_TimeElapsed

float m_TimeElapsed
protected

Используется в NotificationSystem().

◆ MAX_NOTIFICATIONS

const int MAX_NOTIFICATIONS = 5
staticprotected

Используется в AddNotification() и AddNotificationExtended().

◆ NOTIFICATION_FADE_TIME

const float NOTIFICATION_FADE_TIME = 3.0
private

Используется в NotificationUI::Update().

◆ UPDATE_INTERVAL_THRESHOLD

const float UPDATE_INTERVAL_THRESHOLD = 1.0
staticprivate

Используется в Update().


Объявления и описания членов класса находятся в файле: