5 private Widget m_WidgetRoot;
6 private TextWidget m_WindowLabelText;
8 private TextWidget m_VersionValue;
9 private TextWidget m_HealthValue;
10 private TextWidget m_BloodValue;
11 private TextWidget m_DmgSourceValue;
12 private TextWidget m_MapTileValue;
13 private TextWidget m_PositionValue;
14 private TextWidget m_CopyPositionInfo;
16 private TextWidget m_FPSValue;
17 private TextWidget m_FPSMinValue;
18 private TextWidget m_FPSMaxValue;
19 private TextWidget m_FPSAvgValue;
21 private int m_FPSTextDefaultColor;
25 m_WidgetRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/debug/day_z_debug_monitor.layout");
28 m_VersionValue = TextWidget.Cast(
m_WidgetRoot.FindAnyWidget(
"VersionValue"));
29 m_HealthValue = TextWidget.Cast(
m_WidgetRoot.FindAnyWidget(
"HealthValue"));
30 m_BloodValue = TextWidget.Cast(
m_WidgetRoot.FindAnyWidget(
"BloodValue"));
31 m_DmgSourceValue = TextWidget.Cast(
m_WidgetRoot.FindAnyWidget(
"DmgSourceValue"));
32 m_MapTileValue = TextWidget.Cast(
m_WidgetRoot.FindAnyWidget(
"MapTileValue"));
33 m_PositionValue = TextWidget.Cast(
m_WidgetRoot.FindAnyWidget(
"PositionValue"));
34 m_CopyPositionInfo = TextWidget.Cast(
m_WidgetRoot.FindAnyWidget(
"CopyPositionInfo"));
36 m_FPSValue = TextWidget.Cast(
m_WidgetRoot.FindAnyWidget(
"FPSCurrentValue"));
37 m_FPSMinValue = TextWidget.Cast(
m_WidgetRoot.FindAnyWidget(
"FPSMinValue"));
38 m_FPSMaxValue = TextWidget.Cast(
m_WidgetRoot.FindAnyWidget(
"FPSMaxValue"));
39 m_FPSAvgValue = TextWidget.Cast(
m_WidgetRoot.FindAnyWidget(
"FPSAvgValue"));
41 m_FPSTextDefaultColor = m_FPSValue.GetColor();
47 g_Game.GetVersion(version);
48 m_VersionValue.SetText(
" " + version);
51 if (
GetGame().GetInput().IsKeyboardConnected())
57 void SetHealth(
float value)
59 string health =
string.Format(
" %1", value.ToString());
60 m_HealthValue.SetText(health);
63 void SetBlood(
float value)
65 string blood =
string.Format(
" %1", value.ToString());
66 m_BloodValue.SetText(blood);
69 void SetLastDamage(
string value)
72 m_DmgSourceValue.SetText(
" " + value);
74 m_DmgSourceValue.SetText(
" -");
80 void SetFramerate(
float current,
float min,
float max,
float avg)
97 #ifdef PLATFORM_CONSOLE
100 widget.SetColor(m_FPSTextDefaultColor);
102 widget.SetColor(0xFFFF8000);
108 widget.SetColor(m_FPSTextDefaultColor);
112 widget.SetColor(0xFFFF8000);
117 widget.SetTextFormat(
"%1",
Math.Round(value));
124 m_PositionValue.SetText(position);
126 if (
GetUApi().GetInputByID(UAUICopyDebugMonitorPos).LocalPress())
128 string adjusted = (value[0] + 200000).
ToString() +
" " + value[2].ToString();
129 GetGame().CopyToClipboard(adjusted);
133 m_CopyPositionInfo.SetText(
" (P to clipboard)");
135 m_CopyPositionInfo.SetText(
"");
151 float worldSize =
GetGame().GetWorld().GetWorldSize();
153 float tileX =
Math.InverseLerp(0, worldSize, pos[0]);
154 float tileY =
Math.InverseLerp(0, worldSize, pos[2]);
165 else if (fraction < 0.5)
167 else if (fraction < 0.75)