DayZ 1.24
Loading...
Searching...
No Matches
HudDebug.c File Reference

Go to the source code of this file.

Classes

class  ScriptedWidgetEventHandler
 map: item x vector(index, width, height) More...
 

Functions

void HudDebug ()
 
void ~HudDebug ()
 
override void Init (Widget hud_panel_widget)
 
override void Update (float timeslice)
 
void SetPanelVisible (int panel_type, bool visible)
 
void PanelShow (int panel_type)
 
void PanelHide (int panel_type)
 
void RefreshCrosshairVisibility ()
 
void HideCrosshairVisibility ()
 
void RefreshByLocalProfile ()
 
bool IsInitialized ()
 
bool OnClick (Widget w, int x, int y, int button)
 
bool OnChange (Widget w, int x, int y, bool finished)
 

Variables

class HudDebugEventHandler extends ScriptedWidgetEventHandler HUD_WIN_UNDEFINED = 0
 
static const int HUD_WIN_CHAR_STATS = 1
 
static const int HUD_WIN_CHAR_MODIFIERS = 2
 
static const int HUD_WIN_CHAR_AGENTS = 3
 
static const int HUD_WIN_CHAR_DEBUG = 4
 
static const int HUD_WIN_CHAR_LEVELS = 5
 
static const int HUD_WIN_CHAR_STOMACH = 6
 
static const int HUD_WIN_VERSION = 7
 
static const int HUD_WIN_TEMPERATURE = 8
 
Widget m_WgtRoot
 
Widget m_Crosshair
 
ref array< ref HudDebugWinBasem_Panels
 
ref Timer m_TimerUpdate
 
ref HudDebugEventHandler m_HudDebugHandler
 
ref HudDebugWinCharModifiers m_WinCharModifiers
 
ref HudDebugWinCharStats m_WinCharStats
 
ref HudDebugWinCharAgents m_WinCharAgents
 

Function Documentation

◆ HideCrosshairVisibility()

void HideCrosshairVisibility ( )

Definition at line 247 of file HudDebug.c.

248 {
250
252 {
253 PluginDeveloper modul_dev = PluginDeveloper.Cast(GetPlugin(PluginDeveloper));
254
255 if (modul_dev.IsEnabledFreeCamera())
256 m_Crosshair.Show(false);
257 }
258 }
Widget m_Crosshair
Definition HudDebug.c:93
PluginBase GetPlugin(typename plugin_type)

References GetPlugin(), and m_Crosshair.

◆ HudDebug()

void HudDebug ( )

Definition at line 104 of file HudDebug.c.

105 {
106 }

Referenced by HudDebugWinBase::GetType(), GetType(), MissionBase::OnInit(), and RefreshByLocalProfile().

◆ Init()

override void Init ( Widget hud_panel_widget)

Definition at line 120 of file HudDebug.c.

121 {
123 m_WgtRoot.Show(true);
124
125 // Crosshair widget root
126 m_Crosshair = m_WgtRoot.FindAnyWidget("wdw_Crosshair");
127
129
130 // Register Window Character Stats
131 m_WinCharStats = new HudDebugWinCharStats(m_WgtRoot.FindAnyWidget("wdw_CharacterStats"));
132 m_Panels.Insert(m_WinCharStats);
133
134 // Register Window Character Stats
135 HudDebugWinCharLevels win_char_levels = new HudDebugWinCharLevels(m_WgtRoot.FindAnyWidget("wdw_CharacterLevels"));
137
138 // Register Window Chracter Modifiers
139 m_WinCharModifiers = new HudDebugWinCharModifiers(m_WgtRoot.FindAnyWidget("wdw_CharacterModifiers"));
141
142 // Register Window Chracter Agents
143 m_WinCharAgents = new HudDebugWinCharAgents(m_WgtRoot.FindAnyWidget("wdw_CharacterAgents"));
145
146 // Register Window Chracter Debug
147 HudDebugWinCharDebug win_char_debug = new HudDebugWinCharDebug(m_WgtRoot.FindAnyWidget("wdw_CharacterDebug"));
148 m_Panels.Insert(win_char_debug);
149
150 // Register Window Chracter Debug
151 HudDebugWinCharStomach win_char_stomach = new HudDebugWinCharStomach(m_WgtRoot.FindAnyWidget("wdw_CharacterStomach"));
153
154 // Register Window Version
155 HudDebugWinVersion win_version = new HudDebugWinVersion(m_WgtRoot.FindAnyWidget("wdw_Version"));
156 m_Panels.Insert(win_version);
157
158 // Register Window Temperature
159 HudDebugWinTemperature win_temp = new HudDebugWinTemperature(m_WgtRoot.FindAnyWidget("wdw_Temp"));
160 m_Panels.Insert(win_temp);
161
162
165
166 m_TimerUpdate = new Timer();
167 m_TimerUpdate.Run(1.0, this, "Update", NULL, true);
168
169 //set ui event handler
170 m_HudDebugHandler = new HudDebugEventHandler(this);
171 m_WgtRoot.SetHandler(m_HudDebugHandler);
172 }
void RefreshCrosshairVisibility()
Definition HudDebug.c:228
ref Timer m_TimerUpdate
Definition HudDebug.c:95
void RefreshByLocalProfile()
Definition HudDebug.c:263
ref HudDebugWinCharAgents m_WinCharAgents
Definition HudDebug.c:99
ref array< ref HudDebugWinBase > m_Panels
Definition HudDebug.c:94
ref HudDebugEventHandler m_HudDebugHandler
Definition HudDebug.c:96
ref HudDebugWinCharStats m_WinCharStats
Definition HudDebug.c:98
ref HudDebugWinCharModifiers m_WinCharModifiers
Definition HudDebug.c:97
Widget m_WgtRoot
Definition HudDebug.c:92
void HudDebugWinCharAgents(Widget widget_root)
void HudDebugWinCharModifiers(Widget widget_root)

