DayZ 1.24
Loading...
Searching...
No Matches
Container.c
Go to the documentation of this file.
2{
5 protected int m_ActiveIndex = 0;
6 protected bool m_LastIndex; //deprecated
7 protected bool m_Closed;
9 protected float m_PrevAlpha;
10 const int ITEMS_IN_ROW = 8;
11
12 //protected int m_RowCount;
13 protected int m_ColumnCount;
14
15 protected int m_FocusedColumn = 0;
16 protected bool m_ForcedHide;
17 protected bool m_ForcedShow; //used to override displayability condition, but 'm_ForcedHide' takes preference
18
20 protected EntityAI m_Entity;
21
22 const int SORT_ATTACHMENTS_OWN = 1; //direct attachments of the parent item
23 const int SORT_CARGO_OWN = 2; //cargo of the parent item
24 const int SORT_ATTACHMENTS_NEXT_OFFSET = 2;
25 const int SORT_CARGO_NEXT_OFFSET = 3;
26
34
36 {
37 m_Body = new array<ref LayoutHolder>;
38 m_OpenedContainers = new array<LayoutHolder>;
39 m_PrevAlpha = m_RootWidget.GetAlpha();
40 m_SlotIcon = null;
41 m_ForcedHide = false;
42 m_ForcedShow = false;
43
44 m_ActiveIndex = 0;
45 m_IsActive = false;
46 }
47
49 {
50 if (m_ActiveIndex < m_OpenedContainers.Count())
51 return Container.Cast(m_OpenedContainers[m_ActiveIndex]);
52 return null;
53 }
54
56 {
57 if (index < m_Body.Count())
58 return Container.Cast(m_Body[index]);
59 return null;
60 }
61
62
64 {
65 m_FocusedContainer = cont;
66 }
67
69 {
70 Container c = GetFocusedContainer();
71 if (c)
72 return c.GetFocusedSlotsIcon();
73 return null;
74 }
75
77 {
78 return m_ActiveIndex;
79 }
80
82 {
83 m_ActiveIndex = index;
84 }
85
87 {
88 return null;
89 }
90
92 {
93 if (m_SlotIcon)
94 m_SlotIcon.GetRadialIconPanel().Show(false);
95 }
96
98 {
99 m_SlotIcon = icon;
100 }
101
103 {
104 m_ActiveIndex = 0;
105 }
106
108 {
109 m_ActiveIndex = 0;
110 m_FocusedColumn = 0;
111 if (m_OpenedContainers.Count() > 0)
112 m_ActiveIndex = m_OpenedContainers.Count() - 1;
113 }
114
115 void Unfocus()
116 {
117 }
118
120 {
121 if (direction == Direction.UP)
123 else if (direction == Direction.DOWN)
125 else if (direction == Direction.RIGHT)
127 else if (direction == Direction.LEFT)
129
130 UpdateSelectionIcons();
131
132 Inventory.GetInstance().UpdateConsoleToolbar();
133 }
134
136 {
137 ScrollWidget sw = GetScrollWidget();
138 if (sw)
139 {
140 float x, y, y_s;
141
142 sw.GetScreenPos(x, y);
143 sw.GetScreenSize(x, y_s);
144 float f_y, f_h;
145 float amount;
148
149 float next_pos = f_y + f_h;
150
151 if (next_pos > (y + y_s))
152 {
153 amount = sw.GetVScrollPos() + next_pos - (y + y_s) + 2;
154 sw.VScrollToPos(amount);
155 }
156 else if (f_y < y)
157 {
158 amount = sw.GetVScrollPos() + f_y - y - 2;
159 sw.VScrollToPos(amount);
160 }
161
162 //CheckScrollbarVisibility();
163 }
164 }
165
167 {
168 ScrollWidget sw = GetScrollWidget();
169 if (sw)
170 {
171 if (!sw.IsScrollbarVisible())
172 sw.VScrollToPos01(0.0);
173 else if (sw.GetVScrollPos01() > 1.0)
174 sw.VScrollToPos01(1.0);
175 }
176 }
177
178 void Open()
179 {
180 m_Closed = false;
181 UpdateSelectionIcons();
182 }
183
184 void Close()
185 {
186 m_Closed = true;
187 UpdateSelectionIcons();
188 }
189
190 bool IsOpened()
191 {
192 return !m_Closed;
193 }
194
195 void SetOpenForSlotIcon(bool open, SlotsIcon icon = null/*m_SlotIcon*/)
196 {
197 if (!icon)
198 icon = m_SlotIcon;
199
200 if (icon)
201 {
202 icon.GetRadialIcon().Show(open);
203 icon.GetRadialIconClosed().Show(!open);
204 }
205 /*else
206 {
207 ErrorEx("Dbg No Icon");
208 }*/
209 }
210
211 void Toggle()
212 {
213 if (IsOpened())
214 Close();
215 else
216 Open();
217 SetOpenForSlotIcon(IsOpened());
218 }
219
221 {
222 float x, y, result;
223 if (GetFocusedContainer())
224 y = GetFocusedContainer().GetFocusedContainerHeight(contents);
225 else if (GetRootWidget())
226 GetRootWidget().GetScreenSize(x, y);
227
228 result = y;
229
230 if (m_ActiveIndex == 0)
231 {
232 if (GetHeader())
233 {
234 GetHeader().GetRootWidget().GetScreenSize(x, y);
235 result += y;
236 }
237 }
238 return result;
239 }
240
242 {
243 float x, y;
244 if (GetFocusedContainer())
245 y = GetFocusedContainer().GetFocusedContainerYPos(contents);
246 else if (GetRootWidget())
247 GetRootWidget().GetPos(x, y);
248
249 return y;
250 }
251
253 {
254 float x, y, result;
255 if (GetFocusedContainer())
256 y = GetFocusedContainer().GetFocusedContainerYScreenPos(contents);
257 else if (GetRootWidget())
258 GetRootWidget().GetScreenPos(x, y);
259
260
261 result = y;
262
263 if (m_ActiveIndex == 0)
264 {
265 if (GetHeader())
266 {
267 GetHeader().GetRootWidget().GetScreenPos(x, y);
268 result = y;
269 }
270 }
271 return result;
272 }
273
274 int Count()
275 {
276 return m_Body.Count();
277 }
278
280 {
281 if (GetFocusedContainer())
282 return GetFocusedContainer().SelectItem();
283 return false;
284 }
285
286 bool Select()
287 {
288 if (GetFocusedContainer())
289 return GetFocusedContainer().Select();
290 return false;
291 }
292
294 {
295 if (GetFocusedContainer())
296 return GetFocusedContainer().OnSelectButton();
297 return false;
298 }
299
300 bool Combine()
301 {
302 if (GetFocusedContainer())
303 return GetFocusedContainer().Combine();
304 return true;
305 }
306
308 {
309 if (GetFocusedContainer())
310 return GetFocusedContainer().TransferItemToVicinity();
311 return false;
312 }
313
315 {
316 if (GetFocusedContainer())
317 return GetFocusedContainer().TransferItem();
318 return false;
319 }
320
322 {
323 if (GetFocusedContainer())
324 return GetFocusedContainer().InspectItem();
325 return false;
326 }
327
329 {
330 if (GetFocusedContainer())
331 return GetFocusedContainer().SplitItem();
332 return false;
333 }
334
336 {
337 if (GetFocusedContainer())
338 return GetFocusedContainer().EquipItem();
339 return false;
340 }
341
343 {
344 if (ItemManager.GetInstance().IsMicromanagmentMode())
345 return false;
346
348 if (focusedEntity)
349 {
350 if (GetFocusedContainer())
351 return GetFocusedContainer().CanOpenCloseContainerEx(focusedEntity);
352
353 return CanOpenCloseContainerEx(focusedEntity);
354 }
355
356 return false;
357 }
358
360 {
361 return false;
362 }
363
364 bool CanSplit()
365 {
367 if (focusedEntity)
368 {
369 if (GetFocusedContainer())
370 return GetFocusedContainer().CanSplitEx(focusedEntity);
371
372 return CanSplitEx(focusedEntity);
373 }
374
375 return false;
376 }
377
379 {
380 if (ItemManager.GetInstance().IsMicromanagmentMode())
381 return false;
382
383 if (focusedEntity)
384 return focusedEntity.CanBeSplit();
385 return false;
386 }
387
388 bool CanDrop()
389 {
391 if (focusedEntity)
392 {
393 if (GetFocusedContainer())
394 return GetFocusedContainer().CanDropEx(focusedEntity);
395
396 return CanDropEx(focusedEntity);
397
398 }
399
400 return false;
401 }
402
404 {
405 if (ItemManager.GetInstance().IsMicromanagmentMode())
406 return false;
407
408 if (focusedEntity)
409 {
411
412 if (player)
413 return player.CanDropEntity(focusedEntity);
414 }
415 return false;
416 }
417
419 {
421 if (focusedEntity)
422 {
423 if (GetFocusedContainer())
424 return GetFocusedContainer().CanSwapOrTakeToHandsEx(focusedEntity);
425
426 return CanSwapOrTakeToHandsEx(focusedEntity);
427 }
428
429 return false;
430 }
431
433 {
434 if (ItemManager.GetInstance().IsMicromanagmentMode())
435 return false;
436
437 if (focusedEntity)
438 {
440 EntityAI entityInHands = player.GetItemInHands();
441 if (entityInHands)
442 {
444
447 else
448 return true;
449 }
450 else
451 return player.GetInventory().CanAddEntityIntoHands(focusedEntity);
452 }
453 return false;
454 }
455
456 bool CanEquip()
457 {
459 if (focusedEntity)
460 {
461 if (GetFocusedContainer())
462 return GetFocusedContainer().CanEquipEx(focusedEntity);
463
464 return CanEquipEx(focusedEntity);
465 }
466
467 return false;
468 }
469
471 {
472 if (ItemManager.GetInstance().IsMicromanagmentMode())
473 return false;
474
475 bool found = false;
476 if (focusedEntity)
477 {
480 found = player.GetInventory().FindFreeLocationFor(focusedEntity, FindInventoryLocationType.ATTACHMENT, il);
481
482 if (!found)
483 {
484 for (int i = 0; i < focusedEntity.GetInventory().GetSlotIdCount(); i++)
485 {
486 int slot_id = focusedEntity.GetInventory().GetSlotId(i);
487 EntityAI slot_item = player.GetInventory().FindAttachment(slot_id);
488 if (slot_item && player.GetInventory().CanSwapEntitiesEx(focusedEntity, slot_item))
489 {
490 found = true;
491 break;
492 }
493
494 }
495 }
496 }
497 return found;
498 }
499
501 {
503 if (focusedEntity)
504 {
505 if (GetFocusedContainer())
506 return GetFocusedContainer().CanTakeToInventoryEx(focusedEntity);
507
508 return CanTakeToInventoryEx(focusedEntity);
509 }
510
511 return false;
512 }
513
515 {
516 if (ItemManager.GetInstance().IsMicromanagmentMode())
517 return false;
518
519 if (focusedEntity)
520 {
522 return player.GetInventory().CanAddEntityToInventory(focusedEntity, FindInventoryLocationType.CARGO);
523 }
524 return false;
525 }
526
528 {
530 if (focusedEntity)
531 {
532 if (GetFocusedContainer())
533 return GetFocusedContainer().CanCombineEx(focusedEntity);
534
535 return CanCombineEx(focusedEntity);
536 }
537
538 return false;
539 }
540
542 {
543 if (ItemManager.GetInstance().IsMicromanagmentMode())
544 return false;
545
546 if (focusedEntity)
547 {
548 EntityAI entityInHands = PlayerBase.Cast(GetGame().GetPlayer()).GetItemInHands();
551 }
552 return false;
553 }
554
556 {
557 if (GetFocusedContainer())
558 return GetFocusedContainer().CanCombineAmmo();
559 return false;
560 }
561
563 {
564 if (ItemManager.GetInstance().IsMicromanagmentMode())
565 return false;
566
567 if (focusedEntity)
568 {
570 if (focusedEntity.GetHierarchyRootPlayer() == player)
571 return true;
572 }
573
574 return false;
575 }
576
578 {
579 if (CanAddToQuickbarEx(itemToAssign))
580 {
583 dpi = player.GetDayZPlayerInventory();
584
585 if (itemToAssign && dpi && !dpi.IsProcessing())
586 {
587 RadialQuickbarMenu.SetItemToAssign(itemToAssign);
588
589 //open radial quickbar menu
590 if (!GetGame().GetUIManager().IsMenuOpen(MENU_RADIAL_QUICKBAR))
591 RadialQuickbarMenu.OpenMenu(GetGame().GetUIManager().FindMenu(MENU_INVENTORY));
592 }
593 return true;
594 }
595 return false;
596 }
597
598 bool IsEmpty()
599 {
600 return m_OpenedContainers.Count() == 0;
601 }
602
604 {
605 if (GetFocusedContainer())
606 return GetFocusedContainer().IsItemActive();
607 return false;
608 }
609
611 {
612 if (GetFocusedContainer())
613 return GetFocusedContainer().IsItemWithQuantityActive();
614 return false;
615 }
616
618 {
620 if (GetFocusedContainer())
621 item = GetFocusedContainer().GetFocusedItem();
622
623 return item;
624 }
625
627 {
629 if (GetFocusedContainer())
630 item = GetFocusedContainer().GetFocusedContainerEntity();
631 return item;
632 }
633
635 {
636 return m_ColumnCount;
637 }
638
640 {
641 m_ColumnCount = count;
642 }
643
645 {
646 return m_FocusedColumn;
647 }
648
650 {
651 m_FocusedColumn = column;
652 }
653
654 override void UpdateInterval()
655 {
656 for (int i = 0; i < m_Body.Count(); i++)
657 {
658 if (m_Body.Get(i))
659 m_Body.Get(i).UpdateInterval();
660 }
661
663 }
664
665 override void SetLastActive()
666 {
667 if (m_IsActive)
668 {
669 m_IsActive = true;
670 if (m_OpenedContainers.Count())
671 {
672 SetLastFocus();
673 if (!m_OpenedContainers[m_ActiveIndex].IsActive())
674 {
675 for (int i = 0; i < m_OpenedContainers.Count() - 1; i++)
676 {
677 if (m_OpenedContainers[i].IsActive())
678 m_OpenedContainers[i].SetActive(false);
679 }
680 m_OpenedContainers[m_ActiveIndex].SetLastActive();
681 }
682 else
683 m_OpenedContainers[m_ActiveIndex].SetLastActive();
684 }
685 }
686 else
687 {
688 m_IsActive = true;
689 if (GetHeader())
690 GetHeader().SetActive(m_IsActive);
691 SetLastFocus();
692 if (m_OpenedContainers.Count())
693 {
694 Container c = Container.Cast(m_OpenedContainers.Get(m_ActiveIndex));
695 if (c)
696 c.SetLastActive();
697 }
698 }
699 }
700
701 override void SetFirstActive()
702 {
703 if (!m_IsActive)
704 SetActive(true);
705 else
706 {
707 if (m_OpenedContainers.Count())
708 {
710 if (!m_OpenedContainers[m_ActiveIndex].IsActive())
711 {
712 for (int i = 1; i < m_OpenedContainers.Count(); i++)
713 {
714 if (m_OpenedContainers[i].IsActive())
715 m_OpenedContainers[i].SetActive(false);
716 }
717 m_OpenedContainers[m_ActiveIndex].SetActive(true);
718 }
719 else
720 m_OpenedContainers[m_ActiveIndex].SetFirstActive();
721 }
722 }
723 }
724
725 override void SetActive(bool active)
726 {
727 if (!active)
728 HideOwnedTooltip();
729
730 if (!active && !m_IsActive)
731 return;
732
733 super.SetActive(active);
734 if (GetHeader())
735 GetHeader().SetActive(active);
736
737 if (m_MainWidget.FindAnyWidget("SelectedContainer"))
738 m_MainWidget.FindAnyWidget("SelectedContainer").Show(active);
739
740 Container c;
741 if (active)
742 {
743
745 if (m_OpenedContainers.Count())
746 {
747 c = Container.Cast(m_OpenedContainers.Get(m_ActiveIndex));
748 if (c)
749 c.SetActive(active);
750 }
751 }
752 else
753 {
754 c = GetFocusedContainer();
755 if (c)
756 GetFocusedContainer().SetActive(false);
757 Unfocus();
758 m_ActiveIndex = 0;
759 m_FocusedColumn = 0;
760 }
761 }
762
764 {
765 for (int i = 0; i < Count(); i++)
766 {
767 for (int j = 0; j < ITEMS_IN_ROW; j++)
768 {
770 if (Get(i) && Get(i).GetMainWidget())
771 Get(i).GetMainWidget().GetUserData(icon);
772
773 if (icon)
774 icon.GetCursorWidget().Show(false);
775 }
776 }
777 }
778
780 {
781 if (GetFocusedContainer())
782 {
783 m_FocusedColumn = 0;
784 GetFocusedContainer().UnfocusAll();
785 }
786 }
787
789 {
790 return m_ActiveIndex == (m_OpenedContainers.Count() - 1);
791 }
792
794 {
795 return m_ActiveIndex == 0;
796 }
797
799 {
800 return m_ActiveIndex == 0;
801 }
802
804 {
805 return m_ActiveIndex >= (m_OpenedContainers.Count() - 1);
806 }
807
809 {
810 if (GetFocusedContainer())
811 GetFocusedContainer().ResetFocusedContainer();
812
813 m_ActiveIndex == 0;
814 }
815
817 {
818 HideOwnedTooltip();
819
821 if (m_OpenedContainers.Count())
822 active = Container.Cast(m_OpenedContainers[m_ActiveIndex]);
823
824 if (active && active.IsActive())
825 active.SetNextActive();
826 if (!active || !active.IsActive())
827 {
829 if (!IsLastContainerFocused())
830 {
831 m_ActiveIndex++;
832
833 next = Container.Cast(m_OpenedContainers[m_ActiveIndex]);
834 next.SetActive(true);
835 }
836 else if (Container.Cast(GetParent()))
837 SetActive(false);
838 else
839 {
840 SetActive(false);
841 SetFirstActive();
842 }
843 }
844 }
845
846 void SetPreviousActive(bool force = false)
847 {
848 HideOwnedTooltip();
850 if (m_OpenedContainers.Count())
851 active = Container.Cast(m_OpenedContainers[m_ActiveIndex]);
852
853 if (active && active.IsActive())
854 active.SetPreviousActive();
855
856 if (!active || !active.IsActive())
857 {
859 if (!IsFirstContainerFocused())
860 {
861 m_ActiveIndex--;
862
863 prev = Container.Cast(m_OpenedContainers[m_ActiveIndex]);
864 prev.SetLastActive();
865 }
866 else if (Container.Cast(GetParent()))
867 SetActive(false);
868 else
869 {
870 SetActive(false);
872 }
873 }
874 }
875
877 {
879 if (m_OpenedContainers.Count())
880 active = Container.Cast(m_OpenedContainers[m_ActiveIndex]);
881
882 if (active)
883 active.SetNextRightActive();
884 }
885
887 {
889 if (m_OpenedContainers.Count())
890 active = Container.Cast(m_OpenedContainers[m_ActiveIndex]);
891
892 if (active)
893 active.SetNextLeftActive();
894 }
895
897 {
899 active = Container.Cast(m_OpenedContainers[m_ActiveIndex]);
900 active.SetActive(false);
901
902 m_ActiveIndex++;
903 if (m_ActiveIndex > m_OpenedContainers.Count() - 1)
904 m_ActiveIndex = 0;
905
906 active = Container.Cast(m_OpenedContainers[m_ActiveIndex]);
907 active.SetActive(true);
908 }
909
911 {
913 active = Container.Cast(m_OpenedContainers[m_ActiveIndex]);
914 active.SetActive(false);
915
916 m_ActiveIndex--;
917 if (m_ActiveIndex < 0)
918 m_ActiveIndex = m_OpenedContainers.Count() - 1;
919
920 active = Container.Cast(m_OpenedContainers[m_ActiveIndex]);
921 active.SetActive(true);
922 }
923
925 {
926 m_OpenedContainers.Clear();
927 int i;
928 bool need_reset_focus = false;
929 Container c;
930 for (i = 0; i < m_Body.Count(); i++)
931 {
932 c = Container.Cast(m_Body.Get(i));
933 if (c)
934 {
935 c.RecomputeOpenedContainers();
936 if (c.IsDisplayable() && c.IsVisible())
937 m_OpenedContainers.Insert(c);
938 else if (c.IsActive())
939 {
940 c.SetActive(false);
941 need_reset_focus = true;
942 }
943
944 }
945 }
946
947 //In case of removing focused container or change order of containers
948 if (IsActive())
949 {
950 if (!need_reset_focus && (m_ActiveIndex >= m_OpenedContainers.Count() || !m_OpenedContainers[m_ActiveIndex].IsActive()))
951 {
952 need_reset_focus = true;
953 for (i = 0; i < m_OpenedContainers.Count(); i++)
954 {
955 if (m_OpenedContainers[i].IsActive())
956 {
957 need_reset_focus = false;
958 m_ActiveIndex = i;
959 }
960 }
961 }
962
964 SetFirstActive();
965 }
966 }
967
968 override void SetLayoutName()
969 {
970 m_LayoutName = WidgetLayoutName.Container;
971 }
972
973 void Insert(LayoutHolder container, int pos = -1, bool immedUpdate = true)
974 {
975 if (pos > -1 && pos < m_Body.Count())
976 {
977 if (pos <= m_ActiveIndex)
978 m_ActiveIndex++;
979 m_Body.InsertAt(container, pos);
980 }
981 else
982 m_Body.Insert(container);
983
984 if (immedUpdate)
985 Refresh();
986 }
987
989 {
990 if (m_Body)
991 {
992 int index = m_Body.Find(container);
993 if (index > -1)
994 {
995 index = m_OpenedContainers.Find(container);
996 if (index > -1)
997 {
998 if (index <= m_ActiveIndex)
999 {
1000 if (GetFocusedContainer() == container)
1001 SetPreviousActive(true);
1002 else
1003 m_ActiveIndex--;
1004 }
1005 m_OpenedContainers.RemoveItem(container);
1006 }
1007 m_Body.RemoveItem(container);
1008 }
1009 }
1010
1011 Refresh();
1012 }
1013
1015 {
1016 return m_Body.Get(x);
1017 }
1018
1019 override void Refresh()
1020 {
1021 for (int i = 0; i < m_Body.Count(); i++)
1022 {
1023 if (m_Body.Get(i))
1024 m_Body.Get(i).Refresh();
1025 }
1026 }
1027
1029 {
1030 for (int i = 0; i < m_Body.Count(); i++)
1031 {
1032 Container c = Container.Cast(m_Body.Get(i));
1033 if (c && c.IsInherited(Container))
1034 c.UpdateSpacer();
1035 }
1036
1037 UpdateSpacer();
1038 }
1039
1040 void HideContent(bool force_hide = false)
1041 {
1042 if (!m_ForcedHide)
1043 m_ForcedHide = force_hide;
1044 for (int i = 0; i < m_Body.Count(); i++)
1045 {
1046 if (m_Body.Get(i))
1047 m_Body.Get(i).OnHide();
1048 }
1049 }
1050
1051 void ShowContent(bool force_show = false)
1052 {
1053 if (force_show)
1054 m_ForcedHide = false;
1055
1056 if (!m_ForcedHide)
1057 {
1058 for (int i = 0; i < m_Body.Count(); i++)
1059 {
1060 if (m_Body.Get(i))
1061 m_Body.Get(i).OnShow();
1062 }
1063 }
1064 }
1065
1067 {
1068 m_ForcedShow = value;
1069 }
1070
1071 override void UpdateSelectionIcons()
1072 {
1073 m_Parent.UpdateSelectionIcons();
1074 }
1075
1077}
const int ITEMS_IN_ROW
Definition Attachments.c:1
Direction
Definition Inventory.c:19
void Inventory(LayoutHolder parent)
Definition Inventory.c:76
bool IsOpened()
Icon x
Icon y
FindInventoryLocationType
flags for searching locations in inventory
bool m_IsActive
PlayerBase GetPlayer()
bool IsActive()
array< ref PlayerStatBase > Get()
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
Widget m_Parent
Definition SizeToChild.c:86
void SetActive()
Definition TrapBase.c:409
override void CheckHeaderDragability()
override void SetLastFocus()
override void SetNextActive()
override void Unfocus()
override EntityAI GetFocusedItem()
override float GetFocusedContainerHeight(bool contents=false)
override void Close()
override void Open()
override void SetPreviousActive(bool force=false)
override Header GetHeader()
override float GetFocusedContainerYScreenPos(bool contents=false)
override void SetDefaultFocus(bool while_micromanagment_mode=false)
override void SetNextLeftActive()
override void SetLastActive()
override void Refresh()
override void SetNextRightActive()
script counterpart to engine's class Inventory
Definition Inventory.c:79
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition Inventory.c:610
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
Definition Inventory.c:645
Definition Header.c:2
InventoryLocation.
static int GetCombinationFlags(EntityAI entity1, EntityAI entity2)
static ItemManager GetInstance()
bool Select()
Definition Container.c:286
void Container(LayoutHolder parent)
Definition Container.c:35
bool CanCombineEx(EntityAI focusedEntity)
Definition Container.c:541
bool CanSwapOrTakeToHandsEx(EntityAI focusedEntity)
Definition Container.c:432
void SetSlotIcon(SlotsIcon icon)
Definition Container.c:97
void ExpandCollapseContainer()
Definition Container.c:1076
int GetFocusedColumn()
Definition Container.c:644
override void UpdateInterval()
Definition Container.c:654
ref array< ref LayoutHolder > m_Body
Definition Container.c:3
override void SetFirstActive()
Definition Container.c:701
EntityAI GetFocusedContainerEntity()
Definition Container.c:626
ref array< LayoutHolder > m_OpenedContainers
Definition Container.c:4
override void Refresh()
Definition Container.c:1019
Container GetContainer(int index)
Definition Container.c:55
float GetFocusedContainerYPos(bool contents=false)
Definition Container.c:241
EntityAI GetFocusedItem()
Definition Container.c:617
bool InspectItem()
Definition Container.c:321
bool IsLastIndex()
Definition Container.c:788
override void SetLayoutName()
Definition Container.c:968
override void SetLastActive()
Definition Container.c:665
void SetFocusedColumn(int column)
Definition Container.c:649
void SetLastFocus()
Definition Container.c:107
bool CanAddToQuickbarEx(EntityAI focusedEntity)
Definition Container.c:562
bool Combine()
Definition Container.c:300
bool CanSwapOrTakeToHands()
Definition Container.c:418
ScrollWidget GetScrollWidget()
Definition Container.c:86
void ResetFocusedContainer()
Definition Container.c:808
bool CanTakeToInventory()
Definition Container.c:500
bool SelectItem()
Definition Container.c:279
bool m_ForcedHide
Definition Container.c:16
void Toggle()
Definition Container.c:211
void SetFocusedContainer(Container cont)
Definition Container.c:63
void Unfocus()
Definition Container.c:115
bool m_LastIndex
Definition Container.c:6
int m_ColumnCount
Definition Container.c:13
void SetSameLevelNextActive()
Definition Container.c:896
float m_PrevAlpha
Definition Container.c:9
void DraggingOver(Widget w, int x, int y, Widget receiver)
void SetNextLeftActive()
Definition Container.c:886
bool CanDrop()
Definition Container.c:388
void SetPreviousActive(bool force=false)
Definition Container.c:846
bool m_ForcedShow
Definition Container.c:17
bool CanCombineAmmo()
Definition Container.c:555
bool IsItemActive()
Definition Container.c:603
bool TransferItemToVicinity()
Definition Container.c:307
bool CanOpenCloseContainer()
Definition Container.c:342
void Close()
Definition Container.c:184
Container GetFocusedContainer()
Definition Container.c:48
void SetNextActive()
Definition Container.c:816
bool m_Closed
Definition Container.c:7
bool CanSplit()
Definition Container.c:364
void MoveGridCursor(int direction)
Definition Container.c:119
void ScrollToActiveContainer()
Definition Container.c:135
void CheckScrollbarVisibility()
Definition Container.c:166
void DraggingOverHeader(Widget w, int x, int y, Widget receiver)
bool CanEquip()
Definition Container.c:456
bool IsItemWithQuantityActive()
Definition Container.c:610
void SetOpenForSlotIcon(bool open, SlotsIcon icon=null)
Definition Container.c:195
int GetActiveIndex()
Definition Container.c:76
override void UpdateSelectionIcons()
Definition Container.c:1071
EntityAI m_Entity
Definition Container.c:20
bool IsLastContainerFocused()
Definition Container.c:803
void SetForceShow(bool value)
Definition Container.c:1066
bool SplitItem()
Definition Container.c:328
void HideContent(bool force_hide=false)
Definition Container.c:1040
bool CanEquipEx(EntityAI focusedEntity)
Definition Container.c:470
Header GetHeader()
bool IsEmpty()
Definition Container.c:598
void SetDefaultFocus(bool while_micromanagment_mode=false)
Definition Container.c:102
bool OnSelectButton()
Definition Container.c:293
void UnfocusAll()
Definition Container.c:763
void Remove(LayoutHolder container)
Definition Container.c:988
void Insert(LayoutHolder container, int pos=-1, bool immedUpdate=true)
Definition Container.c:973
bool CanCombine()
Definition Container.c:527
bool AddItemToQuickbarRadial(EntityAI itemToAssign)
Definition Container.c:577
bool EquipItem()
Definition Container.c:335
void ShowContent(bool force_show=false)
Definition Container.c:1051
LayoutHolder Get(int x)
Definition Container.c:1014
bool IsFirstIndex()
Definition Container.c:793
void Open()
Definition Container.c:178
void RecomputeOpenedContainers()
Definition Container.c:924
void SetNextRightActive()
Definition Container.c:876
override void SetActive(bool active)
Definition Container.c:725
void UpdateBodySpacers()
Definition Container.c:1028
Container m_FocusedContainer
Definition Container.c:8
bool IsOpened()
Definition Container.c:190
void SetHeader(Header header)
SlotsIcon m_SlotIcon
Definition Container.c:19
bool CanOpenCloseContainerEx(EntityAI focusedEntity)
Definition Container.c:359
bool CanDropEx(EntityAI focusedEntity)
Definition Container.c:403
void SetActiveIndex(int index)
Definition Container.c:81
bool CanTakeToInventoryEx(EntityAI focusedEntity)
Definition Container.c:514
void UnfocusGrid()
Definition Container.c:779
void CheckHeaderDragability()
bool CanSplitEx(EntityAI focusedEntity)
Definition Container.c:378
int GetColumnCount()
Definition Container.c:634
void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
bool IsFirstContainerFocused()
Definition Container.c:798
void SetColumnCount(int count)
Definition Container.c:639
void SetSameLevelPreviousActive()
Definition Container.c:910
float GetFocusedContainerYScreenPos(bool contents=false)
Definition Container.c:252
bool TransferItem()
Definition Container.c:314
void UpdateRadialIcon()
Definition Container.c:91
SlotsIcon GetFocusedSlotsIcon()
Definition Container.c:68
void UpdateSpacer()
float GetFocusedContainerHeight(bool contents=false)
Definition Container.c:220
Widget GetRadialIconPanel()
Definition SlotsIcon.c:302
const string Container
proto native CGame GetGame()
const int MENU_INVENTORY
Definition constants.c:170
const int MENU_RADIAL_QUICKBAR
Definition constants.c:188
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:389