DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Container.c
См. документацию.
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
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 {
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 {
51 {
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 {
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 GetSlotsScrollWidget()
93 {
94 return null;
95 }
96
97 ScrollWidget GetScrollWidget()
98 {
99 return null;
100 }
101
103 {
104 if ( m_SlotIcon )
105 {
106 m_SlotIcon.GetRadialIconPanel().Show( false );
107 }
108 }
109
111 {
112 m_SlotIcon = icon;
113 }
114
115 void SetDefaultFocus(bool while_micromanagment_mode = false)
116 {
117 m_ActiveIndex = 0;
118 }
119
121 {
122 m_ActiveIndex = 0;
123 m_FocusedColumn = 0;
124 if ( m_OpenedContainers.Count() > 0 )
125 {
126 m_ActiveIndex = m_OpenedContainers.Count() - 1;
127 }
128 }
129
130 void Unfocus()
131 {
132 }
133
134 void MoveGridCursor(int direction)
135 {
136 if ( direction == Direction.UP )
137 {
139 }
140 else if ( direction == Direction.DOWN )
141 {
143 }
144 else if ( direction == Direction.RIGHT )
145 {
147 }
148 else if ( direction == Direction.LEFT )
149 {
151 }
152
154
155 Inventory.GetInstance().UpdateConsoleToolbar();
156 }
157
159 {
160 ScrollWidget sw = GetScrollWidget();
161 if (sw)
162 {
164 }
165
166 #ifndef PLATFORM_CONSOLE
167 ScrollWidget ssw = GetSlotsScrollWidget();
168 if (ssw)
169 {
171 }
172 #endif
173 }
174
175 void ScrollToActiveContainer(ScrollWidget sw)
176 {
177 if (!sw)
178 return;
179
180 float x, y, y_s;
181 float f_y,f_h;
182 float amount;
183
184 sw.GetScreenPos(x, y);
185 sw.GetScreenSize(x, y_s);
187 f_h = GetFocusedContainerHeight(true);
188
189 float next_pos = f_y + f_h;
190 if (next_pos > (y + y_s))
191 {
192 amount = sw.GetVScrollPos() + next_pos - (y + y_s) + 2;
193 sw.VScrollToPos(amount);
194 }
195 else if (f_y < y)
196 {
197 amount = sw.GetVScrollPos() + f_y - y - 2;
198 sw.VScrollToPos(amount);
199 }
200
201 //CheckScrollbarVisibility();
202 }
203
205 {
206 ScrollWidget sw = GetScrollWidget();
207 if (sw)
208 {
210 }
211
212 #ifndef PLATFORM_CONSOLE
213 ScrollWidget ssw = GetSlotsScrollWidget();
214 if (ssw)
215 {
217 }
218 #endif
219 }
220
221 void CheckScrollbarVisibility(ScrollWidget sw)
222 {
223 if (!sw)
224 return;
225
226 if (!sw.IsScrollbarVisible())
227 {
228 sw.VScrollToPos01(0.0);
229 }
230 else if (sw.GetVScrollPos01() > 1.0)
231 {
232 sw.VScrollToPos01(1.0);
233 }
234 }
235
236 void Open()
237 {
238 m_Closed = false;
240 }
241
242 void Close()
243 {
244 m_Closed = true;
246 }
247
248 bool IsOpened()
249 {
250 return !m_Closed;
251 }
252
253 void SetOpenForSlotIcon(bool open, SlotsIcon icon = null/*m_SlotIcon*/)
254 {
255 if (!icon)
256 {
257 icon = m_SlotIcon;
258 }
259
260 if (icon)
261 {
262 icon.GetRadialIcon().Show(open);
263 icon.GetRadialIconClosed().Show(!open);
264 }
265 }
266
267 void Toggle()
268 {
269 if (IsOpened())
270 {
271 Close();
272 }
273 else
274 {
275 Open();
276 }
278 }
279
280 float GetFocusedContainerHeight( bool contents = false )
281 {
282 float x, y, result;
283 if( GetFocusedContainer() )
284 y = GetFocusedContainer().GetFocusedContainerHeight( contents );
285 else if( GetRootWidget() )
286 GetRootWidget().GetScreenSize( x, y );
287
288 result = y;
289
290 if ( m_ActiveIndex == 0 )
291 {
292 if ( GetHeader() )
293 {
294 GetHeader().GetRootWidget().GetScreenSize( x, y );
295 result += y;
296 }
297 }
298 return result;
299 }
300
301 float GetFocusedContainerYPos( bool contents = false )
302 {
303 float x, y;
304 if( GetFocusedContainer() )
305 y = GetFocusedContainer().GetFocusedContainerYPos( contents );
306 else if( GetRootWidget() )
307 GetRootWidget().GetPos( x, y );
308
309 return y;
310 }
311
312 float GetFocusedContainerYScreenPos( bool contents = false )
313 {
314 float x, y, result;
315 if( GetFocusedContainer() )
316 y = GetFocusedContainer().GetFocusedContainerYScreenPos( contents );
317 else if( GetRootWidget() )
318 GetRootWidget().GetScreenPos( x, y );
319
320
321 result = y;
322
323 if ( m_ActiveIndex == 0 )
324 {
325 if ( GetHeader() )
326 {
327 GetHeader().GetRootWidget().GetScreenPos( x, y );
328 result = y;
329 }
330 }
331 return result;
332 }
333
334 int Count()
335 {
336 return m_Body.Count();
337 }
338
340 {
341 if( GetFocusedContainer() )
342 return GetFocusedContainer().SelectItem();
343 return false;
344 }
345
346 bool Select()
347 {
348 if( GetFocusedContainer() )
349 return GetFocusedContainer().Select();
350 return false;
351 }
352
354 {
356 {
357 return GetFocusedContainer().OnSelectButton();
358 }
359 return false;
360 }
361
362 bool Combine()
363 {
364 if( GetFocusedContainer() )
365 return GetFocusedContainer().Combine();
366 return true;
367 }
368
370 {
371 if( GetFocusedContainer() )
372 return GetFocusedContainer().TransferItemToVicinity();
373 return false;
374 }
375
377 {
378 if( GetFocusedContainer() )
379 return GetFocusedContainer().TransferItem();
380 return false;
381 }
382
384 {
385 if( GetFocusedContainer() )
386 return GetFocusedContainer().InspectItem();
387 return false;
388 }
389
391 {
393 {
394 return GetFocusedContainer().SplitItem();
395 }
396 else
397 {
398 if (CanSplit())
399 {
400 ItemBase.Cast(GetFocusedItem()).OnRightClick();
401 }
402 }
403 return false;
404 }
405
407 {
409 return GetFocusedContainer().EquipItem();
410
411 if (CanEquip())
412 {
413 EntityAI ent = GetFocusedItem();
414 bool res = false;
415
416 if (ent)
417 {
418 res = g_Game.GetPlayer().PredictiveTakeOrSwapAttachment(ent);
419 if(!res)
420 {
421 res = g_Game.GetPlayer().PredictiveTakeEntityToInventory(FindInventoryLocationType.ATTACHMENT, ent);
422 }
423 }
424 return res;
425 }
426 return false;
427 }
428
430 {
432 return false;
433
434 EntityAI focusedEntity = GetFocusedItem();
435 if (focusedEntity)
436 {
438 return GetFocusedContainer().CanOpenCloseContainerEx(focusedEntity);
439
440 return CanOpenCloseContainerEx(focusedEntity);
441 }
442
443 return false;
444 }
445
447 {
448 return false;
449 }
450
451 bool CanSplit()
452 {
453 EntityAI focusedEntity = GetFocusedItem();
454 if (focusedEntity)
455 {
457 return GetFocusedContainer().CanSplitEx(focusedEntity);
458
459 return CanSplitEx(focusedEntity);
460 }
461
462 return false;
463 }
464
465 bool CanSplitEx(EntityAI focusedEntity)
466 {
468 return false;
469
470 if (focusedEntity)
471 {
473 return GetFocusedContainer().CanSplitEx(focusedEntity);
474
475 return focusedEntity.CanBeSplit();
476 }
477 return false;
478 }
479
480 bool CanDrop()
481 {
482 EntityAI focusedEntity = GetFocusedItem();
483 if (focusedEntity)
484 {
486 return GetFocusedContainer().CanDropEx(focusedEntity);
487
488 return CanDropEx(focusedEntity);
489
490 }
491
492 return false;
493 }
494
495 bool CanDropEx(EntityAI focusedEntity)
496 {
498 return false;
499
500 if (focusedEntity)
501 {
502 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
503
504 if (player)
505 {
506 return player.CanDropEntity(focusedEntity);
507 }
508 }
509 return false;
510 }
511
513 {
514 EntityAI focusedEntity = GetFocusedItem();
515 if (focusedEntity)
516 {
518 return GetFocusedContainer().CanSwapOrTakeToHandsEx(focusedEntity);
519
520 return CanSwapOrTakeToHandsEx(focusedEntity);
521 }
522
523 return false;
524 }
525
527 {
529 return false;
530
531 if (focusedEntity)
532 {
533 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
534 EntityAI entityInHands = player.GetItemInHands();
535 if (entityInHands)
536 {
538
539 if (!GameInventory.CanSwapEntitiesEx(focusedEntity, entityInHands))
540 {
541 return GameInventory.CanForceSwapEntitiesEx( focusedEntity, null, entityInHands, il );
542 }
543 else
544 {
545 return true;
546 }
547 }
548 else
549 {
550 return player.GetInventory().CanAddEntityIntoHands(focusedEntity);
551 }
552 }
553 return false;
554 }
555
556 bool CanEquip()
557 {
558 EntityAI focusedEntity = GetFocusedItem();
559 if (focusedEntity)
560 {
562 return GetFocusedContainer().CanEquipEx(focusedEntity);
563
564 return CanEquipEx(focusedEntity);
565 }
566
567 return false;
568 }
569
570 bool CanEquipEx(EntityAI focusedEntity)
571 {
573 return false;
574
575 bool found = false;
576 if (focusedEntity)
577 {
579 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
580 found = player.GetInventory().FindFreeLocationFor(focusedEntity,FindInventoryLocationType.ATTACHMENT, il);
581
582 if (found && il.GetParent().GetInventory().FindAttachment(il.GetSlot()))
583 {
584 found = false;
585 }
586 else if (!found)
587 {
588 for (int i = 0; i < focusedEntity.GetInventory().GetSlotIdCount(); i++)
589 {
590 int slot_id = focusedEntity.GetInventory().GetSlotId(i);
591 EntityAI slot_item = player.GetInventory().FindAttachment( slot_id );
592 if (slot_item && player.GetInventory().CanSwapEntitiesEx( focusedEntity, slot_item ))
593 {
594 found = true;
595 break;
596 }
597
598 }
599 }
600 }
601 return found;
602 }
603
605 {
606 EntityAI focusedEntity = GetFocusedItem();
607 if (focusedEntity)
608 {
610 return GetFocusedContainer().CanTakeToInventoryEx(focusedEntity);
611
612 return CanTakeToInventoryEx(focusedEntity);
613 }
614
615 return false;
616 }
617
618 bool CanTakeToInventoryEx(EntityAI focusedEntity)
619 {
621 return false;
622
623 if (focusedEntity)
624 {
625 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
626 return player.GetInventory().CanAddEntityToInventory(focusedEntity,FindInventoryLocationType.CARGO);
627 }
628 return false;
629 }
630
632 {
633 EntityAI focusedEntity = GetFocusedItem();
634 if (focusedEntity)
635 {
637 return GetFocusedContainer().CanCombineEx(focusedEntity);
638
639 return CanCombineEx(focusedEntity);
640 }
641
642 return false;
643 }
644
645 bool CanCombineEx(EntityAI focusedEntity)
646 {
648 return false;
649
650 if (focusedEntity)
651 {
652 EntityAI entityInHands = PlayerBase.Cast(g_Game.GetPlayer()).GetItemInHands();
653 if (focusedEntity != entityInHands)
654 {
655 return (ItemManager.GetCombinationFlags(entityInHands, focusedEntity) != 0);
656 }
657 }
658 return false;
659 }
660
662 {
663 if( GetFocusedContainer() )
664 return GetFocusedContainer().CanCombineAmmo();
665 return false;
666 }
667
668 bool CanAddToQuickbarEx(EntityAI focusedEntity)
669 {
671 return false;
672
673 if (focusedEntity)
674 {
675 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
676 if (focusedEntity.GetHierarchyRootPlayer() == player)
677 {
678 return true;
679 }
680 }
681
682 return false;
683 }
684
686 {
687 if ( CanAddToQuickbarEx(itemToAssign) )
688 {
689 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
691 dpi = player.GetDayZPlayerInventory();
692
693 if (itemToAssign && dpi && !dpi.IsProcessing())
694 {
695 RadialQuickbarMenu.SetItemToAssign(itemToAssign);
696
697 //open radial quickbar menu
698 if (!g_Game.GetUIManager().IsMenuOpen(MENU_RADIAL_QUICKBAR))
699 {
700 RadialQuickbarMenu.OpenMenu(g_Game.GetUIManager().FindMenu(MENU_INVENTORY));
701 }
702 }
703 return true;
704 }
705 return false;
706 }
707
708 bool IsEmpty()
709 {
710 return m_OpenedContainers.Count() == 0;
711 }
712
714 {
715 if( GetFocusedContainer() )
716 return GetFocusedContainer().IsItemActive();
717 return false;
718 }
719
721 {
722 if( GetFocusedContainer() )
723 return GetFocusedContainer().IsItemWithQuantityActive();
724 return false;
725 }
726
728 {
729 EntityAI item;
730 if( GetFocusedContainer() )
731 item = GetFocusedContainer().GetFocusedItem();
732
733 return item;
734 }
735
737 {
738 EntityAI item;
739 if( GetFocusedContainer() )
740 item = GetFocusedContainer().GetFocusedContainerEntity();
741 return item;
742 }
743
745 {
746 return m_ColumnCount;
747 }
748
749 void SetColumnCount( int count )
750 {
751 m_ColumnCount = count;
752 }
753
755 {
756 return m_FocusedColumn;
757 }
758
759 void SetFocusedColumn( int column )
760 {
761 m_FocusedColumn = column;
762 }
763
764 override void UpdateInterval()
765 {
766 for ( int i = 0; i < m_Body.Count(); i++ )
767 {
768 if ( m_Body.Get( i ) )
769 m_Body.Get( i ).UpdateInterval();
770 }
771
773 }
774
775 override void SetLastActive()
776 {
777 if (m_IsActive)
778 {
779 m_IsActive = true;
780 if (m_OpenedContainers.Count())
781 {
782 SetLastFocus();
784 {
785 for (int i = 0; i < m_OpenedContainers.Count() - 1; i++)
786 {
788 {
789 m_OpenedContainers[i].SetActive(false);
790 }
791 }
792 m_OpenedContainers[m_ActiveIndex].SetLastActive();
793 }
794 else
795 {
796 m_OpenedContainers[m_ActiveIndex].SetLastActive();
797 }
798 }
799 }
800 else
801 {
802 m_IsActive = true;
803 if (GetHeader())
804 {
806 }
807 SetLastFocus();
808 if (m_OpenedContainers.Count())
809 {
811 if (c)
812 {
813 c.SetLastActive( );
814 }
815 }
816 }
817 }
818
819 override void SetFirstActive()
820 {
821 if (!m_IsActive)
822 {
823 SetActive(true);
824 }
825 else
826 {
827 if (m_OpenedContainers.Count())
828 {
831 {
832 for (int i = 1; i < m_OpenedContainers.Count(); i++)
833 {
835 {
836 m_OpenedContainers[i].SetActive(false);
837 }
838 }
839 m_OpenedContainers[m_ActiveIndex].SetActive(true);
840 }
841 else
842 {
843 m_OpenedContainers[m_ActiveIndex].SetFirstActive();
844 }
845 }
846 }
847 }
848
849 override void SetActive(bool active)
850 {
851 if (!active)
852 {
853 HideOwnedTooltip();
854 }
855
856 if (!active && !m_IsActive)
857 return;
858
859 super.SetActive( active );
860 if ( GetHeader() )
861 {
862 GetHeader().SetActive(active);
863 }
864
865 if (m_MainWidget.FindAnyWidget("SelectedContainer"))
866 {
867 m_MainWidget.FindAnyWidget("SelectedContainer").Show(active);
868 }
869
870 Container c;
871 if( active )
872 {
873
875 if( m_OpenedContainers.Count() )
876 {
878 if (c)
879 {
880 c.SetActive(active);
881 }
882 }
883 }
884 else
885 {
887 if (c)
888 {
889 GetFocusedContainer().SetActive(false);
890 }
891 Unfocus();
892 m_ActiveIndex = 0;
893 m_FocusedColumn = 0;
894 }
895 }
896
898 {
899 for ( int i = 0; i < Count(); i++ )
900 {
901 for ( int j = 0; j < ITEMS_IN_ROW; j++ )
902 {
903 SlotsIcon icon;
904 if (Get(i) && Get(i).GetMainWidget())
905 Get( i ).GetMainWidget().GetUserData(icon);
906
907 if (icon)
908 icon.GetCursorWidget().Show( false );
909 }
910 }
911 }
912
914 {
915 if( GetFocusedContainer() )
916 {
917 m_FocusedColumn = 0;
918 GetFocusedContainer().UnfocusAll();
919 }
920 }
921
923 {
924 return m_ActiveIndex == ( m_OpenedContainers.Count() - 1 );
925 }
926
928 {
929 return m_ActiveIndex == 0;
930 }
931
933 {
934 return m_ActiveIndex == 0;
935 }
936
938 {
939 return m_ActiveIndex >= ( m_OpenedContainers.Count() - 1 );
940 }
941
943 {
944 if ( GetFocusedContainer() )
945 {
946 GetFocusedContainer().ResetFocusedContainer();
947 }
948
949 m_ActiveIndex == 0;
950 }
951
953 {
954 HideOwnedTooltip();
955
956 Container active;
957 if (m_OpenedContainers.Count())
958 {
960 }
961
962 if (active && active.IsActive())
963 {
964 active.SetNextActive();
965 }
966 if (!active || !active.IsActive())
967 {
968 Container next;
970 {
972
974 next.SetActive(true);
975 }
976 else if (Container.Cast( GetParent() ))
977 {
978 SetActive(false);
979 }
980 else
981 {
982 SetActive(false);
984 }
985 }
986 }
987
988 void SetPreviousActive(bool force = false)
989 {
990 HideOwnedTooltip();
991 Container active;
992 if (m_OpenedContainers.Count())
993 {
995 }
996
997 if (active && active.IsActive())
998 {
999 active.SetPreviousActive();
1000 }
1001
1002 if (!active || !active.IsActive())
1003 {
1004 Container prev;
1006 {
1007 m_ActiveIndex--;
1008
1010 prev.SetLastActive();
1011 }
1012 else if (Container.Cast( GetParent() ))
1013 {
1014 SetActive(false);
1015 }
1016 else
1017 {
1018 SetActive(false);
1019 SetLastActive();
1020 }
1021 }
1022 }
1023
1025 {
1026 Container active;
1027 if (m_OpenedContainers.Count())
1028 {
1030 }
1031
1032 if (active)
1033 {
1034 active.SetNextRightActive();
1035 }
1036 }
1037
1039 {
1040 Container active;
1041 if (m_OpenedContainers.Count())
1042 {
1044 }
1045
1046 if (active)
1047 {
1048 active.SetNextLeftActive();
1049 }
1050 }
1051
1053 {
1054 HideOwnedTooltip();
1055 Container active, next;
1056 if (m_OpenedContainers.Count())
1057 {
1059 }
1060
1061 if (active && active.IsActive())
1062 {
1064 if (icon && icon.GetParent() && SlotsContainer.Cast(icon.GetParent()))
1065 {
1066 SlotsContainer sc = SlotsContainer.Cast(icon.GetParent());
1067 AttachmentsGroupContainer agc = AttachmentsGroupContainer.Cast(sc.GetParent());
1068 if (agc)
1069 {
1070 agc.SetActive(false);
1071 }
1072 }
1073
1074 active.SetSameLevelNextActive();
1075 }
1076
1077 if (!active || !active.IsActive())
1078 {
1080 {
1081 m_ActiveIndex++;
1083 next.SetActive(true);
1084 }
1085 else if (Container.Cast(GetParent()))
1086 {
1087 SetActive(false);
1088 }
1089 else
1090 {
1091 SetActive(false);
1093 }
1094 }
1095 }
1096
1098 {
1099 HideOwnedTooltip();
1100 Container active;
1101 if (m_OpenedContainers.Count())
1102 {
1104 }
1105
1106 if (active && active.IsActive())
1107 {
1109 if (icon && icon.GetParent() && SlotsContainer.Cast(icon.GetParent()))
1110 {
1111 SlotsContainer sc = SlotsContainer.Cast(icon.GetParent());
1112 AttachmentsGroupContainer agc = AttachmentsGroupContainer.Cast(sc.GetParent());
1113 if (agc)
1114 {
1115 agc.SetActive(false);
1116 }
1117 }
1118
1119 active.SetSameLevelPreviousActive();
1120 }
1121
1122 if (!active || !active.IsActive())
1123 {
1124 Container prev;
1126 {
1127 m_ActiveIndex--;
1128
1130 prev.SetLastActive();
1131 }
1132 else if (Container.Cast( GetParent() ))
1133 {
1134 SetActive(false);
1135 }
1136 else
1137 {
1138 SetActive(false);
1139 SetLastActive();
1140 }
1141 }
1142 }
1143
1145 {
1146 m_OpenedContainers.Clear();
1147 int i;
1148 bool need_reset_focus = false;
1149 Container c;
1150 for (i = 0; i < m_Body.Count(); i++)
1151 {
1152 c = Container.Cast(m_Body.Get( i ));
1153 if ( c )
1154 {
1155 c.RecomputeOpenedContainers();
1156 if (c.IsDisplayable() && c.IsVisible())
1157 {
1158 m_OpenedContainers.Insert(c);
1159 }
1160 else if (c.IsActive())
1161 {
1162 c.SetActive(false);
1163 need_reset_focus = true;
1164 }
1165
1166 }
1167 }
1168
1169 //In case of removing focused container or change order of containers
1170 if (IsActive())
1171 {
1172 if (!need_reset_focus && ( m_ActiveIndex >= m_OpenedContainers.Count() || !m_OpenedContainers[m_ActiveIndex].IsActive() ))
1173 {
1174 need_reset_focus = true;
1175 for (i = 0; i < m_OpenedContainers.Count(); i++)
1176 {
1178 {
1179 need_reset_focus = false;
1180 m_ActiveIndex = i;
1181 }
1182 }
1183 }
1184
1185 if (need_reset_focus)
1186 {
1188 }
1189 }
1190 }
1191
1192 override void SetLayoutName()
1193 {
1194 m_LayoutName = WidgetLayoutName.Container;
1195 }
1196
1197 void Insert( LayoutHolder container, int pos = -1, bool immedUpdate = true )
1198 {
1199 if ( pos > -1 && pos < m_Body.Count() )
1200 {
1201 if ( pos <= m_ActiveIndex )
1202 m_ActiveIndex++;
1203 m_Body.InsertAt( container, pos );
1204 }
1205 else
1206 m_Body.Insert( container );
1207
1208 if ( immedUpdate )
1209 Refresh();
1210 }
1211
1212 void Remove( LayoutHolder container )
1213 {
1214 if( m_Body )
1215 {
1216 int index = m_Body.Find( container );
1217 if( index > -1 )
1218 {
1219 index = m_OpenedContainers.Find( container );
1220 if (index > -1)
1221 {
1222 if (index <= m_ActiveIndex)
1223 {
1224 if (GetFocusedContainer() == container)
1225 {
1226 SetPreviousActive( true );
1227 }
1228 else
1229 {
1230 m_ActiveIndex--;
1231 }
1232 }
1233 m_OpenedContainers.RemoveItem( container );
1234 }
1235 m_Body.RemoveItem( container );
1236 }
1237 }
1238
1239 Refresh();
1240 }
1241
1243 {
1244 return m_Body.Get( x );
1245 }
1246
1247 override void Refresh()
1248 {
1249 for ( int i = 0; i < m_Body.Count(); i++ )
1250 {
1251 if( m_Body.Get( i ) )
1252 m_Body.Get( i ).Refresh();
1253 }
1254 }
1255
1257 {
1258 for ( int i = 0; i < m_Body.Count(); i++ )
1259 {
1260 Container c = Container.Cast( m_Body.Get( i ) );
1261 if( c && c.IsInherited( Container ) )
1262 {
1263 c.UpdateSpacer();
1264 }
1265 }
1266
1267 UpdateSpacer();
1268 }
1269
1270 void HideContent( bool force_hide = false )
1271 {
1272 if (!m_ForcedHide)
1273 {
1274 m_ForcedHide = force_hide;
1275 }
1276
1277 foreach (LayoutHolder child : m_Body)
1278 {
1279 child.OnHide();
1280 }
1281 }
1282
1283 void ShowContent( bool force_show = false )
1284 {
1285 if( force_show )
1286 m_ForcedHide = false;
1287
1288 if( !m_ForcedHide )
1289 {
1290 for(int i = 0; i < m_Body.Count(); i++)
1291 {
1292 if( m_Body.Get( i ) )
1293 m_Body.Get( i ).OnShow();
1294 }
1295 }
1296 }
1297
1298 void SetForceShow(bool value)
1299 {
1300 m_ForcedShow = value;
1301 }
1302
1303 override void UpdateSelectionIcons()
1304 {
1305 m_Parent.UpdateSelectionIcons();
1306 }
1307
1309}
void Inventory(LayoutHolder parent)
bool IsOpened()
Определения BaseBuildingBase.c:1647
bool m_IsActive
Определения BunkerBroadcastComponent.c:157
bool IsActive()
Определения BunkerBroadcastComponent.c:255
Entity m_Parent
Определения CachedEquipmentStorageBase.c:17
DayZGame g_Game
Определения DayZGame.c:4074
Icon x
Icon y
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:18
override float Get()
Определения PlayerStatBase.c:134
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
Определения PluginRemotePlayerDebugClient.c:14
@ Count
Определения RandomGeneratorSyncManager.c:8
void SetActive()
Определения TrapBase.c:413
override void SetActive(bool active)
Определения AttachmentsGroupContainer.c:26
override void CheckHeaderDragability()
Определения ClosableContainer.c:181
override void SetLastFocus()
Определения CargoContainer.c:621
override void SetActive(bool active)
Определения CargoContainer.c:769
override void SetNextActive()
Определения CargoContainer.c:647
override void Unfocus()
Определения CargoContainer.c:626
override EntityAI GetFocusedItem()
Определения CargoContainer.c:733
override float GetFocusedContainerHeight(bool contents=false)
Определения CargoContainer.c:436
override void Close()
Определения ClosableContainer.c:79
override bool IsDisplayable()
Определения ClosableContainer.c:17
override void Open()
Определения ClosableContainer.c:67
override void SetPreviousActive(bool force=false)
Определения CargoContainer.c:668
override Header GetHeader()
Определения ClosableContainer.c:62
override float GetFocusedContainerYScreenPos(bool contents=false)
Определения CargoContainer.c:456
override void SetDefaultFocus(bool while_micromanagment_mode=false)
Определения CargoContainer.c:612
override void SetNextLeftActive()
Определения CargoContainer.c:709
override void SetLastActive()
Определения CargoContainer.c:744
override void Refresh()
Определения CargoContainer.c:526
override void SetNextRightActive()
Определения CargoContainer.c:685
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
script counterpart to engine's class Inventory
override void SetActive(bool active)
Определения Header.c:64
Определения Header.c:2
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
InventoryLocation.
Определения InventoryLocation.c:30
static int GetCombinationFlags(EntityAI entity1, EntityAI entity2)
Определения ItemManager.c:800
bool IsMicromanagmentMode()
Определения ItemManager.c:70
static ItemManager GetInstance()
Определения ItemManager.c:282
Определения ItemManager.c:2
bool Select()
Определения Container.c:346
void Container(LayoutHolder parent)
Определения Container.c:35
bool CanCombineEx(EntityAI focusedEntity)
Определения Container.c:645
bool CanSwapOrTakeToHandsEx(EntityAI focusedEntity)
Определения Container.c:526
void SetSlotIcon(SlotsIcon icon)
Определения Container.c:110
void ExpandCollapseContainer()
Определения Container.c:1308
int Count()
Определения Container.c:334
int GetFocusedColumn()
Определения Container.c:754
override void UpdateInterval()
Определения Container.c:764
ref array< ref LayoutHolder > m_Body
Определения Container.c:3
override void SetFirstActive()
Определения Container.c:819
EntityAI GetFocusedContainerEntity()
Определения Container.c:736
ref array< LayoutHolder > m_OpenedContainers
Определения Container.c:4
int m_ActiveIndex
Определения Container.c:5
override void Refresh()
Определения Container.c:1247
Container GetContainer(int index)
Определения Container.c:57
float GetFocusedContainerYPos(bool contents=false)
Определения Container.c:301
EntityAI GetFocusedItem()
Определения Container.c:727
bool InspectItem()
Определения Container.c:383
bool IsLastIndex()
Определения Container.c:922
override void SetLayoutName()
Определения Container.c:1192
override void SetLastActive()
Определения Container.c:775
void SetFocusedColumn(int column)
Определения Container.c:759
void SetLastFocus()
Определения Container.c:120
bool CanAddToQuickbarEx(EntityAI focusedEntity)
Определения Container.c:668
bool Combine()
Определения Container.c:362
bool CanSwapOrTakeToHands()
Определения Container.c:512
ScrollWidget GetScrollWidget()
Определения Container.c:97
void ResetFocusedContainer()
Определения Container.c:942
bool CanTakeToInventory()
Определения Container.c:604
bool SelectItem()
Определения Container.c:339
bool m_ForcedHide
Определения Container.c:16
const int SORT_CARGO_NEXT_OFFSET
Определения Container.c:25
void Toggle()
Определения Container.c:267
void SetFocusedContainer(Container cont)
Определения Container.c:67
void Unfocus()
Определения Container.c:130
bool m_LastIndex
Определения Container.c:6
int m_ColumnCount
Определения Container.c:13
void SetSameLevelNextActive()
Определения Container.c:1052
float m_PrevAlpha
Определения Container.c:9
void DraggingOver(Widget w, int x, int y, Widget receiver)
void SetNextLeftActive()
Определения Container.c:1038
const int SORT_CARGO_OWN
Определения Container.c:23
bool CanDrop()
Определения Container.c:480
void SetPreviousActive(bool force=false)
Определения Container.c:988
bool m_ForcedShow
Определения Container.c:17
bool CanCombineAmmo()
Определения Container.c:661
bool IsItemActive()
Определения Container.c:713
bool TransferItemToVicinity()
Определения Container.c:369
const int SORT_ATTACHMENTS_NEXT_OFFSET
Определения Container.c:24
bool CanOpenCloseContainer()
Определения Container.c:429
void ScrollToActiveContainer(ScrollWidget sw)
Определения Container.c:175
void Close()
Определения Container.c:242
Container GetFocusedContainer()
Определения Container.c:48
void SetNextActive()
Определения Container.c:952
bool m_Closed
Определения Container.c:7
bool CanSplit()
Определения Container.c:451
void MoveGridCursor(int direction)
Определения Container.c:134
void ScrollToActiveContainer()
Определения Container.c:158
void CheckScrollbarVisibility()
Определения Container.c:204
void DraggingOverHeader(Widget w, int x, int y, Widget receiver)
bool CanEquip()
Определения Container.c:556
bool IsItemWithQuantityActive()
Определения Container.c:720
void SetOpenForSlotIcon(bool open, SlotsIcon icon=null)
Определения Container.c:253
int GetActiveIndex()
Определения Container.c:82
override void UpdateSelectionIcons()
Определения Container.c:1303
EntityAI m_Entity
Определения Container.c:20
bool IsLastContainerFocused()
Определения Container.c:937
void SetForceShow(bool value)
Определения Container.c:1298
bool SplitItem()
Определения Container.c:390
void HideContent(bool force_hide=false)
Определения Container.c:1270
bool CanEquipEx(EntityAI focusedEntity)
Определения Container.c:570
Header GetHeader()
int m_FocusedColumn
Определения Container.c:15
bool IsEmpty()
Определения Container.c:708
void SetDefaultFocus(bool while_micromanagment_mode=false)
Определения Container.c:115
bool OnSelectButton()
Определения Container.c:353
void UnfocusAll()
Определения Container.c:897
void Remove(LayoutHolder container)
Определения Container.c:1212
void Insert(LayoutHolder container, int pos=-1, bool immedUpdate=true)
Определения Container.c:1197
ScrollWidget GetSlotsScrollWidget()
Определения Container.c:92
const int SORT_ATTACHMENTS_OWN
Определения Container.c:22
bool CanCombine()
Определения Container.c:631
bool AddItemToQuickbarRadial(EntityAI itemToAssign)
Определения Container.c:685
bool EquipItem()
Определения Container.c:406
void ShowContent(bool force_show=false)
Определения Container.c:1283
LayoutHolder Get(int x)
Определения Container.c:1242
bool IsFirstIndex()
Определения Container.c:927
void Open()
Определения Container.c:236
void RecomputeOpenedContainers()
Определения Container.c:1144
void SetNextRightActive()
Определения Container.c:1024
override void SetActive(bool active)
Определения Container.c:849
void UpdateBodySpacers()
Определения Container.c:1256
Container m_FocusedContainer
Определения Container.c:8
bool IsOpened()
Определения Container.c:248
void SetHeader(Header header)
SlotsIcon m_SlotIcon
Определения Container.c:19
bool CanOpenCloseContainerEx(EntityAI focusedEntity)
Определения Container.c:446
bool CanDropEx(EntityAI focusedEntity)
Определения Container.c:495
void SetActiveIndex(int index)
Определения Container.c:87
bool CanTakeToInventoryEx(EntityAI focusedEntity)
Определения Container.c:618
void UnfocusGrid()
Определения Container.c:913
const int ITEMS_IN_ROW
Определения Container.c:10
void CheckHeaderDragability()
bool CanSplitEx(EntityAI focusedEntity)
Определения Container.c:465
int GetColumnCount()
Определения Container.c:744
void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
bool IsFirstContainerFocused()
Определения Container.c:932
void SetColumnCount(int count)
Определения Container.c:749
void SetSameLevelPreviousActive()
Определения Container.c:1097
void CheckScrollbarVisibility(ScrollWidget sw)
Определения Container.c:221
float GetFocusedContainerYScreenPos(bool contents=false)
Определения Container.c:312
bool TransferItem()
Определения Container.c:376
void UpdateRadialIcon()
Определения Container.c:102
SlotsIcon GetFocusedSlotsIcon()
Определения Container.c:72
void UpdateSpacer()
float GetFocusedContainerHeight(bool contents=false)
Определения Container.c:280
Определения Container.c:2
Определения PlayerBaseClient.c:2
Определения SlotsContainer.c:2
Widget GetCursorWidget()
Определения SlotsIconBase.c:180
Определения SlotsIcon.c:2
Определения EnWidgets.c:190
const string Container
Определения WidgetLayoutName.c:47
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
const int MENU_INVENTORY
Определения 3_Game/DayZ/constants.c:186
const int MENU_RADIAL_QUICKBAR
Определения 3_Game/DayZ/constants.c:204
proto native Widget GetParent()
Get parent of the Effect.
Определения Effect.c:422