DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionTargetsCursor.c
См. документацию.
2{
5 protected vector m_ScreenPos;
6 protected int m_CompIdx;
7
9 {
10 m_CachedObject = null;
12 m_CompIdx = -1;
13 }
14
16 void Store(Object obj, vector pos, int compIdx)
17 {
18 if (!m_CachedObject)
19 {
20 m_CachedObject = obj;
21 m_CursorWPos = pos;
22 m_CompIdx = compIdx;
23 }
24 }
25
28 {
30 {
31 m_CachedObject = null;
33 m_CompIdx = -1;
34 }
35 }
36
38 {
39 return m_CachedObject;
40 }
41
43 {
44 return m_CursorWPos;
45 }
46
48 {
49 return m_CompIdx;
50 }
51};
52
54{
56 PPERequester_BurlapSackEffects,
57 PPERequester_FlashbangEffects
58 };
59
64
70 protected IngameHud m_Hud;
71
73
74 protected int m_InteractActionsNum;
76 protected int m_ItemActionsNum;
78 protected typename m_SelectedActionCategory;
79 protected bool m_HealthEnabled;
80 protected bool m_QuantityEnabled;
81 protected bool m_FixedOnPosition;
82 protected bool m_Hidden;
83 protected bool m_TargetItemFrozen;
84
85 protected Widget m_Root;
87 protected Widget m_ItemLeft;
88
90 protected float m_MaxWidthChild;
91 protected float m_RootWidth;
92 protected float m_RootHeight;
93
117
119
120 // Controls appearance of the builded cursor
121 void SetHealthVisibility(bool state)
122 {
123 m_HealthEnabled = state;
124 }
125
126 void SetQuantityVisibility(bool state)
127 {
128 m_QuantityEnabled = state;
129 }
130
132 void SetInteractXboxIcon(string imageset_name, string image_name);
133 void SetContinuousInteractXboxIcon(string imageset_name, string image_name);
134 void SetSingleXboxIcon(string imageset_name, string image_name);
135 void SetContinuousXboxIcon(string imageset_name, string image_name);
136 protected void SetXboxIcon(string name, string imageset_name, string image_name);
138
139 protected void SetControllerIcon(string pWidgetName, string pInputName)
140 {
141 RichTextWidget w = RichTextWidget.Cast(m_Root.FindAnyWidget(pWidgetName + "_btn_icon_xbox"));
142 w.SetText(InputUtils.GetRichtextButtonIconFromInputAction(pInputName, "", EUAINPUT_DEVICE_CONTROLLER));
143 }
144
145 protected void OnWidgetScriptInit(Widget w)
146 {
147 m_Root = w;
148 m_Root.Show(false);
149 m_Root.SetHandler(this);
150
154
155 m_Container = w.FindAnyWidget("container");
156 m_ItemLeft = w.FindAnyWidget("item_left");
157
158 m_Root.Update();
159 }
160
161 protected void OnInputPresetChanged()
162 {
163 #ifdef PLATFORM_CONSOLE
165 #endif
166 }
167
168 protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
169 {
171 }
172
175 {
176 SetControllerIcon("interact", "UAAction");
177 SetControllerIcon("continuous_interact", "UAAction");
178 SetControllerIcon("single", "UADefaultAction");
179 SetControllerIcon("continuous", "UADefaultAction");
180 }
181
184 {
185 bool showConsoleIcons = false;
186 #ifdef PLATFORM_CONSOLE
188 #endif
189
190 ShowXboxHidePCIcons("interact", showConsoleIcons);
191 ShowXboxHidePCIcons("continuous_interact", showConsoleIcons);
192 ShowXboxHidePCIcons("continuous", showConsoleIcons);
193 ShowXboxHidePCIcons("single", showConsoleIcons);
194 }
195
196 protected void PrepareCursorContent()
197 {
198 m_TargetItemFrozen = false;
199 int health = -1;
200 int cargoCount = 0;
201 int q_type = 0;
202 int q_min, q_max = -1;
203 float q_cur = -1.0;
204
207 health = GetItemHealth();
208 SetItemHealth(health, "item", "item_health_mark", m_HealthEnabled);
210 GetItemQuantity(q_type, q_cur, q_min, q_max);
212 GetItemCargoCount(cargoCount);
214 SetItemQuantity(q_type, q_cur, q_min, q_max, "item", "item_quantity_pb", "item_quantity_text", m_QuantityEnabled);
215 SetInteractActionIcon("interact", "interact_icon_frame", "interact_btn_inner_icon", "interact_btn_text");
216 SetItemDesc(GetItemDesc(m_Interact), cargoCount, "item", "item_desc");
217 SetActionWidget(m_Interact, GetActionDesc(m_Interact), "interact", "interact_action_name");
218
219 SetInteractActionIcon("continuous_interact", "continuous_interact_icon_frame", "continuous_interact_btn_inner_icon", "continuous_interact_btn_text");
220 SetActionWidget(m_ContinuousInteract, GetActionDesc(m_ContinuousInteract), "continuous_interact", "continuous_interact_action_name");
221
222 SetActionWidget(m_Single, GetActionDesc(m_Single), "single", "single_action_name");
223 SetActionWidget(m_Continuous, GetActionDesc(m_Continuous), "continuous", "continuous_action_name");
224 SetMultipleItemAction("single_mlt_wrapper", "single_mlt_wrapper_not_select");
225 SetMultipleContinuousItemAction("continuous_mlt_wrapper", "continuous_mlt_wrapper_not_select");
226 SetMultipleInteractAction("interact_mlt_wrapper", "interact_mlt_wrapper_not_select");
227 SetMultipleContinuousInteractAction("continuous_interact_mlt_wrapper", "continuous_interact_mlt_wrapper_not_select");
228 }
229
230 protected void BuildFixedCursor()
231 {
232 int w, h, x, y;
233
235 GetScreenSize(w, h);
236 x = w/2 + 32;
237 y = h/2 + 32;
238
239 m_Root.SetPos(x, y);
240 }
241
242 protected void BuildFloatingCursor(bool forceRebuild)
243 {
244 float pos_x, pos_y = 0.0;
245
247
249 if (forceRebuild || m_Target.GetComponentIndex() != m_CachedObject.GetCursorCompIdx())
250 {
251 GetOnScreenPosition(pos_x, pos_y);
252 }
254 else
255 {
256 vector screen_pos = TransformToScreenPos(m_CachedObject.GetCursorWorldPos());
257
258 pos_x = screen_pos[0];
259 pos_y = screen_pos[1];
260 }
261
262 pos_x = Math.Ceil(pos_x);
263 pos_y = Math.Ceil(pos_y);
264
265 Widget parentWdg = m_Root.GetParent();
266
267 float screen_w = 0;
268 float screen_h = 0;
269
270 float wdg_w = 0;
271 float wdg_h = 0;
272
273 parentWdg.GetScreenSize(screen_w, screen_h);
274 m_Root.GetSize(wdg_w, wdg_h);
275
276 if (pos_x + wdg_w > screen_w)
277 pos_x = screen_w - wdg_w;
278
279 if (pos_y + wdg_h > screen_h)
280 pos_y = screen_h - wdg_h;
281
282 m_Root.SetPos(pos_x, pos_y);
283 }
284
285 override bool OnUpdate(Widget w)
286 {
287 if (m_Root == w)
288 {
289 Update();
290 return true;
291 }
292
293 return false;
294 }
295
296 protected void HideWidget()
297 {
298 if (m_Root.IsVisible())
299 {
300 m_Root.Show(false);
301 m_CachedObject.Invalidate();
302 }
303 }
304
305 void Update()
306 {
307 if (m_Player && !m_Player.IsAlive()) // handle respawn
308 {
309 m_Player = null;
310 m_AM = null;
311 }
312
313 if (!m_Player)
314 GetPlayer();
315
316 if (!m_AM)
318
319 if (m_Player.IsInVehicle() || m_AM.GetRunningAction())
320 m_Hidden = true;
321
322
323 /*
324 #ifdef DIAG_DEVELOPER
325 if (DeveloperFreeCamera.IsFreeCameraEnabled())
326 HideWidget();
327 return;
328 #endif
329 */
330
331 bool isVisionObstructionActive = PPEManagerStatic.GetPPEManager().IsAnyRequesterRunning(VISION_OBSTRUCTION_PPEFFECTS_TYPES);
332
334 if (isVisionObstructionActive || m_Hud.GetHudVisibility().IsContextFlagActive(IngameHudVisibility.HUD_HIDE_FLAGS))
335 {
336 HideWidget();
337 return;
338 }
339
340 GetTarget();
341 GetActions();
342
344 bool showTarget = (m_Target && !m_Hidden) || m_Interact || m_ContinuousInteract;
345 if (!showTarget)
346 {
347 if (m_Single)
348 showTarget = m_Single.HasTarget();
349
350 if (m_Continuous)
351 showTarget = showTarget || m_Continuous.HasTarget();
352 }
353
354 if (showTarget)
355 {
357 if (m_Target.GetObject() == null && (m_Interact || m_ContinuousInteract || m_Single || m_Continuous))
358 {
359 //Print(">> fixed widget");
360 m_CachedObject.Invalidate();
362 m_Root.Show(true);
363 m_FixedOnPosition = false;
364 m_Hidden = false;
365 return;
366 }
367 else if (m_Target.GetObject() != null && !m_Target.GetObject().IsHologram() && (!m_Target.GetParent() || m_Target.GetParent() && !m_Target.GetParent().IsHologram()))
368 {
371 if (m_Target.GetObject() != m_CachedObject.Get())
372 {
374 {
375 //Print(">> non-cached widget");
376 m_CachedObject.Invalidate();
378 m_Root.Show(true);
379 m_Hidden = false;
380 return;
381 }
382 else
383 {
384 //Print(">> non-cached widget (fixed)");
385 m_CachedObject.Invalidate();
387 m_Root.Show(true);
388 m_FixedOnPosition = false;
389 m_Hidden = false;
390 return;
391 }
392 }
394 else if (m_Target.GetObject() == m_CachedObject.Get())
395 {
397 {
398 //Print(">> cached widget");
399 BuildFloatingCursor(false);
400 m_Root.Show(true);
401 m_Hidden = false;
402 return;
403 }
404 else
405 {
406 //Print(">> cached widget (fixed)");
407 m_CachedObject.Invalidate();
409 m_Root.Show(true);
410 m_FixedOnPosition = false;
411 m_Hidden = false;
412 return;
413 }
414 }
415 }
416 else
417 {
418 if (m_Root.IsVisible())
419 {
420 m_CachedObject.Invalidate();
421 m_Root.Show(false);
422 m_Hidden = false;
423
424 // remove previous backlit
425 GetDayZGame().GetBacklit().HintClear();
426 }
427 }
428 }
429 else
430 {
431 if (m_Root.IsVisible())
432 {
433 m_CachedObject.Invalidate();
434 m_Root.Show(false);
435 m_FixedOnPosition = false;
436
437 // remove previous backlit
438 GetDayZGame().GetBacklit().HintClear();
439 }
440
441 m_Hidden = false;
442 }
443
444 m_MaxWidthChild = 350;
445 }
447 protected void ShowXboxHidePCIcons(string widget, bool show_xbox_icon)
448 {
449 m_Root.FindAnyWidget(widget + "_btn_icon_xbox").Show(show_xbox_icon);
450 m_Root.FindAnyWidget(widget + "_btn_icon").Show(!show_xbox_icon);
451 }
452
453
454 //! transform world pos to screen pos (related to parent widget size)
455 protected vector TransformToScreenPos(vector pWorldPos)
456 {
457 float parent_width, parent_height;
458 vector transformed_pos, screen_pos;
459
461 screen_pos = GetGame().GetScreenPosRelative(pWorldPos);
463 m_Root.GetParent().GetScreenSize(parent_width, parent_height);
464
466 transformed_pos[0] = screen_pos[0] * parent_width;
467 transformed_pos[1] = screen_pos[1] * parent_height;
468
469 return transformed_pos;
470 }
472 protected void GetOnScreenPosition(out float x, out float y)
473 {
474 const float DEFAULT_HANDLE_OFFSET = 0.2;
475 const string CE_CENTER_COMP_NAME = "ce_center";
476 const string MEM_LOD_NAME = LOD.NAME_MEMORY;
477
478 int compIdx;
479 float pivotOffset = 0.0;
480 float memOffset = 0.0;
481 string compName;
482
483 bool isTargetForced = false;
484
485 vector worldPos;
486 vector modelPos;
487
488 LOD lod;
489
490 array<Selection> memSelections = new array<Selection>();
491 array<string> components = new array<string>; // for components with multiple selection
492
493 Object object;
494
495 if (m_Target)
496 {
497 object = m_Target.GetObject();
498 compIdx = m_Target.GetComponentIndex();
499
500 if (m_Target.GetCursorHitPos() == vector.Zero)
501 isTargetForced = true;
502 }
503 else
504 {
505 return;
506 }
507
508 if (object)
509 {
510 if (!isTargetForced)
511 {
512 compName = object.GetActionComponentName(compIdx);
513 object.GetActionComponentNameList(compIdx, components);
514
515 if (!object.IsInventoryItem() && (object.HasFixedActionTargetCursorPosition() || object.GetActionComponentNameList(compIdx, components) == 0))
516 {
517 m_FixedOnPosition = true;
518 return;
519 }
520
521 pivotOffset = object.ConfigGetFloat("actionTargetPivotOffsetY");
522 memOffset = object.ConfigGetFloat("actionTargetMemOffsetY");
523
525 lod = object.GetLODByName(MEM_LOD_NAME);
526 if (lod != null)
527 {
529 lod.GetSelections(memSelections);
530
531 // items with CE_Center mem point
532 if (MiscGameplayFunctions.IsComponentInSelection(memSelections, CE_CENTER_COMP_NAME))
533 {
534 for (int i2 = 0; i2 < memSelections.Count(); ++i2)
535 {
536 if (memSelections[i2].GetName() == CE_CENTER_COMP_NAME && memSelections[i2].GetVertexCount() == 1)
537 {
538 m_FixedOnPosition = false;
539 modelPos = object.GetSelectionPositionMS(CE_CENTER_COMP_NAME);
540 worldPos = object.ModelToWorld(modelPos);
541 if (memOffset != 0.0)
542 {
543 worldPos[1] = worldPos[1] + memOffset;
544 }
545 else
546 {
547 worldPos[1] = worldPos[1] + DEFAULT_HANDLE_OFFSET;
548 }
549 }
550 }
551
553 m_CachedObject.Store(object, worldPos, compIdx);
554 }
556 else if (!compName.Contains("ladder") && IsComponentInSelection(memSelections, compName))
557 {
558 for (int i1 = 0; i1 < memSelections.Count(); ++i1)
559 {
561 if (memSelections[i1].GetName() == compName && memSelections[i1].GetVertexCount() == 1)
562 {
563 modelPos = object.GetSelectionPositionMS(compName);
564 worldPos = object.ModelToWorld(modelPos);
565
566 m_FixedOnPosition = false;
567 if (object.GetType() == "Fence" || object.GetType() == "Watchttower" || object.GetType() == "GardenPlot")
568 m_FixedOnPosition = true;
569
570 if (memOffset != 0.0)
571 {
572 worldPos[1] = worldPos[1] + memOffset;
573 }
574 else
575 {
576 worldPos[1] = worldPos[1] + DEFAULT_HANDLE_OFFSET;
577 }
578 }
579
581 if (memSelections[i1].GetName() == compName && memSelections[i1].GetVertexCount() > 1)
582 {
583 for (int j = 0; j < components.Count(); ++j)
584 {
585 if (IsComponentInSelection(memSelections, components[j]))
586 {
587 modelPos = object.GetSelectionPositionMS(components[j]);
588 worldPos = object.ModelToWorld(modelPos);
589
590 m_FixedOnPosition = false;
591 if (memOffset != 0.0)
592 {
593 worldPos[1] = worldPos[1] + memOffset;
594 }
595 else
596 {
597 worldPos[1] = worldPos[1] + DEFAULT_HANDLE_OFFSET;
598 }
599 }
600 }
601 }
602 }
603
605 m_CachedObject.Store(object, worldPos, -1);
606 }
608 else if (compName.Contains("ladder") && IsComponentInSelection(memSelections, compName))
609 {
610 vector ladderHandlePointLS, ladderHandlePointWS;
611 vector closestHandlePos;
612 float lastDistance = 0;
613
614 for (int i3 = 0; i3 < memSelections.Count(); ++i3)
615 {
616 if (memSelections[i3].GetName() == compName && memSelections[i3].GetVertexCount() > 1)
617 {
618 ladderHandlePointLS = memSelections[i3].GetVertexPosition(lod, 0);
619 ladderHandlePointWS = object.ModelToWorld(ladderHandlePointLS);
620 closestHandlePos = ladderHandlePointWS;
621 lastDistance = Math.AbsFloat(vector.DistanceSq(ladderHandlePointWS, m_Player.GetPosition()));
622
623 for (int k = 1; k < memSelections[i3].GetVertexCount(); ++k)
624 {
625 ladderHandlePointLS = memSelections[i3].GetVertexPosition(lod, k);
626 ladderHandlePointWS = object.ModelToWorld(ladderHandlePointLS);
627
628 if (lastDistance > Math.AbsFloat(vector.DistanceSq(ladderHandlePointWS, m_Player.GetPosition())))
629 {
630 lastDistance = Math.AbsFloat(vector.DistanceSq(ladderHandlePointWS, m_Player.GetPosition()));
631 closestHandlePos = ladderHandlePointWS;
632 }
633 }
634
635 m_FixedOnPosition = false;
636 worldPos = closestHandlePos;
637 if (memOffset != 0.0)
638 {
639 worldPos[1] = worldPos[1] + memOffset;
640 }
641 else
642 {
643 worldPos[1] = worldPos[1] + DEFAULT_HANDLE_OFFSET;
644 }
645 }
646 }
647
649 m_CachedObject.Store(object, worldPos, -1);
650 }
651 else
652 {
653 m_FixedOnPosition = true;
654 }
655 }
656 else
657 {
658 m_FixedOnPosition = true;
659 }
660 }
661 else
662 {
663 m_FixedOnPosition = true;
664 }
665
666 vector pos = TransformToScreenPos(worldPos);
667
668 x = pos[0];
669 y = pos[1];
670 }
671
672 worldPos = vector.Zero;
673 isTargetForced = false;
674 }
675
676 // kept for backward compatibility
677 protected bool IsComponentInSelection(array<Selection> selection, string compName)
678 {
679 return MiscGameplayFunctions.IsComponentInSelection(selection, compName);
680 }
681
682 // getters
684 protected void GetPlayer()
685 {
687 }
689 protected void GetActionManager()
690 {
691 if (m_Player && m_Player.IsPlayerSelected())
692 {
693 Class.CastTo(m_AM, m_Player.GetActionManager());
694 }
695 else
696 {
697 m_AM = null;
698 }
699 }
700
701 //! get actions from Action Manager
702 protected void GetActions()
703 {
704 m_Interact = null;
706 m_Single = null;
707 m_Continuous = null;
708
709 if (!m_AM) return;
710 if (!m_Target) return;
711 if (m_Player.IsSprinting()) return;
712 if (m_Player.IsInVehicle()) return; // TODO: TMP: Car AM rework needed
713
714 m_Interact = m_AM.GetPossibleAction(InteractActionInput);
716 m_Single = m_AM.GetPossibleAction(DefaultActionInput);
718
719 m_InteractActionsNum = m_AM.GetPossibleActionCount(InteractActionInput);
721 m_ItemActionsNum = m_AM.GetPossibleActionCount(DefaultActionInput);
723
724 m_SelectedActionCategory = m_AM.GetSelectedActionCategory();
725
726 if (m_Interact)
727 {
728 m_DisplayInteractTarget = m_Interact.GetDisplayInteractObject(m_Player, m_Target);
729 }
730 else if (m_Single)
731 {
732 m_DisplayInteractTarget = m_Single.GetDisplayInteractObject(m_Player, m_Target);
733 }
734 else if (m_ContinuousInteract)
735 {
737 }
738 else
739 {
741 }
742 }
744 protected void GetTarget()
745 {
746 if (!m_AM)
747 return;
748
749 m_Target = m_AM.FindActionTarget();
750 if (m_Target && m_Target.GetObject() && m_Target.GetObject().IsItemBase())
751 {
752 ItemBase item = ItemBase.Cast(m_Target.GetObject());
753 InventoryLocation invLocation = new InventoryLocation();
754 item.GetInventory().GetCurrentInventoryLocation(invLocation);
755
756 if ((!item.IsTakeable() && !item.IsActionTargetVisible()) || (m_Player && m_Player.IsInVehicle()) || invLocation.GetType() != InventoryLocationType.GROUND)
757 m_Hidden = true;
758 }
759 }
761 protected string GetActionDesc(ActionBase action)
762 {
763 string desc = "";
764 if (action && action.GetText())
765 {
766 desc = action.GetText();
767
768 if (desc && action.DisplayTargetInActionText())
769 string extraDescription = action.GetTargetName(m_Player, m_Target);
770 if (extraDescription)
771 desc = string.Format("%1 (%2)", desc, extraDescription);
772 }
773
774 return desc;
775 }
776
777 //Getting NAME of the entity
778 protected string GetItemDesc(ActionBase action)
779 {
780 string desc = "";
782 if (!tgObject && m_Target)
783 {
784 tgObject = m_Target.GetObject();
785 }
786
787 if (tgObject)
788 {
789 //BreakOut if item is ruined
790 Object tgParent = m_Target.GetParent();
791 if (!tgObject.IsAlive())
792 {
793 //Fetch parent item name if one is present
794 if (!tgParent || tgObject.DisplayNameRuinAttach())
795 desc = tgObject.GetDisplayName();
796 else
797 desc = tgParent.GetDisplayName();
798 return desc;
799 }
800
801 EntityAI targetEntity;
802
803 if (tgParent && (tgParent.IsItemBase() || tgParent.IsTransport()))
804 {
805 targetEntity = EntityAI.Cast(tgParent);
806 }
807
808 if (tgObject.IsItemBase() || tgObject.IsTransport())
809 {
810 targetEntity = EntityAI.Cast(tgObject);
811 }
812
813 if (targetEntity && targetEntity.ShowZonesHealth())
814 {
815 string zone = "";
816
817 array<string> selections = new array<string>();
818
819 //NOTE: relevant fire geometry and view geometry selection names MUST match in order to get a valid damage zone
820 if (targetEntity.IsInherited(TentBase) && TentBase.Cast(targetEntity).GetState() != TentBase.PACKED)
821 {
822 //This is really specific to tents, as they use proxies. Hence object must be used
823 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity, tgObject.GetActionComponentName(m_Target.GetComponentIndex(), LOD.NAME_FIRE), zone))
824 {
825 desc = DamageSystem.GetDamageDisplayName(targetEntity, zone);
826 }
827 }
828 else
829 {
830 targetEntity.GetActionComponentNameList(m_Target.GetComponentIndex(), selections, LOD.NAME_VIEW);
831
832 //Important to get display name from component tied to multiple selections
833 for (int s = 0; s < selections.Count(); s++)
834 {
835 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity, selections[s], zone))
836 {
837 desc = DamageSystem.GetDamageDisplayName(targetEntity, zone);
838 }
839 }
840 }
841 }
842
843 //Safety check to output something to widget
844 if (targetEntity && desc == "")
845 desc = targetEntity.GetDisplayName();
846 }
847
848 return desc;
849 }
851 protected int GetItemHealth()
852 {
853 int health = -1;
854
855 if (m_Interact && !m_Interact.HasTarget())
856 {
857 return health;
858 }
859
861 if (!tgObject && m_Target)
862 {
863 tgObject = m_Target.GetObject();
864 }
865
866 if (tgObject)
867 {
868 Object tgParent = m_Target.GetParent();
869 EntityAI targetEntity;
870
871 //Return specific part health, even if display name is from parent
872 if (!tgObject.IsAlive())
873 {
874 EntityAI ent;
875 if (m_TargetItemFrozen && Class.CastTo(ent,tgObject) && (ent.IsAnimal() || ent.IsMan() || ent.IsZombie()))
876 health = -2; //frozen interaction later
877 else
878 health = tgObject.GetHealthLevel();
879
880 return health;
881 }
882
883 if (tgParent && (tgParent.IsItemBase() || tgParent.IsTransport()))
884 {
885 targetEntity = EntityAI.Cast(tgParent);
886 }
887
888 if (tgObject.IsItemBase() || tgObject.IsTransport())
889 {
890 targetEntity = EntityAI.Cast(tgObject);
891 }
892
893 if (targetEntity)
894 {
895 if (!targetEntity.IsDamageDestroyed())
896 {
897 string zone = "";
898 array<string> selections = new array<string>();
899
900 if (targetEntity.IsInherited(TentBase) && TentBase.Cast(targetEntity).GetState() != TentBase.PACKED)
901 {
902 //This is really specific to tents, as they use proxies. Hence object must be used
903 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity, tgObject.GetActionComponentName(m_Target.GetComponentIndex(), LOD.NAME_FIRE), zone))
904 {
905 health = targetEntity.GetHealthLevel(zone);
906 }
907 }
908 else
909 {
910 //NOTE: relevant view geometry and view geometry selection names MUST match in order to get a valid damage zone
911 targetEntity.GetActionComponentNameList(m_Target.GetComponentIndex(), selections, LOD.NAME_VIEW);
912
913 for (int s = 0; s < selections.Count(); s++)
914 {
915 if (DamageSystem.GetDamageZoneFromComponentName(targetEntity , selections[s], zone))
916 {
917 health = targetEntity.GetHealthLevel(zone);
918 break;
919 }
920 }
921 }
922
923 if (zone == "")
924 health = targetEntity.GetHealthLevel();
925 }
926 }
927 else
928 {
929 health = tgObject.GetHealthLevel();
930 }
931 }
932
933 return health;
934 }
936 protected bool GetItemFrozen()
937 {
939 if (!tgObject && m_Target)
940 tgObject = m_Target.GetObject();
941
942 if (tgObject)
943 {
944 Object tgParent = m_Target.GetParent();
945 EntityAI targetEntity;
946
947 if (tgParent)
948 {
949 targetEntity = EntityAI.Cast(tgParent);
950 }
951 else
952 {
953 targetEntity = EntityAI.Cast(tgObject);
954 }
955
956 return (targetEntity && targetEntity.GetIsFrozen());
957 }
958
959 return false;
960 }
962 protected void GetItemQuantity(out int q_type, out float q_cur, out int q_min, out int q_max)
963 {
964 InventoryItem item = null;
965
966 if (m_Interact && !m_Interact.HasTarget())
967 {
968 return;
969 }
970
972 if (!tgObject && m_Target)
973 {
974 tgObject = m_Target.GetObject();
975 }
976
977 if (Class.CastTo(item, tgObject))
978 {
980 if (q_type > 0)
981 QuantityConversions.GetItemQuantity(item, q_cur, q_min, q_max);
982 }
983 }
984
985 //! returns number of items in cargo for targeted entity
986 protected void GetItemCargoCount(out int cargoCount)
987 {
988 EntityAI entity = null;
989
991 if (!tgObject && m_Target)
992 {
993 tgObject = m_Target.GetObject();
994 }
995
996 if (Class.CastTo(entity, tgObject))
997 {
998
999 GameInventory inventory = entity.GetInventory();
1000 if (inventory)
1001 {
1002 cargoCount = AttachmentsWithInventoryOrCargoCount(inventory);
1003 return;
1004 }
1005
1007 cargoCount = 0;
1008 }
1009 }
1010
1011 // setters
1012 protected void SetItemDesc(string descText, int cargoCount, string itemWidget, string descWidget)
1013 {
1014 Widget widget;
1015 widget = m_Root.FindAnyWidget(itemWidget);
1016
1018 PlayerBase playerT = PlayerBase.Cast(m_Target.GetObject());
1019 if (playerT)
1020 string msg = playerT.GetLastUAMessage();
1021
1022 if (descText.Length() == 0 && msg.Length() == 0)
1023 {
1024 widget.Show(false);
1025 return;
1026 }
1027
1028 descText.ToUpper();
1029 TextWidget itemName;
1030 Class.CastTo(itemName, widget.FindAnyWidget(descWidget));
1031
1033 if (cargoCount > 0)
1034 descText = string.Format("[+] %1 %2", descText, msg);
1035 else
1036 descText = string.Format("%1 %2", descText, msg);
1037
1038 itemName.SetText(descText);
1039 widget.Show(true);
1040 }
1042 protected void SetItemHealth(int health, string itemWidget, string healthWidget, bool enabled)
1043 {
1044 Widget widget = m_Root.FindAnyWidget(itemWidget);
1045
1046 if (enabled)
1047 {
1048 ImageWidget healthMark;
1049 Class.CastTo(healthMark, widget.FindAnyWidget(healthWidget));
1050
1051 if (health == -1)
1052 {
1053 healthMark.GetParent().Show(false);
1054 widget.Show(enabled);
1055 return;
1056 }
1057
1058 int color = 0x00FFFFFF;
1059 if (m_TargetItemFrozen && (health != GameConstants.STATE_RUINED || health == -2))
1060 color = Colors.COLOR_FROZEN;
1061 else
1062 color = ItemManager.GetItemHealthColor(health);
1063
1064 healthMark.SetColor(color);
1065 healthMark.SetAlpha(0.5);
1066 healthMark.GetParent().Show(true);
1067 }
1068
1069 widget.Show(enabled);
1070 }
1072 protected void SetItemQuantity(int type, float current, int min, int max, string itemWidget, string quantityPBWidget, string quantityTextWidget, bool enabled)
1073 {
1074 Widget widget;
1075
1076 widget = m_Root.FindAnyWidget(itemWidget);
1077
1078 if (enabled)
1079 {
1080 ProgressBarWidget progressBar;
1081 TextWidget textWidget;
1082 Class.CastTo(progressBar, widget.FindAnyWidget(quantityPBWidget));
1083 Class.CastTo(textWidget, widget.FindAnyWidget(quantityTextWidget));
1084
1085 //check for volume vs. count and display progressbar or "bubble" with exact count/max text
1086 switch (type)
1087 {
1088 case QUANTITY_HIDDEN :
1089 progressBar.Show(false);
1090 textWidget.Show(false);
1091 textWidget.GetParent().Show(false);
1092 break;
1093 case QUANTITY_COUNT :
1094 if (max > 1 || current > 1)
1095 {
1096 string qty_text = string.Format("%1/%2", Math.Round(current).ToString(), max.ToString());
1097 progressBar.Show(false);
1098 textWidget.SetText(qty_text);
1099 textWidget.Show(true);
1100 textWidget.GetParent().Show(true);
1101 }
1102 else
1103 {
1104 progressBar.Show(false);
1105 textWidget.Show(false);
1106 textWidget.GetParent().Show(false);
1107 }
1108 break;
1109 case QUANTITY_PROGRESS :
1110 float qty_num = Math.Round((current / max) * 100);
1111
1112 textWidget.Show(false);
1113 progressBar.SetCurrent(qty_num);
1114 progressBar.Show(true);
1115 textWidget.GetParent().Show(true);
1116 break;
1117 }
1118 widget.Show(true);
1119 }
1120 else
1121 widget.Show(false);
1122 }
1124 protected void SetActionWidget(ActionBase action, string descText, string actionWidget, string descWidget)
1125 {
1126 Widget widget = m_Root.FindAnyWidget(actionWidget);
1127
1128 if (action)
1129 {
1130 if (action.HasTarget() && m_AM.GetActionState() < 1) // targeted & action not performing
1131 {
1132 TextWidget actionName;
1133 Class.CastTo(actionName, widget.FindAnyWidget(descWidget));
1134
1135 if (action.GetInput().GetInputType() == ActionInputType.AIT_CONTINUOUS)
1136 {
1137 descText = descText + " " + "#action_target_cursor_hold";
1138 actionName.SetText(descText);
1139 }
1140 else
1141 {
1142 actionName.SetText(descText);
1143 }
1144
1145 widget.Show(true);
1146
1147 int x, y;
1148 actionName.GetTextSize(x, y);
1149 if (x > m_MaxWidthChild);
1151 }
1152 else
1153 {
1154 widget.Show(false);
1155 }
1156 }
1157 else
1158 {
1159 widget.Show(false);
1160 }
1161 }
1162
1163 //! shows arrows near the interact action if there are more than one available
1164 protected void SetMultipleInteractAction(string multiActionsWidget, string multiActionsWidget_NotSelect)
1165 {
1166 Widget widget, widget_not_select;
1167
1168 widget = m_Root.FindAnyWidget(multiActionsWidget);
1169 widget_not_select = m_Root.FindAnyWidget(multiActionsWidget_NotSelect);
1170
1171 if (m_InteractActionsNum > 1)
1172 {
1174 {
1175 widget.Show(true);
1176 widget_not_select.Show(false);
1177 }
1178 else
1179 {
1180 widget.Show(false);
1181 widget_not_select.Show(true);
1182 }
1183 }
1184 else
1185 {
1186 widget.Show(false);
1187 widget_not_select.Show(false);
1188 }
1189 }
1191 protected void SetMultipleContinuousInteractAction(string multiActionsWidget, string multiActionsWidget_NotSelect)
1192 {
1193 Widget widget, widget_not_select;
1194
1195 widget = m_Root.FindAnyWidget(multiActionsWidget);
1196 widget_not_select = m_Root.FindAnyWidget(multiActionsWidget_NotSelect);
1197
1199 {
1201 {
1202 widget.Show(true);
1203 widget_not_select.Show(false);
1204 }
1205 else
1206 {
1207 widget.Show(false);
1208 widget_not_select.Show(true);
1209 }
1210 }
1211 else
1212 {
1213 widget.Show(false);
1214 widget_not_select.Show(false);
1215 }
1216
1217 }
1219 protected void SetMultipleItemAction(string multiActionsWidget, string multiActionsWidget_NotSelect)
1220 {
1221 Widget widget, widget_not_select;
1222
1223 widget = m_Root.FindAnyWidget(multiActionsWidget);
1224 widget_not_select = m_Root.FindAnyWidget(multiActionsWidget_NotSelect);
1225
1226 if (m_ItemActionsNum > 1)
1227 {
1229 {
1230 widget.Show(true);
1231 widget_not_select.Show(false);
1232 }
1233 else
1234 {
1235 widget.Show(false);
1236 widget_not_select.Show(true);
1237 }
1238 }
1239 else
1240 {
1241 widget.Show(false);
1242 widget_not_select.Show(false);
1243 }
1244 }
1246 protected void SetMultipleContinuousItemAction(string multiActionsWidget, string multiActionsWidget_NotSelect)
1247 {
1248 Widget widget, widget_not_select;
1249
1250 widget = m_Root.FindAnyWidget(multiActionsWidget);
1251 widget_not_select = m_Root.FindAnyWidget(multiActionsWidget_NotSelect);
1252
1254 {
1256 {
1257 widget.Show(true);
1258 widget_not_select.Show(false);
1259 }
1260 else
1261 {
1262 widget.Show(false);
1263 widget_not_select.Show(true);
1264 }
1265 }
1266 else
1267 {
1268 widget.Show(false);
1269 widget_not_select.Show(false);
1270 }
1271 }
1273 protected void SetInteractActionIcon(string actionWidget, string actionIconFrameWidget, string actionIconWidget, string actionIconTextWidget)
1274 {
1275 Widget widget;
1276 ImageWidget iconWidget;
1277 TextWidget textWidget;
1278
1279 widget = m_Root.FindAnyWidget(actionWidget);
1280 Class.CastTo(iconWidget, widget.FindAnyWidget(actionIconWidget));
1281 Class.CastTo(textWidget, widget.FindAnyWidget(actionIconTextWidget));
1282
1283 GetDayZGame().GetBacklit().HintShow(m_UseActionWrapper.InputP());
1284
1285 // uses text in floating widget
1286 iconWidget.Show(false);
1287 textWidget.SetText(InputUtils.GetButtonNameFromInput("UAAction", EInputDeviceType.MOUSE_AND_KEYBOARD));
1288 textWidget.Show(true);
1289 }
1291 protected void CheckRefresherFlagVisibilityEx(ActionTarget target)
1292 {
1293 EntityAI entity = EntityAI.Cast(target.GetObject());
1294 if (!entity)
1295 entity = EntityAI.Cast(target.GetParent());
1296
1297 if (!entity)
1298 return;
1299
1300 Widget w = m_Root.FindAnyWidget("item_flag_icon");
1301 if (w)
1302 w.Show(entity.IsRefresherSignalingViable() && m_Player.IsTargetInActiveRefresherRange(entity));
1303 }
1305 protected int AttachmentsWithInventoryOrCargoCount(notnull GameInventory inventory)
1306 {
1307 int attachmentsWithInventory = 0;
1308
1309 CargoBase cargo = inventory.GetCargo();
1310 if (cargo && cargo.GetItemCount() > 0)
1311 {
1312 return 1;
1313 }
1314
1315 for (int i = 0; i < inventory.AttachmentCount(); i++)
1316 {
1317 EntityAI attachment = inventory.GetAttachmentFromIndex(i);
1318 int attachmentSlotId = attachment.GetInventory().GetSlotId(0);
1319
1320 if (attachment.GetInventory())
1321 {
1322 attachmentsWithInventory += 1;
1323 }
1324 }
1325
1326 return attachmentsWithInventory;
1327 }
1329 protected IngameHud GetHud()
1330 {
1332 if (mission)
1333 {
1334 IngameHud hud = IngameHud.Cast(mission.GetHud());
1335 return hud;
1336 }
1337
1338 return null;
1339 }
1340
1341 // deprecated
1342 protected void CheckRefresherFlagVisibility(Object object);
1343}
eBleedingSourceType GetType()
Определения BleedingSource.c:63
void ContinuousDefaultActionInput(PlayerBase player)
Определения ActionInput.c:607
ActionInputType
Определения ActionInput.c:2
class ActionTargets ActionTarget
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
override bool HasFixedActionTargetCursorPosition()
Определения DayZAnimal.c:120
DayZGame GetDayZGame()
Определения DayZGame.c:3870
Mission mission
Определения DisplayStatus.c:28
Icon x
Icon y
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
proto native UAInputAPI GetUApi()
vector m_CursorWPos
Определения ActionTargetsCursor.c:4
void Store(Object obj, vector pos, int compIdx)
cache object and its world pos
Определения ActionTargetsCursor.c:16
vector GetCursorWorldPos()
Определения ActionTargetsCursor.c:42
Object m_CachedObject
Определения ActionTargetsCursor.c:3
int m_CompIdx
Определения ActionTargetsCursor.c:6
Object Get()
Определения ActionTargetsCursor.c:37
void ATCCachedTarget()
Определения ActionTargetsCursor.c:8
vector m_ScreenPos
Определения ActionTargetsCursor.c:5
void Invalidate()
invalidate cached objec
Определения ActionTargetsCursor.c:27
int GetCursorCompIdx()
Определения ActionTargetsCursor.c:47
bool DisplayTargetInActionText()
Определения ActionBase.c:393
bool HasTarget()
Определения ActionBase.c:244
string GetTargetName(PlayerBase player, ActionTarget target)
Определения ActionBase.c:414
ActionInput GetInput()
Определения ActionBase.c:1311
string GetText()
Определения ActionBase.c:298
Определения ActionBase.c:53
int GetInputType()
Определения ActionInput.c:89
void UpdatePCIconsVisibility()
Contains logic for icon set switching (Gamepad/M&K)
Определения ActionTargetsCursor.c:183
void SetItemHealth(int health, string itemWidget, string healthWidget, bool enabled)
Определения ActionTargetsCursor.c:1041
string GetItemDesc(ActionBase action)
Определения ActionTargetsCursor.c:777
void GetActionManager()
Определения ActionTargetsCursor.c:688
void SetItemQuantity(int type, float current, int min, int max, string itemWidget, string quantityPBWidget, string quantityTextWidget, bool enabled)
Определения ActionTargetsCursor.c:1071
void SetItemDesc(string descText, int cargoCount, string itemWidget, string descWidget)
Определения ActionTargetsCursor.c:1011
void ActionTargetsCursor()
Определения ActionTargetsCursor.c:94
Widget m_Root
Определения ActionTargetsCursor.c:85
ActionBase m_Interact
Определения ActionTargetsCursor.c:65
void SetXboxIcon(string name, string imageset_name, string image_name)
bool IsComponentInSelection(array< Selection > selection, string compName)
Определения ActionTargetsCursor.c:676
void GetItemQuantity(out int q_type, out float q_cur, out int q_min, out int q_max)
Определения ActionTargetsCursor.c:961
const ref array< typename > VISION_OBSTRUCTION_PPEFFECTS_TYPES
Определения ActionTargetsCursor.c:55
void SetInteractXboxIcon(string imageset_name, string image_name)
DEPRECATED.
void SetContinuousXboxIcon(string imageset_name, string image_name)
void GetOnScreenPosition(out float x, out float y)
Определения ActionTargetsCursor.c:471
void SetMultipleItemAction(string multiActionsWidget, string multiActionsWidget_NotSelect)
Определения ActionTargetsCursor.c:1218
m_SelectedActionCategory
Определения ActionTargetsCursor.c:78
void SetMultipleContinuousItemAction(string multiActionsWidget, string multiActionsWidget_NotSelect)
Определения ActionTargetsCursor.c:1245
float m_MaxWidthChild
widget width
Определения ActionTargetsCursor.c:90
void SetQuantityVisibility(bool state)
Определения ActionTargetsCursor.c:126
void BuildFixedCursor()
Определения ActionTargetsCursor.c:230
bool m_TargetItemFrozen
Определения ActionTargetsCursor.c:83
void UpdateControllerInputIcons()
Loads icons from the latest keybinds.
Определения ActionTargetsCursor.c:174
int m_ItemActionsNum
Определения ActionTargetsCursor.c:76
void SetHealthVisibility(bool state)
Определения ActionTargetsCursor.c:121
PlayerBase m_Player
Определения ActionTargetsCursor.c:60
void SetContinuousInteractXboxIcon(string imageset_name, string image_name)
ActionTarget m_Target
Определения ActionTargetsCursor.c:61
int GetItemHealth()
Определения ActionTargetsCursor.c:850
IngameHud GetHud()
Определения ActionTargetsCursor.c:1328
void HideWidget()
Определения ActionTargetsCursor.c:296
override bool OnUpdate(Widget w)
Определения ActionTargetsCursor.c:285
bool m_FixedOnPosition
Определения ActionTargetsCursor.c:81
void OnInputPresetChanged()
Определения ActionTargetsCursor.c:161
int m_ContinuousInteractActionsNum
Определения ActionTargetsCursor.c:75
void GetItemCargoCount(out int cargoCount)
returns number of items in cargo for targeted entity
Определения ActionTargetsCursor.c:985
void Update()
Определения ActionTargetsCursor.c:305
void SetControllerIcon(string pWidgetName, string pInputName)
Определения ActionTargetsCursor.c:139
void CheckRefresherFlagVisibilityEx(ActionTarget target)
Определения ActionTargetsCursor.c:1290
Object m_DisplayInteractTarget
Определения ActionTargetsCursor.c:63
bool m_QuantityEnabled
Определения ActionTargetsCursor.c:80
void SetActionWidget(ActionBase action, string descText, string actionWidget, string descWidget)
Определения ActionTargetsCursor.c:1123
void GetActions()
get actions from Action Manager
Определения ActionTargetsCursor.c:701
bool m_HealthEnabled
Определения ActionTargetsCursor.c:79
int m_ContinuousItemActionsNum
Определения ActionTargetsCursor.c:77
ActionBase m_ContinuousInteract
Определения ActionTargetsCursor.c:66
void OnWidgetScriptInit(Widget w)
Определения ActionTargetsCursor.c:145
string GetActionDesc(ActionBase action)
Определения ActionTargetsCursor.c:760
void SetMultipleInteractAction(string multiActionsWidget, string multiActionsWidget_NotSelect)
shows arrows near the interact action if there are more than one available
Определения ActionTargetsCursor.c:1163
void SetInteractActionIcon(string actionWidget, string actionIconFrameWidget, string actionIconWidget, string actionIconTextWidget)
Определения ActionTargetsCursor.c:1272
Widget m_ItemLeft
Определения ActionTargetsCursor.c:87
vector TransformToScreenPos(vector pWorldPos)
transform world pos to screen pos (related to parent widget size)
Определения ActionTargetsCursor.c:454
bool m_Hidden
Определения ActionTargetsCursor.c:82
float m_RootHeight
Определения ActionTargetsCursor.c:92
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Определения ActionTargetsCursor.c:168
void SetSingleXboxIcon(string imageset_name, string image_name)
int AttachmentsWithInventoryOrCargoCount(notnull GameInventory inventory)
Определения ActionTargetsCursor.c:1304
void SetMultipleContinuousInteractAction(string multiActionsWidget, string multiActionsWidget_NotSelect)
Определения ActionTargetsCursor.c:1190
IngameHud m_Hud
Определения ActionTargetsCursor.c:70
ref ATCCachedObject m_CachedObject
Определения ActionTargetsCursor.c:62
void PrepareCursorContent()
Определения ActionTargetsCursor.c:196
Widget m_Container
Определения ActionTargetsCursor.c:86
ActionBase m_Continuous
Определения ActionTargetsCursor.c:68
ActionBase m_Single
Определения ActionTargetsCursor.c:67
UAIDWrapper m_UseActionWrapper
Определения ActionTargetsCursor.c:72
ActionManagerClient m_AM
Определения ActionTargetsCursor.c:69
void ShowXboxHidePCIcons(string widget, bool show_xbox_icon)
Определения ActionTargetsCursor.c:446
void ~ActionTargetsCursor()
Определения ActionTargetsCursor.c:118
void GetPlayer()
Определения ActionTargetsCursor.c:683
float m_RootWidth
Определения ActionTargetsCursor.c:91
int m_InteractActionsNum
Определения ActionTargetsCursor.c:74
bool GetItemFrozen()
Определения ActionTargetsCursor.c:935
void GetTarget()
Определения ActionTargetsCursor.c:743
void BuildFloatingCursor(bool forceRebuild)
Определения ActionTargetsCursor.c:242
proto native vector GetScreenPosRelative(vector world_pos)
Transforms position in world to position in screen in percentage (0.0 - 1.0) as x,...
proto native Input GetInput()
proto native Mission GetMission()
proto native int GetItemCount()
represents base for cargo storage for entities
Определения Cargo.c:7
Super root of all classes in Enforce script.
Определения EnScript.c:11
const int COLOR_FROZEN
Определения Colors.c:42
Определения Colors.c:4
override bool ShowZonesHealth()
Определения Transport.c:161
override bool IsMan()
Определения Man.c:44
Определения Building.c:6
Определения constants.c:659
script counterpart to engine's class Inventory
Определения Inventory.c:79
proto native EInputDeviceType GetCurrentInputDevice()
proto native bool IsEnabledMouseAndKeyboardEvenOnServer()
static string GetButtonNameFromInput(string pInputName, int pInputDeviceType)
Определения InputUtils.c:17
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Определения InputUtils.c:167
Определения InputUtils.c:2
Определения ItemBase.c:15
proto native int GetType()
returns type of InventoryLocation
InventoryLocation.
Определения InventoryLocation.c:29
override bool IsTakeable()
Определения BaseBuildingBase.c:988
Определения InventoryItem.c:731
static int GetItemHealthColor(int pHealthLevel)
Определения ItemManager.c:417
Определения ItemManager.c:2
static const string NAME_FIRE
Определения gameplay.c:208
static const string NAME_MEMORY
Определения gameplay.c:209
static const string NAME_VIEW
Определения gameplay.c:207
proto native bool GetSelections(notnull out array< Selection > selections)
LOD class.
Определения gameplay.c:204
Определения EnMath.c:7
ScriptInvoker GetOnInputDeviceChanged()
Определения gameplay.c:851
ScriptInvoker GetOnInputPresetChanged()
Определения gameplay.c:859
Mission class.
Определения gameplay.c:687
Определения ObjectTyped.c:2
static PPEManager GetPPEManager()
Returns the manager instance singleton.
Определения PPEManager.c:27
Static component of PPE manager, used to hold the instance.
Определения PPEManager.c:3
Определения PlayerBaseClient.c:2
static float GetItemQuantity(InventoryItem item)
Определения QuantityConversions.c:72
static int HasItemQuantity(notnull EntityAI item)
Определения QuantityConversions.c:143
Определения gameplay.c:317
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
void CheckRefresherFlagVisibility()
Определения ItemActionsWidget.c:707
map: item x vector(index, width, height)
Определения EnWidgets.c:651
Определения CarTent.c:2
Определения EnWidgets.c:220
Определения UAInput.c:15
proto native UAIDWrapper GetPersistentWrapper()
proto native UAInput GetInputByID(int iID)
returns list of all bindable (i.e. visible) inputs from the active group ('core' by default)
Определения EnWidgets.c:190
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString(bool simple=true)
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static const vector Zero
Определения EnConvert.c:110
Определения EnConvert.c:106
proto native CGame GetGame()
const int QUANTITY_PROGRESS
Определения constants.c:516
const int QUANTITY_COUNT
Определения constants.c:515
const int QUANTITY_HIDDEN
Определения constants.c:514
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int STATE_RUINED
Определения constants.c:846
static proto float Round(float f)
Returns mathematical round of value.
static proto float Ceil(float f)
Returns ceil of value.
static proto float AbsFloat(float f)
Returns absolute value.
proto void GetScreenSize(out int x, out int y)
proto native int Length()
Returns length of string.
proto int ToUpper()
Changes string to uppercase. Returns length.
bool Contains(string sample)
Returns true if sample is substring of string.
Определения EnString.c:286
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 native owned string GetName()
Test name getter. Strictly for UI porposes!
Определения SyncedValue.c:119
EInputDeviceType
Определения input.c:3