40{
44
50 Widget m_CardMovementFrame;
53
58
62
66
69
75
78
82
85
87 bool m_CH_DoTurn = false;
88 bool m_CH_DoVault = false;
89 bool m_CH_DoKnucleOut = false;
90 bool m_CH_GoToCrawl = false;
91 bool m_CH_DoHit = false;
92 bool m_CH_StartDeath = false;
93 bool m_CH_DoAttack = false;
94
97
99
102
103 void PluginDayZInfectedDebug()
104 {
105#ifndef NO_GUI
107#endif
108 }
109
110 void ~PluginDayZInfectedDebug()
111 {
112#ifndef NO_GUI
114#endif
115 }
116
119 {
123
125 }
126
129 {
131 {
135 }
136 }
137
140 {
142 {
143 GetGame().GetInput().ChangeGameFocus(1);
144 GetGame().GetUIManager().ShowUICursor(
true);
146 }
147 }
148
151 {
153 {
154 GetGame().GetInput().ChangeGameFocus(-1);
155 GetGame().GetUIManager().ShowUICursor(
false);
157 }
158 }
159
162 {
165
166 GetUApi().ActivateExclude(
"menu");
168
170 {
173 }
174 }
175
178 {
181
183
185 }
186
189 {
192 }
193
195 {
197
198 CleanupDebugShapes(m_DebugShapes);
199
201 {
202 if (!m_ControlledInfected)
203 return;
204
206 }
207 }
208
211 {
213 {
216 }
217
219 {
220 m_MainWnd =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/debug/day_z_infecteddebug.layout");
223 }
224
229 m_CardMovementFrame =
m_MainWnd.FindAnyWidget(
"CardMovementFrame");
230 m_CardFightFrame =
m_MainWnd.FindAnyWidget(
"CardFightFrame");
232
237
241
245
248
254
257
261
263 InitAttacks();
264
266 }
267
270 {
272 }
273
276 {
277 m_CardMovementFrame.Show(
pCard == 0);
278 m_CardFightFrame.Show(
pCard == 1);
279 }
280
283 {
284 if (
w == m_SpawnEntityButton)
285 {
286 ResetValues();
287 SpawnNewInfectedEntity();
288 return true;
289 }
290
291 if (
w == m_CardMovementButton)
292 {
294 return true;
295 }
296 else if (
w == m_CardFightButton)
297 {
299 return true;
300 }
301 else if (
w == m_StartTurnButton)
302 {
303 m_CH_DoTurn = true;
304 return true;
305 }
306 else if (
w == m_StartVaultButton)
307 {
308 m_CH_DoVault = true;
309 return true;
310 }
311 else if (
w == m_KnucleOutButton)
312 {
313 m_CH_DoKnucleOut = true;
314 return true;
315 }
316 else if (
w == m_StartCrawlingButton)
317 {
318 m_CH_GoToCrawl = true;
319 return true;
320 }
321 else if (
w == m_StartHitButton)
322 {
323 m_CH_DoHit = true;
324 return true;
325 }
326 else if (
w == m_StartDeathButton)
327 {
328 m_CH_StartDeath = true;
329 return true;
330 }
331 else if (
w == m_StartAttackButton)
332 {
333 m_CH_DoAttack = true;
334 return true;
335 }
336
337 return false;
338 }
339
342 {
343 return false;
344 }
345
347 void ResetValues()
348 {
349 m_CH_DoTurn = false;
350 m_CH_DoVault = false;
351 m_CH_DoKnucleOut = false;
352 m_CH_GoToCrawl = false;
353 m_CH_DoHit = false;
354 m_CH_StartDeath = false;
355 m_CH_DoAttack = false;
356 m_MovementSpeedEB.SetText("0");
358 }
359
361 void SpawnNewInfectedEntity()
362 {
364 m_ControlledInfected.GetAIAgent().SetKeepInIdle(true);
365 }
366
367 protected void PossesInfected()
368 {
369 ResetValues();
373 }
374
377 {
378 if (
infected != m_ControlledInfected)
379 return;
380
381 infected.GetInputController().OverrideMovementSpeed(
true, m_MovementSpeedEB.GetText().ToFloat());
382
385 {
386 moveCommand.SetStanceVariation(m_StanceCB.GetCurrentItem());
387 moveCommand.SetIdleState(m_MindStateCB.GetCurrentItem());
388 }
389
390 if (m_CH_DoTurn)
391 {
392 moveCommand.StartTurn(m_TurnDirectionEB.GetText().ToFloat(), m_TurnTypeCB.GetCurrentItem());
393 m_CH_DoTurn = false;
394 }
395 if (m_CH_DoVault)
396 {
397 infected.StartCommand_Vault(m_VaultingCB.GetCurrentItem());
398 m_CH_DoVault = false;
399 }
400 if (m_CH_DoKnucleOut)
401 {
403 m_CH_DoKnucleOut = false;
404 }
405 if (m_CH_GoToCrawl)
406 {
407 infected.StartCommand_Crawl(m_CrawlingTypeCB.GetCurrentItem());
408 m_CH_GoToCrawl = false;
409 }
410 if (m_CH_DoHit)
411 {
412 float hitDir = m_HitDirEB.GetText().ToFloat();
413 int bodyPart = m_HitBodyPartCB.GetCurrentItem();
414 bool heavyHit = m_HitTypeCB.GetCurrentItem() == 1;
415
417
418 m_CH_DoHit = false;
419 }
420 if (m_CH_StartDeath)
421 {
422 int deathType = m_DeathTypeCB.GetCurrentItem();
423 float deathDir = m_HitDirEB.GetText().ToFloat();
424
426
427 m_CH_StartDeath = false;
428 }
429 if (m_CH_DoAttack)
430 {
431 float attackDir = m_AttackDirCB.GetCurrentItem();
432 int attackType = m_AttackDescriptors.Get(m_AttackTypeCB.GetCurrentItem()).animValue;
433
435
436 m_CH_DoAttack = false;
437 }
438 }
439
442 {
443 if (!m_ControlledInfected)
444 return;
445
446 }
447
449 void InitAttacks()
450 {
455
457
458
459
460
461
462
463
464
465
466
467 for (
int i = 0;
i < m_AttackDescriptors.Count(); ++
i)
468 m_AttackTypeCB.AddItem(m_AttackDescriptors.Get(
i).name);
469 }
470
472 {
475
477 }
478}
479
const int ECE_EQUIP_ATTACHMENTS
const int ECE_PLACE_ON_SURFACE
override bool OnClick(Widget w, int x, int y, int button)
class PluginDayZInfectedDebugUIHandler extends ScriptedWidgetEventHandler PluginDayZInfectedDebugAttackDesc(string pName, int pValue)
override bool OnChange(Widget w, int x, int y, bool finished)
void ShowWidgets(bool show)
void ToggleDebugWindowSetMode(int pMode)
ref PluginDayzPlayerDebugUIHandler m_pUIHandler
void ToggleDebugWindowEvent()
void DestroyModuleWidgets()
void CreateModuleWidgets()
class JsonUndergroundAreaTriggerData GetPosition
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static void RemoveShape(out Shape shape)
proto native CGame GetGame()