References HudDebugWinCharAgents(), HudDebugWinCharModifiers(), m_Crosshair, m_HudDebugHandler, m_Panels, m_TimerUpdate, m_WgtRoot, m_WinCharAgents, m_WinCharModifiers, m_WinCharStats, RefreshByLocalProfile(), and RefreshCrosshairVisibility().

◆ IsInitialized()

bool IsInitialized ( )

Definition at line 283 of file HudDebug.c.

284 {
285 if (m_WgtRoot == NULL)
286 return false;
287
288 return false;
289 }

References m_WgtRoot.

◆ OnChange()

bool OnChange ( Widget w,
int x,
int y,
bool finished )

Definition at line 318 of file HudDebug.c.

319 {
320
321 if (m_WinCharStats)
322 {
323 if (m_WinCharStats.OnChange(w, x, y, finished))
324 return true;
325 }
326 return false;
327 }
Icon x
Icon y

References m_WinCharStats, x, and y.

◆ OnClick()

bool OnClick ( Widget w,
int x,
int y,
int button )

Definition at line 294 of file HudDebug.c.

295 {
296 //send OnClick to HudDebugWinCharModifiers
298 {
299 if (m_WinCharModifiers.OnClick(w, x, y, button))
300 return true;
301 }
302
303 if (m_WinCharAgents)
304 {
305 if (m_WinCharAgents.OnClick(w, x, y, button))
306 return true;
307 }
308
309 if (m_WinCharStats)
310 {
311 if (m_WinCharStats.OnClick(w, x, y, button))
312 return true;
313 }
314
315 return false;
316 }

References m_WinCharAgents, m_WinCharModifiers, m_WinCharStats, x, and y.

◆ PanelHide()

void PanelHide ( int panel_type)

Definition at line 214 of file HudDebug.c.

215 {
216 for (int i = 0; i < m_Panels.Count(); ++i)
217 {
219
220 if (panel.GetType() == panel_type)
221 panel.Hide();
222 }
223 }

References m_Panels.

Referenced by SetPanelVisible().

◆ PanelShow()

void PanelShow ( int panel_type)

Definition at line 200 of file HudDebug.c.

201 {
202 for (int i = 0; i < m_Panels.Count(); ++i)
203 {
205
206 if (panel.GetType() == panel_type)
207 panel.Show();
208 }
209 }

References m_Panels.

Referenced by SetPanelVisible().

◆ RefreshByLocalProfile()

void RefreshByLocalProfile ( )

Definition at line 263 of file HudDebug.c.

264 {
266
268 {
269 SetPanelVisible(HudDebug.HUD_WIN_CHAR_STATS, module_cfg_profile.GetCharacterStatsVisible());
270 SetPanelVisible(HudDebug.HUD_WIN_CHAR_LEVELS, module_cfg_profile.GetCharacterLevelsVisible());
271 SetPanelVisible(HudDebug.HUD_WIN_CHAR_MODIFIERS, module_cfg_profile.GetCharacterModifiersVisible());
272 SetPanelVisible(HudDebug.HUD_WIN_CHAR_AGENTS, module_cfg_profile.GetCharacterAgentsVisible());
273 SetPanelVisible(HudDebug.HUD_WIN_CHAR_DEBUG, module_cfg_profile.GetCharacterDebugVisible());
274 SetPanelVisible(HudDebug.HUD_WIN_CHAR_STOMACH, module_cfg_profile.GetCharacterStomachVisible());
275 SetPanelVisible(HudDebug.HUD_WIN_VERSION, module_cfg_profile.GetVersionVisible());
276 SetPanelVisible(HudDebug.HUD_WIN_TEMPERATURE, module_cfg_profile.GetTempVisible());
277 }
278 }
void SetPanelVisible(int panel_type, bool visible)
Definition HudDebug.c:189
void HudDebug()
Definition HudDebug.c:104

