8 super.OnClick(w,
x,
y, button);
14 super.OnChange(w,
x,
y, finished);
39 class PluginDayZInfectedDebug
extends PluginBase
47 ButtonWidget m_SpawnEntityButton;
48 ButtonWidget m_CardMovementButton;
49 ButtonWidget m_CardFightButton;
50 Widget m_CardMovementFrame;
55 XComboBoxWidget m_StanceCB;
56 XComboBoxWidget m_MindStateCB;
59 ButtonWidget m_StartTurnButton;
60 XComboBoxWidget m_TurnTypeCB;
63 XComboBoxWidget m_VaultingCB;
64 ButtonWidget m_StartVaultButton;
65 ButtonWidget m_KnucleOutButton;
67 XComboBoxWidget m_CrawlingTypeCB;
68 ButtonWidget m_StartCrawlingButton;
72 XComboBoxWidget m_HitTypeCB;
73 XComboBoxWidget m_HitBodyPartCB;
74 ButtonWidget m_StartHitButton;
76 XComboBoxWidget m_DeathTypeCB;
77 ButtonWidget m_StartDeathButton;
79 XComboBoxWidget m_AttackTypeCB;
80 XComboBoxWidget m_AttackDirCB;
81 ButtonWidget m_StartAttackButton;
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;
103 void PluginDayZInfectedDebug()
110 void ~PluginDayZInfectedDebug()
145 GetGame().GetInput().ChangeGameFocus(1);
146 GetGame().GetUIManager().ShowUICursor(
true);
156 GetGame().GetInput().ChangeGameFocus(-1);
157 GetGame().GetUIManager().ShowUICursor(
false);
168 GetUApi().ActivateExclude(
"menu");
198 override void OnUpdate(
float delta_time)
200 super.OnUpdate(delta_time);
202 CleanupDebugShapes(m_DebugShapes);
206 if (!m_ControlledInfected)
209 m_DebugShapes.Insert(
Debug.DrawSphere(m_ControlledInfected.GetPosition() +
"0 2 0", 0.25, FadeColors.RED));
224 m_MainWnd =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/debug/day_z_infecteddebug.layout");
230 m_SpawnEntityButton = ButtonWidget.Cast(
m_MainWnd.FindAnyWidget(
"SpawnEntityButton") );
231 m_CardMovementButton = ButtonWidget.Cast(
m_MainWnd.FindAnyWidget(
"CardMovementButton") );
232 m_CardFightButton = ButtonWidget.Cast(
m_MainWnd.FindAnyWidget(
"CardFightButton") );
233 m_CardMovementFrame =
m_MainWnd.FindAnyWidget(
"CardMovementFrame");
234 m_CardFightFrame =
m_MainWnd.FindAnyWidget(
"CardFightFrame");
238 m_StanceCB = XComboBoxWidget.Cast(
m_MainWnd.FindAnyWidget(
"StanceCB") );
239 m_MindStateCB = XComboBoxWidget.Cast(
m_MainWnd.FindAnyWidget(
"MindStateCB") );
242 m_StartTurnButton = ButtonWidget.Cast(
m_MainWnd.FindAnyWidget(
"StartTurnButton") );
243 m_TurnTypeCB = XComboBoxWidget.Cast(
m_MainWnd.FindAnyWidget(
"TurnTypeCB") );
246 m_VaultingCB = XComboBoxWidget.Cast(
m_MainWnd.FindAnyWidget(
"TurnTypeCB") );
247 m_StartVaultButton = ButtonWidget.Cast(
m_MainWnd.FindAnyWidget(
"StartVaultButton") );
248 m_KnucleOutButton = ButtonWidget.Cast(
m_MainWnd.FindAnyWidget(
"KnucleOutButton") );
250 m_CrawlingTypeCB = XComboBoxWidget.Cast(
m_MainWnd.FindAnyWidget(
"TurnTypeCB") );
251 m_StartCrawlingButton = ButtonWidget.Cast(
m_MainWnd.FindAnyWidget(
"StartCrawlingButton") );
255 m_HitTypeCB = XComboBoxWidget.Cast(
m_MainWnd.FindAnyWidget(
"HitTypeCB") );
256 m_HitBodyPartCB = XComboBoxWidget.Cast(
m_MainWnd.FindAnyWidget(
"HitBodyPartCB") );
257 m_StartHitButton = ButtonWidget.Cast(
m_MainWnd.FindAnyWidget(
"StartHitButton") );
259 m_DeathTypeCB = XComboBoxWidget.Cast(
m_MainWnd.FindAnyWidget(
"DeathTypeCB") );
260 m_StartDeathButton = ButtonWidget.Cast(
m_MainWnd.FindAnyWidget(
"StartDeathButton") );
262 m_AttackTypeCB = XComboBoxWidget.Cast(
m_MainWnd.FindAnyWidget(
"AttackTypeCB") );
263 m_AttackDirCB = XComboBoxWidget.Cast(
m_MainWnd.FindAnyWidget(
"AttackDirCB") );
264 m_StartAttackButton = ButtonWidget.Cast(
m_MainWnd.FindAnyWidget(
"StartAttackButton") );
281 m_CardMovementFrame.Show(pCard == 0);
282 m_CardFightFrame.Show(pCard == 1);
288 if (w == m_SpawnEntityButton)
291 SpawnNewInfectedEntity();
295 if (w == m_CardMovementButton)
300 else if (w == m_CardFightButton)
305 else if (w == m_StartTurnButton)
310 else if (w == m_StartVaultButton)
315 else if (w == m_KnucleOutButton)
317 m_CH_DoKnucleOut =
true;
320 else if (w == m_StartCrawlingButton)
322 m_CH_GoToCrawl =
true;
325 else if (w == m_StartHitButton)
330 else if (w == m_StartDeathButton)
332 m_CH_StartDeath =
true;
335 else if (w == m_StartAttackButton)
337 m_CH_DoAttack =
true;
354 m_CH_DoVault =
false;
355 m_CH_DoKnucleOut =
false;
356 m_CH_GoToCrawl =
false;
358 m_CH_StartDeath =
false;
359 m_CH_DoAttack =
false;
360 m_MovementSpeedEB.SetText(
"0");
365 void SpawnNewInfectedEntity()
368 m_ControlledInfected.GetAIAgent().SetKeepInIdle(
true);
371 protected void PossesInfected()
374 FreeDebugCamera.GetInstance().SetActive(
true);
375 m_ControlledInfected =
DayZInfected.Cast(FreeDebugCamera.GetInstance().GetCrosshairObject());
376 FreeDebugCamera.GetInstance().SetActive(
false);
382 if( infected != m_ControlledInfected )
385 infected.GetInputController().OverrideMovementSpeed(
true, m_MovementSpeedEB.GetText().ToFloat());
390 moveCommand.SetStanceVariation(m_StanceCB.GetCurrentItem());
391 moveCommand.SetIdleState(m_MindStateCB.GetCurrentItem());
396 moveCommand.StartTurn(m_TurnDirectionEB.GetText().ToFloat(), m_TurnTypeCB.GetCurrentItem());
401 infected.StartCommand_Vault(m_VaultingCB.GetCurrentItem());
402 m_CH_DoVault =
false;
404 if( m_CH_DoKnucleOut )
406 infected.StartCommand_Vault(-1);
407 m_CH_DoKnucleOut =
false;
411 infected.StartCommand_Crawl(m_CrawlingTypeCB.GetCurrentItem());
412 m_CH_GoToCrawl =
false;
416 float hitDir = m_HitDirEB.GetText().ToFloat();
417 int bodyPart = m_HitBodyPartCB.GetCurrentItem();
418 bool heavyHit = m_HitTypeCB.GetCurrentItem() == 1;
420 infected.StartCommand_Hit(heavyHit, bodyPart, hitDir);
424 if( m_CH_StartDeath )
426 int deathType = m_DeathTypeCB.GetCurrentItem();
427 float deathDir = m_HitDirEB.GetText().ToFloat();
429 infected.StartCommand_Death(deathType, deathDir);
431 m_CH_StartDeath =
false;
435 float attackDir = m_AttackDirCB.GetCurrentItem();
436 int attackType = m_AttackDescriptors.Get(m_AttackTypeCB.GetCurrentItem()).animValue;
438 infected.StartCommand_Attack(
null, attackType, attackDir);
440 m_CH_DoAttack =
false;
447 if( !m_ControlledInfected )
471 for(
int i = 0; i < m_AttackDescriptors.Count(); ++i )
473 m_AttackTypeCB.AddItem(m_AttackDescriptors.Get(i).name);
479 for (
int it = 0; it < shapesArr.Count(); ++it )
481 Debug.RemoveShape( shapesArr[it] );