Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
displayelementtendency.c
Go to the documentation of this file.
2 {
3  protected int TENDENCY_MASK = 7;// first x bits
4  protected int SERIOUSNESS_BIT_MASK = 7;// second x bits
5  protected int SERIOUSNESS_BIT_OFFSET = 3;//bit offset - points to where seriousness bit starts(TODO: get as log from mask)
6 
8  {
9  NUM_OF_BITS = 6;//the overall num of bits this element occupies(can be calculated from masks, better leave it explicit)
10  }
11 
12  void SetSeriousnessLevel( DSLevels level )
13  {
14  m_Value = (~(SERIOUSNESS_BIT_MASK << SERIOUSNESS_BIT_OFFSET)) & m_Value;//clear the last value
15  m_Value = (level << SERIOUSNESS_BIT_OFFSET) | m_Value;
16  }
17 
18  override void UpdateHUD()
19  {
20  super.UpdateHUD();
21  int seriousness = m_Value >> SERIOUSNESS_BIT_OFFSET;
22  int tendency = TENDENCY_MASK & m_Value;
23  //PrintString(tendency.ToString());
24 
25  if(tendency > 3)
26  {
27  tendency = -(tendency - 3);
28  }
29  /*
30  PrintString(this.ToString());
31  PrintString("ser:"+ seriousness.ToString());
32  PrintString("tnd:"+ tendency.ToString());
33  */
34  m_ModulePlayerStatus.DisplayTendency(m_Key, tendency, TranslateLevelToStatus(seriousness));
35  }
36 
37  void SetTendency(int tendency)
38  {
39  m_Value = (~TENDENCY_MASK) & m_Value;//clear the last value
40  m_Value = tendency | m_Value;//insert the new one
41  //PrintString(m_Value.ToString());
42  }
43 }
m_Key
string m_Key
Definition: enentity.c:4
m_Value
string m_Value
Definition: enentity.c:5
DisplayElementTendency
Definition: tendencybacteria.c:1
PlayerBase
Definition: playerbaseclient.c:1
DisplayElementBase
Definition: displayelementbadge.c:1
m_ModulePlayerStatus
PluginPlayerStatus m_ModulePlayerStatus
Definition: modifierbase.c:30
DSLevels
DSLevels
Definition: displaystatus.c:1