DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
HudDebug.c
См. документацию.
1// *************************************************************************************
2// ! PluginDayzPlayerDebugUI
3// *************************************************************************************
4class HudDebugEventHandler extends ScriptedWidgetEventHandler
5{
7
8 void HudDebugEventHandler( HudDebug hud_debug )
9 {
10 m_HudDebug = hud_debug;
11 }
12
14 {
15 return m_HudDebug;
16 }
17
18 override bool OnClick( Widget w, int x, int y, int button )
19 {
20 super.OnClick( w, x, y, button );
21 return GetHudDebug().OnClick( w, x, y, button );
22 }
23
24 override bool OnFocus(Widget w, int x, int y)
25 {
26 //Print("OnFocus");
27 return true;
28 }
29
30 override bool OnFocusLost(Widget w, int x, int y)
31 {
32 //Print("OnFocusLost");
33 return true;
34 }
35 /*
36 override bool OnMouseEnter(Widget w, int x, int y)
37 {
38 Print("OnMouseEnter");
39 return true;
40 }
41
42 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
43 {
44 Print("OnMouseLeaves");
45 return true;
46 }*/
47
48 override bool OnMouseButtonDown(Widget w, int x, int y, int button)
49 {
50 //Print("OnMouseButtonDown");
51 return true;
52 }
53
54
55 override bool OnSelect(Widget w, int x, int y)
56 {
57 //Print("OnSelect");
58 return true;
59 }
60 override bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
61 {
62 //Print("OnItemSelected");
63 return true;
64 }
65
66 override bool OnModalResult(Widget w, int x, int y, int code, int result)
67 {
68 //Print("OnModalResult");
69 return true;
70 }
71
72 override bool OnChange(Widget w, int x, int y, bool finished)
73 {
74 //Print("OnChange " + finished);
75 super.OnChange( w, x, y, finished );
76 return GetHudDebug().OnChange( w, x, y, finished );
77 }
78}
79
80class HudDebug extends Hud
81{
82 static const int HUD_WIN_UNDEFINED = 0;
83 static const int HUD_WIN_CHAR_STATS = 1;
84 static const int HUD_WIN_CHAR_MODIFIERS = 2;
85 static const int HUD_WIN_CHAR_AGENTS = 3;
86 static const int HUD_WIN_CHAR_DEBUG = 4;
87 static const int HUD_WIN_CHAR_LEVELS = 5;
88 static const int HUD_WIN_CHAR_STOMACH = 6;
89 static const int HUD_WIN_VERSION = 7;
90 static const int HUD_WIN_TEMPERATURE = 8;
91 static const int HUD_WIN_HEALTH = 9;
92 static const int HUD_WIN_HORTICULTURE = 10;
93
98 ref HudDebugEventHandler m_HudDebugHandler;
100 ref HudDebugWinCharStats m_WinCharStats;
104
105 //============================================
106 // HudDebug
107 //============================================
108 void HudDebug()
109 {
110 }
111
112 //============================================
113 // ~HudDebug
114 //============================================
116 {
117 delete m_WgtRoot;
118 m_TimerUpdate.Stop();
119 }
120
121 //============================================
122 // Init
123 //============================================
124 override void Init( Widget hud_panel_widget )
125 {
126 m_WgtRoot = hud_panel_widget;
127 m_WgtRoot.Show( true );
128
129 // Crosshair widget root
130 m_Crosshair = m_WgtRoot.FindAnyWidget( "wdw_Crosshair" );
131
133
134 // Register Window Character Stats
135 m_WinCharStats = new HudDebugWinCharStats( m_WgtRoot.FindAnyWidget( "wdw_CharacterStats" ) );
136 m_Panels.Insert( m_WinCharStats );
137
138 // Register Window Character Stats
139 HudDebugWinCharLevels win_char_levels = new HudDebugWinCharLevels( m_WgtRoot.FindAnyWidget( "wdw_CharacterLevels" ) );
140 m_Panels.Insert( win_char_levels );
141
142 // Register Window Chracter Modifiers
143 m_WinCharModifiers = new HudDebugWinCharModifiers( m_WgtRoot.FindAnyWidget( "wdw_CharacterModifiers" ) );
145
146 // Register Window Chracter Agents
147 m_WinCharAgents = new HudDebugWinCharAgents( m_WgtRoot.FindAnyWidget( "wdw_CharacterAgents" ) );
148 m_Panels.Insert( m_WinCharAgents );
149
150 // Register Window Chracter Debug
151 HudDebugWinCharDebug win_char_debug = new HudDebugWinCharDebug( m_WgtRoot.FindAnyWidget( "wdw_CharacterDebug" ) );
152 m_Panels.Insert( win_char_debug );
153
154 // Register Window Chracter Debug
155 HudDebugWinCharStomach win_char_stomach = new HudDebugWinCharStomach( m_WgtRoot.FindAnyWidget( "wdw_CharacterStomach" ) );
156 m_Panels.Insert( win_char_stomach );
157
158 // Register Window Version
159 HudDebugWinVersion win_version = new HudDebugWinVersion( m_WgtRoot.FindAnyWidget( "wdw_Version" ) );
160 m_Panels.Insert( win_version );
161
162 // Register Window Temperature
163 HudDebugWinTemperature win_temp = new HudDebugWinTemperature( m_WgtRoot.FindAnyWidget( "wdw_Temp" ) );
164 m_Panels.Insert( win_temp );
165
166 // Register Window Character Health
167 m_WinHealth = new HudDebugWinHealth( m_WgtRoot.FindAnyWidget( "wdw_Health" ) );
168 m_Panels.Insert( m_WinHealth );
169
170 m_WinHorticulture = new HudDebugWinHorticulture( m_WgtRoot.FindAnyWidget( "wdw_Horticulture" ) );
171 m_Panels.Insert( m_WinHorticulture );
172
173
174
175
178
179 m_TimerUpdate = new Timer();
180 m_TimerUpdate.Run( 1.0, this, "Update", NULL, true );
181
182 //set ui event handler
183 m_HudDebugHandler = new HudDebugEventHandler( this );
184 m_WgtRoot.SetHandler( m_HudDebugHandler );
185 }
186
187 //============================================
188 // Update
189 //============================================
190 override void Update( float timeslice )
191 {
192 for ( int i = 0; i < m_Panels.Count(); ++i )
193 {
194 if ( m_Panels.Get( i ).IsVisible() )
195 {
196 m_Panels.Get( i ).Update();
197 }
198 }
199 }
200
201 //============================================
202 // SetPanetVisible
203 //============================================
204 void SetPanelVisible(int panel_type, bool visible)
205 {
206 if ( visible )
207 {
208 PanelShow( panel_type );
209 }
210 else
211 {
212 PanelHide( panel_type );
213 }
214 }
215
216 //============================================
217 // PanelShow
218 //============================================
219 void PanelShow(int panel_type)
220 {
221 for ( int i = 0; i < m_Panels.Count(); ++i )
222 {
223 HudDebugWinBase panel = m_Panels.Get( i );
224
225 if ( panel.GetType() == panel_type )
226 {
227 panel.Show();
228 }
229 }
230 }
231
232 //============================================
233 // PanelHide
234 //============================================
235 void PanelHide(int panel_type)
236 {
237 for ( int i = 0; i < m_Panels.Count(); ++i )
238 {
239 HudDebugWinBase panel = m_Panels.Get( i );
240
241 if ( panel.GetType() == panel_type )
242 {
243 panel.Hide();
244 }
245 }
246 }
247
248 //============================================
249 // RefreshCrosshairVisibility
250 //============================================
252 {
254
255 if ( module_cfg_profile )
256 {
257 PluginDeveloper modul_dev = PluginDeveloper.Cast( GetPlugin( PluginDeveloper ) );
258
259 if ( modul_dev.IsEnabledFreeCamera() )
260 {
261 m_Crosshair.Show( module_cfg_profile.GetFreeCameraCrosshairVisible() );
262 }
263 else
264 {
265 m_Crosshair.Show( false );
266 }
267 }
268 }
269
270
271 //============================================
272 // HideCrosshairVisibility
273 //============================================
275 {
277
278 if ( module_cfg_profile )
279 {
280 PluginDeveloper modul_dev = PluginDeveloper.Cast( GetPlugin( PluginDeveloper ) );
281
282 if ( modul_dev.IsEnabledFreeCamera() )
283 {
284 m_Crosshair.Show( false );
285 }
286 }
287 }
288
289 //============================================
290 // RefreshByLocalProfile
291 //============================================
293 {
295
296 if ( module_cfg_profile )
297 {
298 SetPanelVisible( HudDebug.HUD_WIN_CHAR_STATS, module_cfg_profile.GetCharacterStatsVisible() );
299 SetPanelVisible( HudDebug.HUD_WIN_CHAR_LEVELS, module_cfg_profile.GetCharacterLevelsVisible() );
300 SetPanelVisible( HudDebug.HUD_WIN_CHAR_MODIFIERS, module_cfg_profile.GetCharacterModifiersVisible() );
301 SetPanelVisible( HudDebug.HUD_WIN_CHAR_AGENTS, module_cfg_profile.GetCharacterAgentsVisible() );
302 SetPanelVisible( HudDebug.HUD_WIN_CHAR_DEBUG, module_cfg_profile.GetCharacterDebugVisible() );
303 SetPanelVisible( HudDebug.HUD_WIN_CHAR_STOMACH, module_cfg_profile.GetCharacterStomachVisible() );
304 SetPanelVisible( HudDebug.HUD_WIN_VERSION, module_cfg_profile.GetVersionVisible() );
305 SetPanelVisible( HudDebug.HUD_WIN_TEMPERATURE, module_cfg_profile.GetTempVisible() );
306 SetPanelVisible( HudDebug.HUD_WIN_HEALTH, module_cfg_profile.GetHealthVisible() );
307 SetPanelVisible( HudDebug.HUD_WIN_HORTICULTURE, module_cfg_profile.GetHorticultureVisible() );
308 }
309 }
310
311 //============================================
312 // IsInitialized
313 //============================================
315 {
316 if ( m_WgtRoot == NULL )
317 {
318 return false;
319 }
320
321 return false;
322 }
323
324 //============================================
325 // OnClick
326 //============================================
327 bool OnClick( Widget w, int x, int y, int button )
328 {
329 //send OnClick to HudDebugWinCharModifiers
330 if ( m_WinCharModifiers )
331 {
332 if (m_WinCharModifiers.OnClick( w, x, y, button ))
333 return true;
334 }
335
336 if ( m_WinCharAgents )
337 {
338 if (m_WinCharAgents.OnClick( w, x, y, button ))
339 return true;
340 }
341
342 if ( m_WinCharStats )
343 {
344 if (m_WinCharStats.OnClick( w, x, y, button ))
345 return true;
346 }
347
348 if ( m_WinHealth )
349 {
350 if (m_WinHealth.OnClick( w, x, y, button ))
351 return true;
352 }
353
354 if ( m_WinHorticulture )
355 {
356 if (m_WinHorticulture.OnClick( w, x, y, button ))
357 return true;
358 }
359
360 return false;
361 }
362
363 bool OnChange(Widget w, int x, int y, bool finished)
364 {
365
366 if ( m_WinCharStats )
367 {
368 if (m_WinCharStats.OnChange( w, x, y, finished ))
369 return true;
370 }
371 return false;
372 }
373
374}
ref Timer m_TimerUpdate
Определения ClockBase.c:15
override bool IsInitialized()
Определения CombinationLock.c:70
override bool OnClick(Widget w, int x, int y, int button)
buttons clicks
Определения DayZGame.c:151
void RefreshCrosshairVisibility()
Определения HudDebug.c:251
static const int HUD_WIN_CHAR_MODIFIERS
Определения HudDebug.c:84
void SetPanelVisible(int panel_type, bool visible)
Определения HudDebug.c:204
static const int HUD_WIN_CHAR_AGENTS
Определения HudDebug.c:85
void PanelHide(int panel_type)
Определения HudDebug.c:235
void RefreshByLocalProfile()
Определения HudDebug.c:292
ref HudDebugWinCharAgents m_WinCharAgents
Определения HudDebug.c:101
static const int HUD_WIN_HORTICULTURE
Определения HudDebug.c:92
static const int HUD_WIN_CHAR_LEVELS
Определения HudDebug.c:87
static const int HUD_WIN_HEALTH
Определения HudDebug.c:91
Widget m_Crosshair
Определения HudDebug.c:95
ref HudDebugEventHandler m_HudDebugHandler
Определения HudDebug.c:98
ref HudDebugWinCharStats m_WinCharStats
Определения HudDebug.c:100
static const int HUD_WIN_CHAR_DEBUG
Определения HudDebug.c:86
static const int HUD_WIN_CHAR_STATS
Определения HudDebug.c:83
ref HudDebugWinHealth m_WinHealth
Определения HudDebug.c:102
static const int HUD_WIN_CHAR_STOMACH
Определения HudDebug.c:88
void ~HudDebug()
Определения HudDebug.c:115
static const int HUD_WIN_TEMPERATURE
Определения HudDebug.c:90
ref HudDebugWinHorticulture m_WinHorticulture
Определения HudDebug.c:103
static const int HUD_WIN_VERSION
Определения HudDebug.c:89
void PanelShow(int panel_type)
Определения HudDebug.c:219
ref HudDebugWinCharModifiers m_WinCharModifiers
Определения HudDebug.c:99
class HudDebugEventHandler extends ScriptedWidgetEventHandler HUD_WIN_UNDEFINED
void HideCrosshairVisibility()
Определения HudDebug.c:274
void HudDebug()
Определения HudDebug.c:108
Widget m_WgtRoot
Определения HudDebug.c:94
void HudDebugWinCharAgents(Widget widget_root)
Определения HudDebugWinCharAgents.c:39
void HudDebugWinCharModifiers(Widget widget_root)
Определения HudDebugWinCharModifiers.c:36
void HudDebugWinHealth(Widget widget_root)
Определения HudDebugWinHealth.c:27
Icon x
Icon y
static ref set< Land_Underground_Panel > m_Panels
Определения Land_Underground_Panel.c:17
override bool OnChange(Widget w, int x, int y, bool finished)
Определения PluginDayZInfectedDebug.c:33
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
void Show()
Определения HudDebugWinBase.c:48
void Hide()
Определения HudDebugWinBase.c:57
int GetType()
Определения HudDebugWinBase.c:18
Определения HudDebugWinBase.c:2
Определения gameplay.c:639
static void Init()
Определения PPERequesterBank.c:51
HudDebug GetHudDebug()
Определения HudDebug.c:13
override bool OnFocusLost(Widget w, int x, int y)
Определения HudDebug.c:30
override bool OnChange(Widget w, int x, int y, bool finished)
Определения HudDebug.c:72
void HudDebugEventHandler(HudDebug hud_debug)
Определения HudDebug.c:8
override bool OnClick(Widget w, int x, int y, int button)
Определения HudDebug.c:18
override bool OnSelect(Widget w, int x, int y)
Определения HudDebug.c:55
override bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
Определения HudDebug.c:60
override bool OnModalResult(Widget w, int x, int y, int code, int result)
Определения HudDebug.c:66
override bool OnFocus(Widget w, int x, int y)
Определения HudDebug.c:24
HudDebug m_HudDebug
Определения HudDebug.c:6
override bool OnMouseButtonDown(Widget w, int x, int y, int button)
Определения HudDebug.c:48
map: item x vector(index, width, height)
Определения EnWidgets.c:651
Определения DayZPlayerImplement.c:63
Определения EnWidgets.c:190
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native volatile void Update()
Определения PlayerSoundManager.c:125