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