DayZ 1.24
Loading...
Searching...
No Matches
DisplayElementBase.c
Go to the documentation of this file.
2{
3 int m_Value;
4 int m_ValueLast = -99999;
5 int m_Key = 0;
6 int m_Type = 0;
7 int m_Range = 0;
8 int m_Colors[7];
9 string m_Labels[7];
10 int m_Pos = 1;
12 bool m_IsClientOnly = false;
14
15 PluginPlayerStatus m_ModulePlayerStatus;
16
18 {
19 m_System = "VirtualHud";
20 m_ModulePlayerStatus = PluginPlayerStatus.Cast(GetPlugin(PluginPlayerStatus));
22 //SetMaxValue();
23 }
24
25 //for elements which get their value client side and can be updated much more quickly
27 {
28 return m_IsClientOnly;
29 }
30
32 {
33 return !(m_Value == m_ValueLast);
34 }
35
36 void UpdateHUD()
37 {
38 m_ValueLast = m_Value;
39 }
40
42 {
43 return NUM_OF_BITS;
44 }
45
46 void SetValue(int value, int range = 0)
47 {
48 m_Value = value;
49 if (range != 0)
50 m_Range = range;
51 }
52
54 {
55 return m_Value;
56 }
57
58 int BitToDec(int mask, int index, int length)
59 {
60 int value = mask & (GetCompareMask() << index);
61 value = value >> index;
62 return value;
63 }
64
66 {
67 int mask = Math.Pow(2, GetNumberOfBits()) - 1;
68 return mask;
69 }
70
71 int GetType()
72 {
73 return m_Type;
74 }
75
77 {
78 if (level == DSLevels.WARNING)
79 return 2;
80 if (level == DSLevels.CRITICAL)
81 return 3;
82 if (level == DSLevels.BLINKING)
83 return 4;
84 if (level == DSLevels.EXTRA)
85 return 5;
86 return 1;
87 }
88}
eBleedingSourceType m_Type
DSLevels
DayZPlayer m_Player
Definition Hand_Events.c:42
string m_System
PluginPlayerStatus m_ModulePlayerStatus
PluginBase GetPlugin(typename plugin_type)
vector m_Pos
Definition EnMath.c:7
int BitToDec(int mask, int index, int length)
void DisplayElementBase(PlayerBase player)
int TranslateLevelToStatus(int level)
PluginPlayerStatus m_ModulePlayerStatus
void SetValue(int value, int range=0)
string m_Key
Definition EnEntity.c:804
string m_Value
Definition EnEntity.c:805
static proto float Pow(float v, float power)
Return power of v ^ power.