DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ItemActionsWidget.c
Go to the documentation of this file.
1class ItemActionsWidget extends ScriptedWidgetEventHandler
2{
3 protected PlayerBase m_Player;
5 protected ActionBase m_Interact;
7 protected ActionBase m_Single;
8 protected ActionBase m_Continuous;
10 protected IngameHud m_Hud;
11
13
14 protected int m_InteractActionsNum;
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
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
55 }
56
58 {
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
93 }
94
95 protected void OnInputPresetChanged()
96 {
97 #ifdef PLATFORM_CONSOLE
99 #endif
100 }
101
102 protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
103 {
105 }
106
109 {
110 SetControllerIcon("ia_interact", "UAAction");
111 SetControllerIcon("ia_continuous_interact", "UAAction");
112 SetControllerIcon("ia_single", "UADefaultAction");
113 SetControllerIcon("ia_continuous", "UADefaultAction");
114 }
115
118 {
119 bool showConsoleIcons = false;
120 #ifdef PLATFORM_CONSOLE
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();
201
202 if ((m_EntityInHands || !m_Hidden) && GetGame().GetUIManager().GetMenu() == null)
203 {
205 BuildCursor();
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 {
219 }
220
221 protected void GetActionManager()
222 {
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;
369 healthMark.SetColor(Colors.COLOR_PRISTINE);
370 healthMark.SetAlpha(0.5);
371 healthMark.GetParent().Show(true);
372 break;
374 healthMark.SetColor(Colors.COLOR_WORN);
375 healthMark.SetAlpha(0.5);
376 healthMark.GetParent().Show(true);
377 break;
379 healthMark.SetColor(Colors.COLOR_DAMAGED);
380 healthMark.SetAlpha(0.5);
381 healthMark.GetParent().Show(true);
382 break;
384 healthMark.SetColor(Colors.COLOR_BADLY_DAMAGED);
385 healthMark.SetAlpha(0.5);
386 healthMark.GetParent().Show(true);
387 break;
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
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
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 {
720 if (mission)
721 {
722 IngameHud hud = IngameHud.Cast(mission.GetHud());
723 return hud;
724 }
725
726 return null;
727 }
728}
protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Definition Inventory.c:164
protected void OnInputPresetChanged()
Definition Inventory.c:157
void ActionBase()
Definition ActionBase.c:73
void ContinuousDefaultActionInput(PlayerBase player)
ActionInputType
Definition ActionInput.c:2
void ActionManagerBase(PlayerBase player)
protected ActionManagerBase m_AM
DayZGame g_Game
Definition DayZGame.c:3654
Hud m_Hud
Mission mission
EDayZProfilesOptions
DayZPlayer m_Player
Definition Hand_Events.c:42
string name
protected Widget m_Root
Definition SizeToChild.c:91
proto native UAInputAPI GetUApi()
proto native Mission GetMission()
proto native Input GetInput()
override ScriptInvoker GetUpdateQueue(int call_category)
Definition DayZGame.c:1158
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Colors.c:4
const int COLOR_BADLY_DAMAGED
Definition Colors.c:21
const int COLOR_PRISTINE
Definition Colors.c:24
const int COLOR_WORN
Definition Colors.c:23
const int COLOR_DAMAGED
Definition Colors.c:22
const int COLOR_RUINED
Definition Colors.c:20
WeaponManager GetWeaponManager()
bool IsHudVisible()
Definition IngameHud.c:1065
proto native EInputDeviceType GetCurrentInputDevice()
proto native bool IsEnabledMouseAndKeyboardEvenOnServer()
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Definition InputUtils.c:167
Definition EnMath.c:7
Mission class.
Definition gameplay.c:670
Hud GetHud()
Definition gameplay.c:697
ScriptInvoker GetOnInputPresetChanged()
Definition gameplay.c:833
ScriptInvoker GetOnInputDeviceChanged()
Definition gameplay.c:823
static int HasItemQuantity(notnull EntityAI item)
static float GetItemQuantity(InventoryItem item)
proto bool Remove(func fn, int flags=EScriptInvokerRemoveFlags.ALL)
remove specific call from list
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
map: item x vector(index, width, height)
Definition EnWidgets.c:538
protected void CheckForActionWidgetOverrides()
protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
protected void SetMultipleContinuousInteractAction(string multiActionsWidget)
shows arrows near the interact action if there are more than one available
protected ActionBase m_ContinuousInteract
protected void GetItemQuantity(out int q_type, out float q_cur, out int q_min, out int q_max)
void SetContinuousXboxIcon(string imageset_name, string image_name)
protected EntityAI m_EntityInHands
protected void SetControllerIcon(string pWidgetName, string pInputName)
void SetSingleXboxIcon(string imageset_name, string image_name)
void SetContinuousInteractXboxIcon(string imageset_name, string image_name)
protected string GetItemDesc(EntityAI entity)
protected ActionBase m_Single
protected void SetRadioFrequency(string freq, string itemWidget, string upWidget, string downWidget, bool enabled)
protected void OnWidgetScriptInit(Widget w)
protected void SetItemDesc(string descText, int cargoCount, string itemWidget, string descWidget)
protected float m_MaxWidthChild
widget width
protected void OnInputPresetChanged()
protected ActionBase m_Interact
protected void SetXboxIcon(string name, string imageset_name, string image_name)
protected int m_ContinuousInteractActionsNum
protected ActionManagerClient m_AM
protected string GetRadioFrequency()
protected PlayerBase m_Player
protected void ShowXboxHidePCIcons(string widget, bool show_xbox_icon)
protected void SetMultipleContinuousItemAction(string multiActionsWidget)
shows arrows near the interact action if there are more than one available
protected void GetActions()
get actions from Action Manager
protected void SetWeaponQuantity(int chamber, int mag, string itemWidget, string quantityPBWidget, string quantityTextWidget, bool enabled)
float GetItemQuantity(InventoryItem item)
protected UAIDWrapper m_UseActionWrapper
protected void SetInteractActionIcon(string actionWidget, string actionIconFrameWidget, string actionIconWidget, string actionIconTextWidget)
protected void SetItemQuantity(int type, float current, int min, int max, string itemWidget, string quantityPBWidget, string quantityTextWidget, bool enabled)
protected Widget m_Root
Definition SizeToChild.c:9
protected void SetMultipleItemAction(string multiActionsWidget, string multiActionsWidget_NotSelect)
protected void SetMultipleContinuousInteractAction(string multiActionsWidget, string multiActionsWidget_NotSelect)
protected string GetItemDesc(ActionBase action)
private void UpdatePCIconsVisibility()
Contains logic for icon set switching (Gamepad/M&K)
protected void SetWeaponModeAndZeroing(string itemWidget, string upWidget, string downWidget, bool enabled)
protected void SetItemDesc(EntityAI entity, string descText, string itemWidget, string descWidget)
void SetInteractXboxIcon(string imageset_name, string image_name)
DEPRECATED.
protected void SetMultipleInteractAction(string multiActionsWidget)
shows arrows near the interact action if there are more than one available
protected void SetMultipleInteractAction(string multiActionsWidget, string multiActionsWidget_NotSelect)
shows arrows near the interact action if there are more than one available
protected void SetMultipleItemAction(string multiActionsWidget)
protected string WeaponModeTextTemp()
protected void CheckRefresherFlagVisibility()
private void UpdateControllerInputIcons()
Loads icons from the latest keybinds.
protected ActionBase m_Continuous
protected void SetItemHealth(int health, string itemWidget, string healthWidget, bool enabled)
protected string GetActionDesc(ActionBase action)
protected ref WidgetFadeTimer m_FadeTimer
protected void SetActionWidget(ActionBase action, string descText, string actionWidget, string descWidget)
protected void SetMultipleContinuousItemAction(string multiActionsWidget, string multiActionsWidget_NotSelect)
proto native UAInput InputP()
proto native UAInput GetInputByID(int iID)
returns list of all bindable (i.e. visible) inputs from the active group ('core' by default)
proto native owned string GetButtonName(int iHash)
proto native int GetBindKey(int iIndex)
proto native UAIDWrapper GetPersistentWrapper()
proto native void SelectAlternative(int iIndex)
script counterpart to engine's class Weapon
string GetCurrentModeName()
proto string ToString()
proto native CGame GetGame()
const int QUANTITY_PROGRESS
Definition constants.c:468
const int QUANTITY_COUNT
Definition constants.c:467
const int QUANTITY_HIDDEN
Definition constants.c:466
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int STATE_RUINED
Definition constants.c:742
const int STATE_BADLY_DAMAGED
Definition constants.c:743
const int STATE_DAMAGED
Definition constants.c:744
const int STATE_PRISTINE
Definition constants.c:746
const int STATE_WORN
Definition constants.c:745
static proto float Round(float f)
Returns mathematical round of value.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.
proto int ToUpper()
Changes string to uppercase. Returns length.
static const string Empty
Definition EnString.c:7
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.
const int CALL_CATEGORY_GUI
Definition tools.c:9
proto native volatile void Update()
EInputDeviceType
Definition input.c:3