References GetPlugin(), HudDebug(), and SetPanelVisible().

Referenced by Init().

◆ RefreshCrosshairVisibility()

void RefreshCrosshairVisibility ( )

Definition at line 228 of file HudDebug.c.

229 {
231
233 {
234 PluginDeveloper modul_dev = PluginDeveloper.Cast(GetPlugin(PluginDeveloper));
235
236 if (modul_dev.IsEnabledFreeCamera())
237 m_Crosshair.Show(module_cfg_profile.GetFreeCameraCrosshairVisible());
238 else
239 m_Crosshair.Show(false);
240 }
241 }

References GetPlugin(), and m_Crosshair.

Referenced by Init(), and ScriptConsoleGeneralTab::OnClick().

◆ SetPanelVisible()

void SetPanelVisible ( int panel_type,
bool visible )

Definition at line 189 of file HudDebug.c.

190 {
191 if (visible)
193 else
195 }
void PanelHide(int panel_type)
Definition HudDebug.c:214
void PanelShow(int panel_type)
Definition HudDebug.c:200

References PanelHide(), and PanelShow().

Referenced by RefreshByLocalProfile().

◆ Update()

override void Update ( float timeslice)

Definition at line 177 of file HudDebug.c.

178 {
179 for (int i = 0; i < m_Panels.Count(); ++i)
180 {
181 if (m_Panels.Get(i).IsVisible())
182 m_Panels.Get(i).Update();
183 }
184 }

References m_Panels.

◆ ~HudDebug()

void ~HudDebug ( )

Definition at line 111 of file HudDebug.c.

112 {
113 delete m_WgtRoot;
114 m_TimerUpdate.Stop();
115 }

References m_TimerUpdate, and m_WgtRoot.

Variable Documentation

◆ HUD_WIN_CHAR_AGENTS

const int HUD_WIN_CHAR_AGENTS = 3
static

Definition at line 85 of file HudDebug.c.

◆ HUD_WIN_CHAR_DEBUG

const int HUD_WIN_CHAR_DEBUG = 4
static

Definition at line 86 of file HudDebug.c.

◆ HUD_WIN_CHAR_LEVELS

const int HUD_WIN_CHAR_LEVELS = 5
static

Definition at line 87 of file HudDebug.c.

◆ HUD_WIN_CHAR_MODIFIERS

const int HUD_WIN_CHAR_MODIFIERS = 2
static

Definition at line 84 of file HudDebug.c.

◆ HUD_WIN_CHAR_STATS

const int HUD_WIN_CHAR_STATS = 1
static

Definition at line 83 of file HudDebug.c.

◆ HUD_WIN_CHAR_STOMACH

const int HUD_WIN_CHAR_STOMACH = 6
static

Definition at line 88 of file HudDebug.c.

◆ HUD_WIN_TEMPERATURE

const int HUD_WIN_TEMPERATURE = 8
static

Definition at line 90 of file HudDebug.c.

◆ HUD_WIN_UNDEFINED

class HudDebugEventHandler extends ScriptedWidgetEventHandler HUD_WIN_UNDEFINED = 0

◆ HUD_WIN_VERSION

const int HUD_WIN_VERSION = 7
static

Definition at line 89 of file HudDebug.c.

◆ m_Crosshair

Widget m_Crosshair

Definition at line 93 of file HudDebug.c.

Referenced by HideCrosshairVisibility(), Init(), and RefreshCrosshairVisibility().

◆ m_HudDebugHandler

ref HudDebugEventHandler m_HudDebugHandler

Definition at line 96 of file HudDebug.c.

Referenced by Init().

◆ m_Panels

Definition at line 94 of file HudDebug.c.

◆ m_TimerUpdate

ref Timer m_TimerUpdate

Definition at line 95 of file HudDebug.c.

◆ m_WgtRoot

◆ m_WinCharAgents

ref HudDebugWinCharAgents m_WinCharAgents

Definition at line 99 of file HudDebug.c.

Referenced by Init(), and OnClick().

◆ m_WinCharModifiers

ref HudDebugWinCharModifiers m_WinCharModifiers

Definition at line 97 of file HudDebug.c.

Referenced by Init(), and OnClick().

◆ m_WinCharStats

ref HudDebugWinCharStats m_WinCharStats

Definition at line 98 of file HudDebug.c.

Referenced by Init(), OnChange(), and OnClick().