Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
debugmonitor.c
Go to the documentation of this file.
2 {
3  private Widget m_WidgetRoot;
4  private TextWidget m_pWindowLabelText;
5  private TextListboxWidget m_pNamesListboxWidget;
6  private TextListboxWidget m_pValuesListboxWidget;
7  private MultilineTextWidget m_pModifiersMultiTextWidget;
8 
9  void DebugMonitor()
10  {
11  m_WidgetRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/debug/day_z_debug_monitor.layout");
12  m_WidgetRoot.Show(false);
13 
14  m_pWindowLabelText = TextWidget.Cast( m_WidgetRoot.FindAnyWidget("WindowLabel") );
15  m_pNamesListboxWidget = TextListboxWidget.Cast( m_WidgetRoot.FindAnyWidget("NamesListboxWidget") );
16  m_pValuesListboxWidget = TextListboxWidget.Cast( m_WidgetRoot.FindAnyWidget("ValuesListboxWidget") );
17  m_pModifiersMultiTextWidget = MultilineTextWidget.Cast( m_WidgetRoot.FindAnyWidget("ModifiersMultilineTextWidget") );
18  }
19 
20  void Init()
21  {
22  m_pNamesListboxWidget.AddItem("HEALTH:", NULL, 0);
23  m_pValuesListboxWidget.AddItem("", NULL, 0);
24 
25  m_pNamesListboxWidget.AddItem("BLOOD:", NULL, 0);
26  m_pValuesListboxWidget.AddItem("", NULL, 0);
27 
28  /*m_pNamesListboxWidget.AddItem("BODY TEMP:", NULL, 0);
29  m_pValuesListboxWidget.AddItem("", NULL, 0);*/
30 
31  m_pNamesListboxWidget.AddItem("LAST DAMAGE:", NULL, 0);
32  m_pValuesListboxWidget.AddItem("", NULL, 0);
33 
34  m_pNamesListboxWidget.AddItem("POSITION:", NULL, 0);
35  m_pValuesListboxWidget.AddItem("", NULL, 0);
36 
37  /*m_pNamesListboxWidget.AddItem("MODIFIERS:", NULL, 0);
38  m_pValuesListboxWidget.AddItem("", NULL, 0);*/
39 
40  //m_DebugFloatsListWidget.AddItem(key,NULL,0);
41  //m_DebugFloatsListWidget.SetItem(i,value.ToString(),NULL,1);
42 
43  m_WidgetRoot.Show(true);
44  }
45 
46  void SetHealth(float value)
47  {
48  string health = string.Format(" %1", value.ToString());
49  m_pValuesListboxWidget.SetItem(0, health, NULL, 0);
50  }
51 
52  void SetBlood(float value)
53  {
54  string blood = string.Format(" %1", value.ToString());
55  m_pValuesListboxWidget.SetItem(1, blood, NULL, 0);
56  }
57 
58  void SetLastDamage(string value)
59  {
60  string lastDamage = string.Format(" %1", value);
61  m_pValuesListboxWidget.SetItem(2, lastDamage, NULL, 0);
62  }
63 
64  void SetPosition(vector value)
65  {
66  string position = string.Format(" %1 %2 %3", value[0].ToString(), value[1].ToString(), value[2].ToString());
67  m_pValuesListboxWidget.SetItem(3, position, NULL, 0);
68  }
69 
70  void Show()
71  {
72  m_WidgetRoot.Show(true);
73  }
74 
75  void Hide()
76  {
77  m_WidgetRoot.Show(false);
78  }
79 };
80 
GetGame
proto native CGame GetGame()
DebugMonitor
Definition: debugmonitor.c:1
ToString
proto string ToString()
vector
Definition: enconvert.c:105
TextWidget
Definition: enwidgets.c:219
m_WidgetRoot
class DayZProfilesOptions m_WidgetRoot
Widget
Definition: enwidgets.c:189