Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
itemactionswidget.c
Go to the documentation of this file.
1 class ItemActionsWidget extends ScriptedWidgetEventHandler
2 {
3  protected PlayerBase m_Player;
4  protected EntityAI m_EntityInHands;
5  protected ActionBase m_Interact;
6  protected ActionBase m_ContinuousInteract;
7  protected ActionBase m_Single;
8  protected ActionBase m_Continuous;
9  protected ActionManagerClient m_AM;
10  protected IngameHud m_Hud;
11 
12  protected UAIDWrapper m_UseActionWrapper;
13 
14  protected int m_InteractActionsNum;
15  protected int m_ContinuousInteractActionsNum;
16  protected int m_ItemActionsNum;
17  protected int m_ContinuousItemActionsNum;
18  protected bool m_HealthEnabled;
19  protected bool m_QuantityEnabled;
20 
21  protected ref WidgetFadeTimer m_FadeTimer;
22  protected bool m_Faded;
23  protected bool m_Hidden;
24 
25  protected Widget m_Root;
26  protected Widget m_ItemLeft;
27 
29  protected float m_MaxWidthChild;
30  protected float m_RootWidth;
31  protected float m_RootHeight;
32 
33  void ItemActionsWidget()
34  {
35  m_Interact = null;
36  m_ContinuousInteract = null;
37  m_Single = null;
38  m_Continuous = null;
39  m_AM = null;
40 
41  m_FadeTimer = new WidgetFadeTimer;
42  m_Faded = true;
43 
44  m_HealthEnabled = true;
45  m_QuantityEnabled = true;
46 
47  m_Hud = GetHud();
48  m_Hidden = true;
49 
50  m_UseActionWrapper = GetUApi().GetInputByID(UAAction).GetPersistentWrapper();
51 
52  GetGame().GetUpdateQueue(CALL_CATEGORY_GUI).Insert(Update);
53  GetGame().GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
54  GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
55  }
56 
57  void ~ItemActionsWidget()
58  {
59  GetGame().GetUpdateQueue(CALL_CATEGORY_GUI).Remove(Update);
60  }
61 
63  void SetInteractXboxIcon(string imageset_name, string image_name) {};
64  void SetContinuousInteractXboxIcon(string imageset_name, string image_name) {};
65  void SetSingleXboxIcon(string imageset_name, string image_name) {};
66  void SetContinuousXboxIcon(string imageset_name, string image_name) {};
67  protected void SetXboxIcon(string name, string imageset_name, string image_name) {};
69 
70  protected void SetControllerIcon(string pWidgetName, string pInputName)
71  {
72  RichTextWidget w = RichTextWidget.Cast(m_Root.FindAnyWidget(pWidgetName + "_btn_icon_xbox"));
73  w.SetText(InputUtils.GetRichtextButtonIconFromInputAction(pInputName, "", EUAINPUT_DEVICE_CONTROLLER));
74  }
75 
76  protected void ShowXboxHidePCIcons(string widget, bool show_xbox_icon)
77  {
78  m_Root.FindAnyWidget(widget + "_btn_icon_xbox").Show(show_xbox_icon);
79  m_Root.FindAnyWidget(widget + "_btn_icon").Show(!show_xbox_icon);
80  }
81 
82  protected void OnWidgetScriptInit(Widget w)
83  {
84  m_Root = w;
85  m_Root.SetHandler(this);
86  m_Root.Show(false);
87 
88  m_ItemLeft = w.FindAnyWidget("ia_item_left");
89 
91  UpdateControllerInputIcons();
92  UpdatePCIconsVisibility();
93  }
94 
95  protected void OnInputPresetChanged()
96  {
97  #ifdef PLATFORM_CONSOLE
98  UpdateControllerInputIcons();
99  #endif
100  }
101 
102  protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
103  {
104  UpdatePCIconsVisibility();
105  }
106 
108  private void UpdateControllerInputIcons()
109  {
110  SetControllerIcon("ia_interact", "UAAction");
111  SetControllerIcon("ia_continuous_interact", "UAAction");
112  SetControllerIcon("ia_single", "UADefaultAction");
113  SetControllerIcon("ia_continuous", "UADefaultAction");
114  }
115 
117  private void UpdatePCIconsVisibility()
118  {
119  bool showConsoleIcons = false;
120  #ifdef PLATFORM_CONSOLE
121  showConsoleIcons = GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER || !GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer();
122  #endif
123 
124  ShowXboxHidePCIcons("ia_interact", showConsoleIcons);
125  ShowXboxHidePCIcons("ia_continuous_interact", showConsoleIcons);
126  ShowXboxHidePCIcons("ia_single", showConsoleIcons);
127  ShowXboxHidePCIcons("ia_continuous", showConsoleIcons);
128  }
129 
130  protected void BuildCursor()
131  {
132  int health = -1;
133  int quantityType = 0;
134  int quantityMin = -1;
135  int quantityMax = -1;
136  float quantityCurrent = -1.0;
137 
138  // item health
139  health = GetItemHealth();
140  SetItemHealth(health, "ia_item", "ia_item_health_mark", m_HealthEnabled);
141 
142  // quantity
144  if (m_EntityInHands && m_EntityInHands.IsWeapon())
145  {
146  SetWeaponQuantity(0, 0, "ia_item", "ia_item_quantity_pb", "ia_item_quantity_text", m_QuantityEnabled);
147  SetWeaponModeAndZeroing("ia_item_subdesc", "ia_item_subdesc_up", "ia_item_subdesc_down", true);
148  }
150  else if (m_EntityInHands && m_EntityInHands.IsTransmitter())
151  {
152  SetRadioFrequency(GetRadioFrequency(), "ia_item_subdesc", "ia_item_subdesc_up", "ia_item_subdesc_down", m_QuantityEnabled);
153  GetItemQuantity(quantityType, quantityCurrent, quantityMin, quantityMax);
154  SetItemQuantity(quantityType, quantityCurrent, quantityMin, quantityMax, "ia_item", "ia_item_quantity_pb", "ia_item_quantity_text", true);
155  }
156  else
157  {
158  GetItemQuantity(quantityType, quantityCurrent, quantityMin, quantityMax);
159  SetItemQuantity(quantityType, quantityCurrent, quantityMin, quantityMax, "ia_item", "ia_item_quantity_pb", "ia_item_quantity_text", m_QuantityEnabled);
160  SetWeaponModeAndZeroing("ia_item_subdesc", "", "", false);
161  }
162 
163  SetItemDesc(m_EntityInHands, GetItemDesc(m_EntityInHands), "ia_item", "ia_item_desc");
164  SetInteractActionIcon("ia_interact", "ia_interact_icon_frame", "ia_interact_btn_inner_icon", "ia_interact_btn_text");
165  SetActionWidget(m_Interact, GetActionDesc(m_Interact), "ia_interact", "ia_interact_action_name");
166 
167  SetInteractActionIcon("ia_continuous_interact", "ia_continuous_interact_icon_frame", "ia_continuous_interact_btn_inner_icon", "ia_continuous_interact_btn_text");
168  SetActionWidget(m_ContinuousInteract, GetActionDesc(m_ContinuousInteract), "ia_continuous_interact", "ia_continuous_interact_action_name");
169 
170  SetActionWidget(m_Single, GetActionDesc(m_Single), "ia_single", "ia_single_action_name");
171  SetActionWidget(m_Continuous, GetActionDesc(m_Continuous), "ia_continuous", "ia_continuous_action_name");
172  SetMultipleInteractAction("ia_interact_mlt_wrapper");
173  SetMultipleContinuousInteractAction("ia_continuous_interact_mlt_wrapper");
174  SetMultipleItemAction("ia_single_mlt_wrapper");
175  SetMultipleContinuousItemAction("ia_continuous_mlt_wrapper");
176  }
177 
178  protected void Update()
179  {
181  if (!g_Game.GetProfileOption(EDayZProfilesOptions.HUD) || !m_Hud.IsHudVisible())
182  {
183  m_Root.Show(false);
184  return;
185  }
186 
187  if (m_Player && !m_Player.IsAlive()) // handle respawn
188  {
189  m_Player = null;
190  m_AM = null;
191  }
192 
193  if (!m_Player)
194  GetPlayer();
195 
196  if (!m_AM)
198 
199  GetActions();
200  GetEntityInHands();
201 
202  if ((m_EntityInHands || !m_Hidden) && GetGame().GetUIManager().GetMenu() == null)
203  {
204  CheckForActionWidgetOverrides();
205  BuildCursor();
206  CheckRefresherFlagVisibility();
207  m_Root.Show(true);
208  }
209  else
210  m_Root.Show(false);
211 
212  m_MaxWidthChild = 200;
213  }
214 
215  // getters
216  protected void GetPlayer()
217  {
218  Class.CastTo(m_Player, GetGame().GetPlayer());
219  }
220 
221  protected void GetActionManager()
222  {
223  if (m_Player && m_Player.IsPlayerSelected())
224  ActionManagerClient.CastTo(m_AM, m_Player.GetActionManager());
225  else
226  m_AM = null;
227  }
228 
229  protected void GetActions()
230  {
231  m_Interact = null;
232  m_ContinuousInteract = null;
233  m_Single = null;
234  m_Continuous = null;
235 
236  if (!m_AM)
237  return;
238 
239  if (m_Player.IsSprinting())
240  return;
241 
242  m_Interact = m_AM.GetPossibleAction(InteractActionInput);
243  m_ContinuousInteract = m_AM.GetPossibleAction(ContinuousInteractActionInput);
244  m_Single = m_AM.GetPossibleAction(DefaultActionInput);
245  m_Continuous = m_AM.GetPossibleAction(ContinuousDefaultActionInput);
246 
247  if (!m_Interact && !m_ContinuousInteract && !m_Continuous && !m_Single)
248  m_Hidden = false;
249 
250  m_InteractActionsNum = m_AM.GetPossibleActionCount(InteractActionInput);
251  m_ContinuousInteractActionsNum = m_AM.GetPossibleActionCount(ContinuousInteractActionInput);
252  m_ItemActionsNum = m_AM.GetPossibleActionCount(DefaultActionInput);
253  m_ContinuousItemActionsNum = m_AM.GetPossibleActionCount(ContinuousDefaultActionInput);
254  }
255 
256  protected void GetEntityInHands()
257  {
258  if (!m_Player) return;
259 
260  EntityAI eai = m_Player.GetHumanInventory().GetEntityInHands();
261 
262  if (eai && !eai.IsInherited(DummyItem))
263  {
264  m_EntityInHands = eai;
265  }
266  else
267  {
268  m_EntityInHands = null;
269  }
270  }
271 
272  protected string GetActionDesc(ActionBase action)
273  {
274  if (action && action.GetText())
275  return action.GetText();
276 
277  return string.Empty;
278  }
279 
280  protected string GetItemDesc(EntityAI entity)
281  {
282  if (m_EntityInHands)
283  return m_EntityInHands.GetDisplayName();
284 
285  return string.Empty;
286  }
287 
288  protected int GetItemHealth()
289  {
290  if (m_EntityInHands)
291  return m_EntityInHands.GetHealthLevel();
292 
293  return -1;
294  }
295 
296  protected void GetItemQuantity(out int q_type, out float q_cur, out int q_min, out int q_max)
297  {
298  if (m_EntityInHands)
299  {
300  InventoryItem item = InventoryItem.Cast(m_EntityInHands);
301  q_type = QuantityConversions.HasItemQuantity(m_EntityInHands);
302  if (q_type > 0)
303  {
304  if (q_type == QUANTITY_PROGRESS)
305  {
306  QuantityConversions.GetItemQuantity(item, q_cur, q_min, q_max);
307 
308  q_cur = (q_cur / q_max);
309  // to percents
310  q_min = 0;
311  q_cur = q_cur * 100;
312  q_max = 100;
313  }
314  else
315  {
316  QuantityConversions.GetItemQuantity(item, q_cur, q_min, q_max);
317  }
318  }
319  }
320  }
321 
322  protected string GetRadioFrequency()
323  {
324  TransmitterBase trans;
325  if (Class.CastTo(trans, m_EntityInHands))
326  {
327  return trans.GetTunedFrequency().ToString();
328  }
329 
330  return string.Empty;
331  }
332 
333  // setters
334  protected void SetItemDesc(EntityAI entity, string descText, string itemWidget, string descWidget)
335  {
336  Widget widget;
337 
338  widget = m_Root.FindAnyWidget(itemWidget);
339 
340  if (entity && m_Player && !m_Player.GetItemAccessor().IsItemInHandsHidden())
341  {
342  descText.ToUpper();
343  TextWidget itemName;
344  Class.CastTo(itemName, widget.FindAnyWidget(descWidget));
345  itemName.SetText(descText);
346  widget.Show(true);
347  }
348  else
349  widget.Show(false);
350  }
351 
352  protected void SetItemHealth(int health, string itemWidget, string healthWidget, bool enabled)
353  {
354  Widget widget;
355 
356  widget = m_Root.FindAnyWidget(itemWidget);
357 
358  if (enabled)
359  {
360  ImageWidget healthMark;
361  Class.CastTo(healthMark, widget.FindAnyWidget(healthWidget));
362 
363  switch (health)
364  {
365  case -1 :
366  healthMark.GetParent().Show(false);
367  break;
368  case GameConstants.STATE_PRISTINE :
369  healthMark.SetColor(Colors.COLOR_PRISTINE);
370  healthMark.SetAlpha(0.5);
371  healthMark.GetParent().Show(true);
372  break;
373  case GameConstants.STATE_WORN :
374  healthMark.SetColor(Colors.COLOR_WORN);
375  healthMark.SetAlpha(0.5);
376  healthMark.GetParent().Show(true);
377  break;
378  case GameConstants.STATE_DAMAGED :
379  healthMark.SetColor(Colors.COLOR_DAMAGED);
380  healthMark.SetAlpha(0.5);
381  healthMark.GetParent().Show(true);
382  break;
383  case GameConstants.STATE_BADLY_DAMAGED:
384  healthMark.SetColor(Colors.COLOR_BADLY_DAMAGED);
385  healthMark.SetAlpha(0.5);
386  healthMark.GetParent().Show(true);
387  break;
388  case GameConstants.STATE_RUINED :
389  healthMark.SetColor(Colors.COLOR_RUINED);
390  healthMark.SetAlpha(0.5);
391  healthMark.GetParent().Show(true);
392  break;
393  default :
394  healthMark.SetColor(0x00FFFFFF);
395  healthMark.SetAlpha(0.5);
396  healthMark.GetParent().Show(true);
397  break;
398  }
399 
400  widget.Show(true);
401  }
402  else
403  widget.Show(false);
404  }
405 
406  protected void SetItemQuantity(int type, float current, int min, int max, string itemWidget, string quantityPBWidget, string quantityTextWidget, bool enabled)
407  {
408  Widget widget;
409 
410  widget = m_Root.FindAnyWidget(itemWidget);
411 
412  if (enabled)
413  {
414  ProgressBarWidget progressBar;
415  TextWidget textWidget;
416  Class.CastTo(progressBar, widget.FindAnyWidget(quantityPBWidget));
417  Class.CastTo(textWidget, widget.FindAnyWidget(quantityTextWidget));
418 
419  //check for volume vs. count and display progressbar or "bubble" with exact count/max text
420  switch (type)
421  {
422  case QUANTITY_HIDDEN :
423  progressBar.Show(false);
424  textWidget.Show(false);
425  textWidget.GetParent().Show(false);
426  break;
427  case QUANTITY_COUNT :
428  if (max > 1 || current > 1)
429  {
430  string qty_text = string.Format("%1/%2", Math.Round(current).ToString(), max.ToString());
431  progressBar.Show(false);
432  textWidget.SetText(qty_text);
433  textWidget.Show(true);
434  textWidget.GetParent().Show(true);
435  break;
436  }
437  else
438  {
439  progressBar.Show(false);
440  textWidget.Show(false);
441  textWidget.GetParent().Show(false);
442  break;
443  }
444  case QUANTITY_PROGRESS :
445  textWidget.Show(false);
446  progressBar.SetCurrent(current);
447  progressBar.Show(true);
448  textWidget.GetParent().Show(true);
449  break;
450  }
451  widget.Show(true);
452  }
453  else
454  widget.Show(false);
455  }
456 
457  protected void SetWeaponQuantity(int chamber, int mag, string itemWidget, string quantityPBWidget, string quantityTextWidget, bool enabled)
458  {
459  Widget widget;
460 
461  widget = m_Root.FindAnyWidget(itemWidget);
462 
463  if (enabled)
464  {
465  string wpn_qty = "";
466 
467  ProgressBarWidget progressBar;
468  TextWidget textWidget;
469  Class.CastTo(progressBar, widget.FindAnyWidget(quantityPBWidget));
470  Class.CastTo(textWidget, widget.FindAnyWidget(quantityTextWidget));
471 
472  Weapon_Base wpn;
473  Magazine maga;
474  int mag_quantity = -1;
475 
476  if (Class.CastTo(wpn, m_EntityInHands))
477  {
478  if (Magnum_Base.Cast(wpn))
479  {
480  mag_quantity = 0;
481  for (int j = 0; j < wpn.GetMuzzleCount(); j++)
482  {
483  if (wpn.IsChamberFull(j)&& !wpn.IsChamberFiredOut(j))
484  mag_quantity++;
485  }
486  wpn_qty = mag_quantity.ToString();
487  }
488  else
489  {
490  for (int i = 0; i < wpn.GetMuzzleCount(); i++)
491  {
492  if (i > 0 && (wpn.GetMuzzleCount() < 3 || i%2 == 0))
493  {
494  wpn_qty = wpn_qty + " ";
495  }
496  if (wpn.IsChamberEmpty(i))
497  {
498  wpn_qty = wpn_qty + "0";
499  }
500  else if (wpn.IsChamberFiredOut(i))
501  {
502  wpn_qty = wpn_qty + "F";
503  }
504  else
505  {
506  wpn_qty = wpn_qty + "1";
507  }
508 
509  maga = wpn.GetMagazine(i);
510  if (maga)
511  {
512  mag_quantity = maga.GetAmmoCount();
513  }
514  else if (wpn.GetInternalMagazineMaxCartridgeCount(i) > 0)
515  {
516  mag_quantity = wpn.GetInternalMagazineCartridgeCount(i);
517  }
518 
519  }
520 
521  if (wpn.IsJammed())
522  {
523  if (mag_quantity != -1)
524  wpn_qty = string.Format("X (+%1)", mag_quantity);
525  else
526  wpn_qty = "X";
527  }
528  else
529  {
530  if (mag_quantity != -1)
531  {
532  wpn_qty = wpn_qty + " (" + mag_quantity.ToString() + ")";
533  }
534  }
535  }
536  }
537 
538  progressBar.Show(false);
539  textWidget.SetText(wpn_qty);
540  textWidget.Show(true);
541  textWidget.GetParent().Show(true);
542  }
543  else
544  widget.Show(false);
545  }
546 
547  protected void SetWeaponModeAndZeroing(string itemWidget, string upWidget, string downWidget, bool enabled)
548  {
549  Widget widget;
550 
551  widget = m_Root.FindAnyWidget(itemWidget);
552 
553  if (enabled && m_Player)
554  {
555  TextWidget txtModeWidget;
556  TextWidget txtZeroingWidget;
557 
558  Class.CastTo(txtModeWidget, widget.FindAnyWidget(upWidget));
559  Class.CastTo(txtZeroingWidget, widget.FindAnyWidget(downWidget));
560 
561  Weapon w = Weapon.Cast(m_Player.GetHumanInventory().GetEntityInHands());
562  string zeroing = string.Empty;
563  if (w)
564  zeroing = string.Format("%1 m", w.GetCurrentZeroing(w.GetCurrentMuzzle()));
565 
566  txtModeWidget.SetText(m_Player.GetWeaponManager().GetCurrentModeName());
567  txtZeroingWidget.SetText(zeroing);
568  widget.Show(true);
569  }
570  else
571  widget.Show(false);
572  }
573 
574  // not used instead of this is used confing parameter for fire mode
575  protected string WeaponModeTextTemp()
576  {
577  return "unused";
578  }
579 
580  protected void SetRadioFrequency(string freq, string itemWidget, string upWidget, string downWidget, bool enabled)
581  {
582  Widget widget;
583 
584  widget = m_Root.FindAnyWidget(itemWidget);
585 
586  if (enabled)
587  {
588  TextWidget txtUpWidget;
589  TextWidget txtDownWidget;
590  Class.CastTo(txtUpWidget, widget.FindAnyWidget(upWidget));
591  Class.CastTo(txtDownWidget, widget.FindAnyWidget(downWidget));
592 
593  txtUpWidget.SetText(freq);
594  txtDownWidget.SetText("MHz");
595  widget.Show(true);
596  }
597  else
598  widget.Show(false);
599  }
600 
601  protected void SetActionWidget(ActionBase action, string descText, string actionWidget, string descWidget)
602  {
603  Widget widget = m_Root.FindAnyWidget(actionWidget);
604 
605  if (action && (!action.HasTarget() || (m_Player && m_Player.GetCommand_Vehicle())))
606  {
607  TextWidget actionName;
608  Class.CastTo(actionName, widget.FindAnyWidget(descWidget));
609 
610 
611  if (action.GetInput().GetInputType() == ActionInputType.AIT_CONTINUOUS)
612  {
613  descText = descText + " " + "#action_target_cursor_hold";
614  actionName.SetText(descText);
615  }
616  else
617  {
618  actionName.SetText(descText);
619  }
620 
621  widget.Show(true);
622  }
623  else
624  {
625  widget.Show(false);
626  }
627  }
628 
630  protected void SetMultipleInteractAction(string multiActionsWidget)
631  {
632  Widget widget;
633 
634  widget = m_Root.FindAnyWidget(multiActionsWidget);
635  widget.Show(m_InteractActionsNum > 1);
636  }
637 
639  protected void SetMultipleContinuousInteractAction(string multiActionsWidget)
640  {
641  Widget widget;
642 
643  widget = m_Root.FindAnyWidget(multiActionsWidget);
644  widget.Show(m_ContinuousInteractActionsNum > 1);
645  }
646 
647  protected void SetMultipleItemAction(string multiActionsWidget)
648  {
649  Widget widget;
650 
651  widget = m_Root.FindAnyWidget(multiActionsWidget);
652  widget.Show(m_ItemActionsNum > 1);
653  }
654 
656  protected void SetMultipleContinuousItemAction(string multiActionsWidget)
657  {
658  Widget widget;
659 
660  widget = m_Root.FindAnyWidget(multiActionsWidget);
661  widget.Show(m_ContinuousItemActionsNum > 1);
662  }
663 
664  protected void SetInteractActionIcon(string actionWidget, string actionIconFrameWidget, string actionIconWidget, string actionIconTextWidget)
665  {
666  string keyName = string.Empty;
667  Widget widget, frameWidget;
668  ImageWidget iconWidget;
669  TextWidget textWidget;
670 
671  widget = m_Root.FindAnyWidget(actionWidget);
672  Class.CastTo(frameWidget, widget.FindAnyWidget(actionIconFrameWidget));
673  Class.CastTo(iconWidget, widget.FindAnyWidget(actionIconWidget));
674  Class.CastTo(textWidget, widget.FindAnyWidget(actionIconTextWidget));
675 
676  m_UseActionWrapper.InputP().SelectAlternative(0);
677  for (int c = 0; c < m_UseActionWrapper.InputP().BindKeyCount(); c++)
678  {
679  int _hc = m_UseActionWrapper.InputP().GetBindKey(0);
680  keyName = GetUApi().GetButtonName(_hc);
681  }
682 
683  // uses text in floating widget
684  iconWidget.Show(false);
685  textWidget.SetText(keyName);
686  textWidget.Show(true);
687  }
688 
689  protected void CheckRefresherFlagVisibility()
690  {
691  Widget w = m_Root.FindAnyWidget("ia_item_flag_icon");
692  if (m_Player && m_Player.GetHologramLocal())
693  {
694  EntityAI entity = m_Player.GetHologramLocal().GetProjectionEntity();
695  w.Show(entity.IsRefresherSignalingViable() && m_Player.IsTargetInActiveRefresherRange(entity));
696  }
697  else if (w.IsVisible())
698  {
699  w.Show(false);
700  }
701  }
702 
703  protected void CheckForActionWidgetOverrides()
704  {
705  ItemBase item;
706  typename actionName;
707  if (Class.CastTo(item, m_EntityInHands) && item.GetActionWidgetOverride(actionName))
708  {
709  ActionBase action = ActionManagerBase.GetAction(actionName);
710  if (action)
711  {
712  m_Single = action;
713  }
714  }
715  }
716 
717  protected IngameHud GetHud()
718  {
719  Mission mission = GetGame().GetMission();
720  if (mission)
721  {
722  IngameHud hud = IngameHud.Cast(mission.GetHud());
723  return hud;
724  }
725 
726  return null;
727  }
728 }
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
QUANTITY_PROGRESS
const int QUANTITY_PROGRESS
Definition: constants.c:484
UAIDWrapper
Definition: uainput.c:14
QUANTITY_COUNT
const int QUANTITY_COUNT
Definition: constants.c:483
mission
Mission mission
Definition: displaystatus.c:28
EDayZProfilesOptions
EDayZProfilesOptions
Definition: edayzprofilesoptions.c:1
m_Hud
Hud m_Hud
Definition: displaystatus.c:29
Magnum_Base
Definition: magnum.c:362
InputUtils
Definition: inpututils.c:1
QuantityConversions
Definition: quantityconversions.c:1
Mission
Mission class.
Definition: gameplay.c:670
OnWidgetScriptInit
void OnWidgetScriptInit(Widget w)
Definition: sizetochild.c:94
ContinuousInteractActionInput
Definition: actioninput.c:521
GetActions
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
Definition: advancedcommunication.c:68
ActionInputType
ActionInputType
Definition: actioninput.c:1
Weapon
script counterpart to engine's class Weapon
Definition: inventoryitem.c:48
QUANTITY_HIDDEN
const int QUANTITY_HIDDEN
Definition: constants.c:482
DefaultActionInput
Definition: actioninput.c:630
ActionManagerBase
void ActionManagerBase(PlayerBase player)
Definition: actionmanagerbase.c:62
InventoryItem
Definition: itembase.c:13
OnInputDeviceChanged
protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Definition: inventory.c:167
CALL_CATEGORY_GUI
const int CALL_CATEGORY_GUI
Definition: tools.c:9
Colors
Definition: colors.c:3
EInputDeviceType
EInputDeviceType
Definition: input.c:2
RichTextWidget
Definition: gameplay.c:315
PlayerBase
Definition: playerbaseclient.c:1
TransmitterBase
Definition: baseradio.c:1
TextWidget
Definition: enwidgets.c:219
InteractActionInput
Definition: actioninput.c:534
m_AM
protected ActionManagerBase m_AM
Definition: crosshairselector.c:57
g_Game
DayZGame g_Game
Definition: dayzgame.c:3727
m_Player
DayZPlayer m_Player
Definition: hand_events.c:42
DummyItem
Definition: magnum.c:404
ActionManagerClient
Definition: actionmanagerclient.c:4
Update
proto native volatile void Update()
Definition: playersoundmanager.c:125
quantityMax
float quantityMax
Definition: cfgplayerspawndatajson.c:209
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
ActionBase
void ActionBase()
Definition: actionbase.c:73
GetActionManager
protected void GetActionManager()
Definition: crosshairselector.c:132
GetPlayer
protected void GetPlayer()
Definition: crosshairselector.c:127
GameConstants
Definition: constants.c:612
quantityMin
float quantityMin
Definition: cfgplayerspawndatajson.c:208
Weapon_Base
shorthand
Definition: boltactionrifle_base.c:5
OnInputPresetChanged
protected void OnInputPresetChanged()
Definition: inventory.c:160
Widget
Definition: enwidgets.c:189
GetUApi
proto native UAInputAPI GetUApi()
Math
Definition: enmath.c:6
m_Root
protected Widget m_Root
Definition: sizetochild.c:91
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
EntityAI
Definition: building.c:5
ScriptedWidgetEventHandler
map: item x vector(index, width, height)
Definition: enwidgets.c:650
ContinuousDefaultActionInput
void ContinuousDefaultActionInput(PlayerBase player)
Definition: actioninput.c:606