DayZ 1.24
Loading...
Searching...
No Matches
NotifiersManager.c
Go to the documentation of this file.
24
25
27{
28 static const int MAX_COUNT = 64;
30 ref NotifierBase m_NotifiersStatic[MAX_COUNT];//introduced as a seperate array to allow for fast lookup, keeping the old one for quick looping through but also to keep modding compatibility
34 string m_System = "Notifiers";
35
45
46 void Init()
47 {
48 m_Notifiers.Insert(new HungerNotfr(this));
49 m_Notifiers.Insert(new ThirstNotfr(this));
50 m_Notifiers.Insert(new WarmthNotfr(this));
51 m_Notifiers.Insert(new WetnessNotfr(this));
52 m_Notifiers.Insert(new HealthNotfr(this));
53 m_Notifiers.Insert(new FeverNotfr(this));
54 m_Notifiers.Insert(new SickNotfr(this));
55 m_Notifiers.Insert(new StuffedNotfr(this));
56 m_Notifiers.Insert(new BloodNotfr(this));
57 m_Notifiers.Insert(new PillsNotfr(this));
58 m_Notifiers.Insert(new HeartbeatNotfr(this));
59 m_Notifiers.Insert(new FracturedLegNotfr(this));
60 m_Notifiers.Insert(new InjuredLegNotfr(this));
61
62 }
63
65 {
67 Error("out of bounds for notifier id: " + notifier_id);
68 else
70 }
71
73 {
74 return m_Player;
75 }
76
78 {
79 return m_VirtualHud;
80 }
81
83 {
84 return m_NotifiersStatic[type];
85 }
86
87 void ActivateByType(int notifier, bool triggerEvent = true)
88 {
90 }
91
92 void DeactivateByType(int notifier, bool triggerEvent = true)
93 {
95 }
96
98 {
99 if (!GetPlayer().IsPlayerSelected()) return;
100
102 }
103
105 {
106 int current_time = GetGame().GetTime();
107
109 {
110 if (notifier.IsActive() && notifier.IsTimeToTick(current_time))
111 notifier.OnTick(current_time);
112 }
113
114 }
115
116}
override Widget Init()
Definition DayZGame.c:120
void VirtualHud(PlayerBase player)
DayZPlayer m_Player
Definition Hand_Events.c:42
PlayerBase GetPlayer()
string m_System
void NotifiersManager(PlayerBase player)
ref VirtualHud m_VirtualHud
eNotifiers
@ NTF_HEALTHY
@ NTF_HEARTBEAT
@ NTF_BLOOD
@ NTF_THIRSTY
@ NTF_STAMINA
@ NTF_LEGS
@ NTF_FRACTURE
@ NTF_STUFFED
@ NTF_WETNESS
@ NTF_COUNT
@ NTF_PILLS
@ NTF_SICK
@ NTF_WARMTH
@ NTF_FEVERISH
@ NTF_LIVES
@ NTF_BLEEDISH
@ NTF_HUNGRY
void OnScheduledTick()
VirtualHud GetVirtualHud()
void TickNotifiers()
int m_MinTickTime
NotifierBase FindNotifier(int type)
enum eNotifiers MAX_COUNT
void DeactivateByType(int notifier, bool triggerEvent=true)
ref NotifierBase m_NotifiersStatic[MAX_COUNT]
ref array< ref NotifierBase > m_Notifiers
void RegisterItself(int notifier_id, NotifierBase modifier)
void ActivateByType(int notifier, bool triggerEvent=true)
void SetActive(bool state)
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
const int MIN_TICK_NOTIFIERS
Definition constants.c:341