Dayz Explorer 1.28.160049
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;
11 int NUM_OF_BITS;
12 bool m_IsClientOnly = false;
14
15 PluginPlayerStatus m_ModulePlayerStatus;
16
18 {
19 m_System = "VirtualHud";
20 m_ModulePlayerStatus = PluginPlayerStatus.Cast(GetPlugin(PluginPlayerStatus));
21 m_Player = player;
22 //SetMaxValue();
23 }
24
25 //for elements which get their value client side and can be updated much more quickly
26 bool IsClientOnly()
27 {
28 return m_IsClientOnly;
29 }
30
31 bool IsValueChanged()
32 {
33 return !(m_Value == m_ValueLast);
34 }
35
36 void UpdateHUD()
37 {
38 m_ValueLast = m_Value;
39 }
40
41 int GetNumberOfBits()
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 {
51 m_Range = range;
52 }
53 }
54
55 int GetValue()
56 {
57 return m_Value;
58 }
59
60 int BitToDec(int mask, int index, int length)
61 {
62 int value = mask & (GetCompareMask() << index);
63 value = value >> index;
64 return value;
65 }
66
67 int GetCompareMask()
68 {
69 int mask = Math.Pow(2, GetNumberOfBits() ) - 1;
70 return mask;
71 }
72
73 int GetType()
74 {
75 return m_Type;
76 }
77
78 int TranslateLevelToStatus(int level)
79 {
80 if( level == DSLevels.WARNING )
81 return 2;
82 if( level == DSLevels.CRITICAL )
83 return 3;
84 if( level == DSLevels.BLINKING )
85 return 4;
86 if( level == DSLevels.EXTRA )
87 return 5;
88 return 1;
89 }
90}
eBleedingSourceType m_Type
eBleedingSourceType GetType()
Definition enmath.c:7
DSLevels
int BitToDec(int mask, int index, int compareMask)
string m_Key
Definition enentity.c:807
string m_Value
Definition enentity.c:808
DayZPlayer m_Player
Definition hand_events.c:42
string m_System
the manager instance
PluginPlayerStatus m_ModulePlayerStatus
max 32 synced modifiers supported, 0 == no sync
override void SetValue(int value, bool fire_event=true)
PluginBase GetPlugin(typename plugin_type)
vector m_Pos
float GetValue()
Definition syncedvalue.c:55