DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс VicinityContainer
+ Граф наследования:VicinityContainer:

Защищенные члены

void VicinityContainer (LayoutHolder parent, int sort=-1)
 
bool IsVicinityContainerIconsActive ()
 
VicinitySlotsContainer GetVicinityIconsContainer ()
 
bool IsContainerWithCargoActive ()
 
bool IsItemWithAttachmentsActive ()
 
bool IsItemWithCategoriesActive ()
 
void TraverseShowedItems ()
 
override void DraggingOverHeader (Widget w, int x, int y, Widget receiver)
 
void DraggingOverIcon (Widget w, int x, int y, Widget receiver)
 
void OnDropReceivedFromIcon (Widget w, int x, int y, Widget receiver)
 
void OnLeftPanelDropReceived (Widget w, int x, int y, Widget receiver)
 
void OnDropReceivedFromEmptySpace (Widget w, int x, int y, Widget receiver)
 
override void OnDropReceivedFromHeader (Widget w, int x, int y, Widget receiver)
 
override void UpdateInterval ()
 
void ToggleContainer (Widget w, EntityAI item)
 
override bool CanOpenCloseContainerEx (EntityAI focusedEntity)
 
void ToggleContainer (notnull Container conta)
 
override void ExpandCollapseContainer ()
 
override bool OnChildRemove (Widget w, Widget child)
 
override bool OnChildAdd (Widget w, Widget child)
 
override void CollapseButtonOnMouseButtonDown (Widget w)
 
void UpdateHeader (EntityAI entity, Container cont, PlayerBase player)
 Updates header dragability to be consistent with current 'icon' behaviour.
 
override bool SplitItem ()
 

Защищенные данные

bool m_IsProcessing = false
 
const float DISTANCE_TO_ENTITIES = 1.0
 
const float DISTANCE_TO_THE_REST = 0.5
 

Закрытые данные

ref VicinitySlotsContainer m_VicinityIconsContainer
 
ref map< EntityAI, ref Containerm_ShowedItems = new ref map<EntityAI, ref Container>
 
ref map< int, ref Containerm_ShowedItemsIDs = new ref map<int, ref Container>
 
ref array< EntityAIm_ShowedItemIcons = new array<EntityAI>
 
ref map< CargoBase, ref Containerm_ShowedCargos = new ref map<CargoBase, ref Container>
 
- Закрытые данные унаследованные от CollapsibleContainer
ref CollapsibleHeader m_CollapsibleHeader
 
bool m_Hidden
 

Дополнительные унаследованные члены

- Закрытые члены унаследованные от CollapsibleContainer
void CollapsibleContainer (LayoutHolder parent, int sort=-1)
 
override void SetLayoutName ()
 
EntityAI GetEntity ()
 
override void OnDropReceivedFromHeader (Widget w, int x, int y, Widget receiver)
 
override void Refresh ()
 
override void OnShow ()
 
override void OnHide ()
 
override void Insert (LayoutHolder container, int pos=-1, bool immedUpdate=true)
 
override void Remove (LayoutHolder container)
 
bool CanDisplayAnyCategory ()
 
void UpdateCollapseButtons ()
 
void LoadDefaultState ()
 
bool IsHidden ()
 
void CollapseButtonOnMouseButtonDown (Widget w)
 
override void Toggle ()
 
override bool OnChildRemove (Widget w, Widget child)
 
override bool OnChildAdd (Widget w, Widget child)
 
override Header GetHeader ()
 
override void SetHeader (Header header)
 
void SetCollapsibleHeaderArrowState (bool open)
 

Подробное описание

Конструктор(ы)

◆ VicinityContainer()

void VicinityContainer ( LayoutHolder parent,
int sort = -1 )
inlineprotected
14 {
16 m_Body.Insert( m_VicinityIconsContainer );
17 m_VicinityIconsContainer.GetRootWidget().SetColor(166 << 24 | 120 << 16 | 120 << 8 | 120);
18 m_MainWidget = m_RootWidget.FindAnyWidget( "body" );
19 WidgetEventHandler.GetInstance().RegisterOnChildAdd( m_MainWidget, this, "OnChildAdd" );
20 WidgetEventHandler.GetInstance().RegisterOnChildRemove( m_MainWidget, this, "OnChildRemove" );
21
22 RecomputeOpenedContainers();
23 m_CollapsibleHeader.SetName("#container_vicinity");
25 }
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
Definition PluginRemotePlayerDebugClient.c:14
ref CollapsibleHeader m_CollapsibleHeader
Definition CollapsibleContainer.c:3
void LoadDefaultState()
Definition CollapsibleContainer.c:111
ref VicinitySlotsContainer m_VicinityIconsContainer
Definition VicinityContainer.c:3
Definition VicinitySlotsContainer.c:2
Definition WidgetEventHandler.c:2
static WidgetEventHandler GetInstance()
Definition WidgetEventHandler.c:22

Перекрестные ссылки WidgetEventHandler::GetInstance(), CollapsibleContainer::LoadDefaultState(), CollapsibleContainer::m_CollapsibleHeader, m_RootWidget и m_VicinityIconsContainer.

Методы

◆ CanOpenCloseContainerEx()

override bool CanOpenCloseContainerEx ( EntityAI focusedEntity)
inlineprotected
609 {
610 if (focusedEntity)
611 {
613 if (c && c.IsDisplayable())
614 {
615 return true;
616 }
617 }
618 return false;
619 }
Definition ContainerWithCargo.c:2
Definition EntityAI.c:95
ref map< EntityAI, ref Container > m_ShowedItems
Definition VicinityContainer.c:4

Перекрестные ссылки m_ShowedItems.

◆ CollapseButtonOnMouseButtonDown()

override void CollapseButtonOnMouseButtonDown ( Widget w)
inlineprotected
666 {
667 super.CollapseButtonOnMouseButtonDown(w);
668 ItemManager.GetInstance().SetDefaultHeaderOpenState( "VICINITY", !m_Hidden );
669 }
bool m_Hidden
Definition CollapsibleContainer.c:4
Definition ItemManager.c:2
static ItemManager GetInstance()
Definition ItemManager.c:283

Перекрестные ссылки ItemManager::GetInstance() и CollapsibleContainer::m_Hidden.

◆ DraggingOverHeader()

override void DraggingOverHeader ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
88 {
89 if ( w == null )
90 {
91 return;
92 }
93
94 ItemPreviewWidget ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
95 if ( !ipw )
96 {
97 string name = w.GetName();
98 name.Replace( "PanelWidget", "Render" );
99 ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( name ) );
100 }
101
102 if ( !ipw && ItemPreviewWidget.Cast( w ) )
103 {
104 ipw = ItemPreviewWidget.Cast( w );
105 }
106
107 if ( !ipw || !ipw.GetItem() )
108 {
109 return;
110 }
111
112 if ( ipw.GetItem() && GetGame().GetPlayer().CanDropEntity( ipw.GetItem() ) && ipw.GetItem().GetInventory().CanRemoveEntity() && m_ShowedItemIcons.Find( ipw.GetItem() ) == -1 )
113 {
115 ItemManager.GetInstance().HideDropzones();
116 ItemManager.GetInstance().GetLeftDropzone().SetAlpha( 1 );
117 }
118 else
119 {
121 ItemManager.GetInstance().ShowSourceDropzone( ipw.GetItem() );
122 }
123 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerBase GetPlayer()
Definition ModifierBase.c:51
Definition ColorManager.c:2
static int GREEN_COLOR
Definition ColorManager.c:17
static ColorManager GetInstance()
Definition ColorManager.c:27
static int RED_COLOR
Definition ColorManager.c:16
Definition gameplay.c:276
ref array< EntityAI > m_ShowedItemIcons
Definition VicinityContainer.c:6
proto native CGame GetGame()

Перекрестные ссылки GetGame(), ColorManager::GetInstance(), ItemManager::GetInstance(), GetPlayer(), ColorManager::GREEN_COLOR, m_ShowedItemIcons, name и ColorManager::RED_COLOR.

◆ DraggingOverIcon()

void DraggingOverIcon ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
126 {
127 string name = receiver.GetName();
128 name.Replace("PanelWidget", "Render");
131
132 ItemPreviewWidget ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
133 if ( !ipw )
134 {
135 name = w.GetName();
136 name.Replace( "PanelWidget", "Render" );
137 ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( name ) );
138 }
139
140 if ( !ipw && ItemPreviewWidget.Cast( w ) )
141 {
142 ipw = ItemPreviewWidget.Cast( w );
143 }
144
145 if (!ipw)
146 {
147 return;
148 }
149
150 if ( !ItemBase.Cast( receiver_item ) || !ipw.GetItem() )
151 {
152 return;
153 }
154
155 if ( ipw.GetItem().GetInventory().CanRemoveEntity() || m_ShowedItemIcons.Find( ipw.GetItem() ) > -1 )
156 {
157 if ( ( ItemBase.Cast( receiver_item ) ).CanBeCombined( ItemBase.Cast( ipw.GetItem() ) ) )
158 {
160 ItemManager.GetInstance().HideDropzones();
161 ItemManager.GetInstance().GetLeftDropzone().SetAlpha( 1 );
162 return;
163 }
164 else if ( GameInventory.CanSwapEntitiesEx( receiver_item, ipw.GetItem() ) )
165 {
167 ItemManager.GetInstance().HideDropzones();
168 ItemManager.GetInstance().GetLeftDropzone().SetAlpha( 1 );
169 return;
170 }
171 /*else if( GetGame().GetPlayer().CanDropEntity( ipw.GetItem() ) )
172 {
173 ColorManager.GetInstance().SetColor( w, ColorManager.GREEN_COLOR );
174 ItemManager.GetInstance().HideDropzones();
175 ItemManager.GetInstance().GetLeftDropzone().SetAlpha( 1 );
176 return;
177 }*/
178 }
179
181 ItemManager.GetInstance().ShowSourceDropzone( ipw.GetItem() );
182 }
static int SWAP_COLOR
Definition ColorManager.c:18
static int COMBINE_COLOR
Definition ColorManager.c:20
Definition Building.c:6
script counterpart to engine's class Inventory
Definition Inventory.c:79
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition Inventory.c:628
Definition InventoryItem.c:731

Перекрестные ссылки GameInventory::CanSwapEntitiesEx(), ColorManager::COMBINE_COLOR, ColorManager::GetInstance(), ItemManager::GetInstance(), m_ShowedItemIcons, name, ColorManager::RED_COLOR и ColorManager::SWAP_COLOR.

◆ ExpandCollapseContainer()

override void ExpandCollapseContainer ( )
inlineprotected
628 {
631
632 if (m_ShowedItems && item)
633 {
634 conta = m_ShowedItems.Get( item );
635 if (conta)
636 {
638 }
639 }
640 }
Definition CargoContainer.c:3
override EntityAI GetFocusedItem()
Definition CargoContainer.c:722
void ToggleContainer(Widget w, EntityAI item)
Definition VicinityContainer.c:591

Перекрестные ссылки Container::GetFocusedItem(), m_ShowedItems и ToggleContainer().

◆ GetVicinityIconsContainer()

VicinitySlotsContainer GetVicinityIconsContainer ( )
inlineprotected
33 {
35 }

Перекрестные ссылки m_VicinityIconsContainer.

◆ IsContainerWithCargoActive()

bool IsContainerWithCargoActive ( )
inlineprotected
38 {
39 return ( ContainerWithCargo.Cast( GetFocusedContainer() ) != null );
40 }

◆ IsItemWithAttachmentsActive()

bool IsItemWithAttachmentsActive ( )
inlineprotected
43 {
44 return ( ContainerWithCargoAndAttachments.Cast( GetFocusedContainer() ) != null );
45 }

◆ IsItemWithCategoriesActive()

bool IsItemWithCategoriesActive ( )
inlineprotected
48 {
49 return ( AttachmentCategoriesContainer.Cast( GetFocusedContainer() ) != null );
50 }
Definition AttachmentCategoriesContainer.c:2

◆ IsVicinityContainerIconsActive()

bool IsVicinityContainerIconsActive ( )
inlineprotected
28 {
29 return m_VicinityIconsContainer.IsActive();
30 }

Перекрестные ссылки m_VicinityIconsContainer.

◆ OnChildAdd()

override bool OnChildAdd ( Widget w,
Widget child )
inlineprotected
656 {
657 if ( w == GetMainWidget() )
658 {
659 GetMainWidget().Update();
660 m_Parent.OnChildAdd( w, child );
661 }
662 return true;
663 }
Widget m_Parent
Definition SizeToChild.c:92

Перекрестные ссылки m_Parent.

◆ OnChildRemove()

override bool OnChildRemove ( Widget w,
Widget child )
inlineprotected
643 {
644 w.Update();
645 float x, y;
646 w.GetScreenSize( x, y );
647 if ( w == GetMainWidget() )
648 {
649 GetMainWidget().Update();
650 m_Parent.OnChildRemove( w, child );
651 }
652 return true;
653 }
Icon x
Icon y

Перекрестные ссылки m_Parent, x и y.

◆ OnDropReceivedFromEmptySpace()

void OnDropReceivedFromEmptySpace ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
249 {
251 }
override void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
Definition VicinityContainer.c:253

Перекрестные ссылки OnDropReceivedFromHeader(), x и y.

◆ OnDropReceivedFromHeader()

override void OnDropReceivedFromHeader ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
254 {
255 if (!w)
256 return;
257
258 ItemManager.GetInstance().HideDropzones();
259 ItemManager.GetInstance().SetIsDragging(false);
260
261 ItemPreviewWidget ipw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
262
263 if (!ipw)
264 {
265 string name = w.GetName();
266 name.Replace("PanelWidget", "Render");
267 ipw = ItemPreviewWidget.Cast(w.FindAnyWidget(name));
268 }
269
270 if (!ipw)
271 {
272 ipw = ItemPreviewWidget.Cast(w);
273 if (!ipw)
274 return;
275 }
276
277 EntityAI item = ipw.GetItem();
278 if (!ipw.IsInherited(ItemPreviewWidget) || !item)
279 return;
280
281 if (!item.GetInventory().CanRemoveEntity() || m_ShowedItemIcons.Find(item) > -1)
282 return;
283
285 if (player.CanDropEntity(item))
286 {
288 if (itemBase)
289 {
290 if (itemBase.GetTargetQuantityMax() < itemBase.GetQuantity())
291 itemBase.SplitIntoStackMaxClient(null, -1);
292 else
293 player.PhysicalPredictiveDropItem(itemBase);
294 }
295 }
296
297 InventoryMenu menu = InventoryMenu.Cast( GetGame().GetUIManager().FindMenu( MENU_INVENTORY ) );
298 if ( menu )
299 {
300 menu.RefreshQuickbar();
301 }
302 }
void InventoryMenu()
Definition InventoryMenu.c:20
Definition PlayerBaseClient.c:2
const int MENU_INVENTORY
Definition constants.c:178

Перекрестные ссылки GetGame(), ItemManager::GetInstance(), GetPlayer(), InventoryMenu(), m_ShowedItemIcons, MENU_INVENTORY и name.

Используется в OnDropReceivedFromEmptySpace() и OnLeftPanelDropReceived().

◆ OnDropReceivedFromIcon()

void OnDropReceivedFromIcon ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
185 {
186 string name = receiver.GetName();
187 name.Replace("PanelWidget", "Render");
190
191 ItemPreviewWidget ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
192 if ( !ipw )
193 {
194 name = w.GetName();
195 name.Replace( "PanelWidget", "Render" );
196 ipw = ItemPreviewWidget.Cast( w.FindAnyWidget( name ) );
197 }
198
199 if ( !ItemBase.Cast( receiver_item ) || !ipw.GetItem() )
200 {
201 return;
202 }
203
204 EntityAI item = ipw.GetItem();
205 bool equal_typed = item.GetType() == receiver_item.GetType();
206 if ( !receiver_item.IsInherited( ItemBase ) || item == null )
207 {
208 return;
209 }
210
212
213 if ( !item.GetInventory().CanRemoveEntity() )
214 return;
215
216 if ( ( ItemBase.Cast( receiver_item ) ).CanBeCombined( ItemBase.Cast( item ) ) )
217 {
219 }
221 {
224 receiver_item.GetInventory().GetCurrentInventoryLocation( il1 );
225 item.GetInventory().GetCurrentInventoryLocation( il2 );
226
227 if( !receiver_item.GetInventory().CanRemoveEntity() || ( il1.GetType() == InventoryLocationType.GROUND && il2.GetType() == InventoryLocationType.GROUND ) )
228 return;
229 player.PredictiveSwapEntities( item, receiver_item );
230 }
231
232 ItemManager.GetInstance().HideDropzones();
233 ItemManager.GetInstance().SetIsDragging( false );
234 PrepareOwnedTooltip(item);
235
236 InventoryMenu menu = InventoryMenu.Cast( GetGame().GetUIManager().FindMenu( MENU_INVENTORY ) );
237 if ( menu )
238 {
239 menu.RefreshQuickbar();
240 }
241 }
InventoryLocationType
types of Inventory Location
Definition InventoryLocation.c:4
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
Definition ItemBase.c:5642
InventoryLocation.
Definition InventoryLocation.c:29

Перекрестные ссылки GameInventory::CanSwapEntitiesEx(), CombineItemsClient(), GetGame(), ItemManager::GetInstance(), GetPlayer(), InventoryMenu(), MENU_INVENTORY и name.

◆ OnLeftPanelDropReceived()

void OnLeftPanelDropReceived ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected
244 {
246 }

Перекрестные ссылки OnDropReceivedFromHeader(), x и y.

◆ SplitItem()

override bool SplitItem ( )
inlineprotected
687 {
688 if ( CanSplit() )
689 {
691 if (item)
692 {
693 if (item.HasQuantity() && item.CanBeSplit())
694 {
695 item.OnRightClick();
696 }
697 }
698 }
699 return false;
700 }

Перекрестные ссылки Container::GetFocusedItem().

◆ ToggleContainer() [1/2]

void ToggleContainer ( notnull Container conta)
inlineprotected
623 {
624 conta.Toggle();
625 }

◆ ToggleContainer() [2/2]

void ToggleContainer ( Widget w,
EntityAI item )
inlineprotected
592 {
594 Container c;
595 w.GetUserData(slots_icon);
596
597 if ( item )
598 {
599 c = Container.Cast( m_ShowedItems.Get( item ) );
600 }
601
602 if (c)
603 {
605 }
606 }
Definition SlotsIcon.c:2

Перекрестные ссылки m_ShowedItems и ToggleContainer().

Используется в ExpandCollapseContainer(), VicinitySlotsContainer::MouseClick() и ToggleContainer().

◆ TraverseShowedItems()

void TraverseShowedItems ( )
inlineprotected
53 {
55 for ( int i = 0; i < m_ShowedItems.Count(); i++ )
56 {
57 EntityAI entity = m_ShowedItems.GetKey( i );
58 Container container = m_ShowedItems.GetElement( i );
59 string type = entity.GetType();
60 if ( container.IsInherited( ContainerWithCargo ) )
61 {
62 if ( !serialized_types.Contains( type ) )
63 {
64 ContainerWithCargo item_with_cargo = ContainerWithCargo.Cast( container );
65 serialized_types.Insert( type, item_with_cargo.IsOpened() );
66 }
67 }
68 }
69
70 if ( serialized_types.Count() > 0 )
71 {
73 if ( file.Open( "inventory_state.save", FileMode.APPEND ) )
74 {
75 file.Write( serialized_types.Count() );
76
77 for ( i = 0; i < serialized_types.Count(); i++ )
78 {
79 file.Write( serialized_types.GetKey( i ) );
80 file.Write( serialized_types.GetElement( i ) );
81 }
82 }
83 file.Close();
84 }
85 }
Serializer API implementation for File IO. See Serializer for more info. usage:
Definition Serializer.c:104
FileMode
Definition EnSystem.c:383

Перекрестные ссылки m_ShowedItems.

◆ UpdateHeader()

void UpdateHeader ( EntityAI entity,
Container cont,
PlayerBase player )
inlineprotected

Updates header dragability to be consistent with current 'icon' behaviour.

673 {
674 bool draggable = ItemManager.GetInstance().EvaluateContainerDragabilityDefault(entity);
675
676 if (cont.GetHeader())
677 {
678 if (GetDragWidget() == cont.GetHeader())
679 {
681 }
682 ItemManager.GetInstance().SetWidgetDraggable(cont.GetHeader().GetMainWidget(),draggable);
683 }
684 }
proto native Widget CancelWidgetDragging()
proto native Widget GetDragWidget()

Перекрестные ссылки CancelWidgetDragging(), GetDragWidget() и ItemManager::GetInstance().

Используется в UpdateInterval().

◆ UpdateInterval()

override void UpdateInterval ( )
inlineprotected

Allow view access of inventory if in free camera. Write access is elsewhere

Allow view access of inventory if in free camera. Write access is elsewhere

305 {
307
308 if (!player)
309 return;
310
311 super.UpdateInterval();
312
314 vector pos = player.GetPosition();
316
317 VicinityItemManager.GetInstance().Update( player.GetDeltaT() );
318 objects = VicinityItemManager.GetInstance().GetVicinityItems();
319
320 //GetItemsShowableInInventory
322 bool isUsedMicromanagment = false;
323 EntityAI selectesItem = ItemManager.GetInstance().GetSelectedItem();
325
326 if (selectesItem && ItemManager.GetInstance().IsMicromanagmentMode())
327 {
328 if (m_ShowedItemIcons.Find(selectesItem) != -1)
329 {
331 }
332 }
333 m_ShowedItemIcons.Clear();
334
335 GameInventory game_inventory = player.GetInventory();
336 for ( int i = 0; i < objects.Count(); i++ )
337 {
338 eai = objects.Get( i );
339 if ( eai == null || game_inventory.IsPlaceholderEntity( eai ) )
340 continue; // noproxy: ignore body placeholder
341
343 if (base_building && !base_building.IsPlayerInside(player,""))
344 continue;
345
346 if (eai.IsInventoryVisible())
347 {
348 showable_items.Insert(eai);
349
350 if (!eai.DisableVicinityIcon())
351 {
352 m_ShowedItemIcons.Insert(eai);
353 }
354 }
355 }
356
358 {
359 //ItemManager.GetInstance().SetItemMicromanagmentMode(false);
360 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
361 isUsedMicromanagment = false;
362 }
363
364 //MW HOTFIX - old containers must be removed before new one are added (part of initialize are refreshed whole structure - need proper fix to avoid it)
367
368 for ( i = 0; i < showable_items.Count(); i++ )
369 {
371 }
372
373
374 bool need_update_focus = false;
375 for ( i = 0; i < m_ShowedItems.Count(); i++ )
376 {
377 EntityAI ent = m_ShowedItems.GetKey( i );
378 m_ShowedItems.GetElement( i ).UpdateInterval();
379 con = m_ShowedItems.GetElement( i );
380 if ( !new_showed_items.Contains( ent ) )
381 {
382 if ( selectesItem && selectesItem.GetHierarchyRoot() == ent)
383 {
384 //ItemManager.GetInstance().SetItemMicromanagmentMode(false);
385 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
386 }
387 GetMainWidget().Update();
388 if ( con.IsActive() )
389 need_update_focus = true;
390 Container.Cast( GetParent() ).Remove( con );
391 Remove( con );
392 }
393 else
394 {
395 UpdateHeader(ent,con,player); //squeezed here, the map is iterated over enough already..
396 }
397 }
399
400 bool accessInventory = PlayerBase.DEBUG_INVENTORY_ACCESS;
401 accessInventory |= FreeDebugCamera.GetInstance() && FreeDebugCamera.GetInstance().IsActive();
402
403
404 //ref map<EntityAI, ref Container> new_showed_items = new ref map<EntityAI, ref Container>;
405 new_showed_items.Clear();
407 for ( i = 0; i < showable_items.Count(); i++ )
408 {
410 if ( entity )
411 {
412 if ( game_inventory && !m_ShowedItems.Contains( entity ) )
413 {
414 string config = "CfgVehicles " + entity.GetType() + " GUIInventoryAttachmentsProps";
415
416 if ( GetGame().ConfigIsExisting( config ) )
417 {
419 ac.SetEntity( entity );
420 new_showed_items.Insert( entity, ac );
421 showed_items_IDs.Insert( entity.GetID(), ac);
422 }
423 else if ( entity.GetSlotsCountCorrect() > 0 && entity.GetInventory().GetCargo() )
424 {
425 if ( entity.IsInherited( DayZInfected ) )
426 {
427 if ( entity.IsAlive() )
428 {
429 continue;
430 }
432 zmb_cnt.SetEntity( entity );
434 showed_items_IDs.Insert( entity.GetID(), zmb_cnt );
435 Container.Cast( GetParent() ).Insert( zmb_cnt );
436 }
437 else
438 {
439 ContainerWithCargoAndAttachments iwca = new ContainerWithCargoAndAttachments( this, -1 );
440 iwca.SetEntity( entity, false );
441 new_showed_items.Insert( entity, iwca );
442 showed_items_IDs.Insert( entity.GetID(), iwca );
443 }
444 }
445 else if ( entity.GetInventory().GetCargo() )
446 {
447 ContainerWithCargo iwc = new ContainerWithCargo( this, -1 );
448 iwc.SetEntity( entity, 0, false );
449 new_showed_items.Insert( entity, iwc );
450 showed_items_IDs.Insert( entity.GetID(), iwc );
451 iwc.UpdateInterval();
452 }
453 else if ( entity.GetSlotsCountCorrect() > 0 )
454 {
455 if ( entity.HasEnergyManager() )
456 {
458 iwem.SetEntity( entity, false );
459 new_showed_items.Insert( entity, iwem );
460 showed_items_IDs.Insert( entity.GetID(), iwem );
461 }
462 else
463 {
464 if ( entity.IsInherited( PlayerBase ) )
465 {
467 if (accessInventory == false)
468 {
469 if ( entity.IsAlive() && ( !PlayerBase.Cast( entity ).IsUnconscious() && !PlayerBase.Cast( entity ).IsRestrained() ) )
470 {
471 continue;
472 }
473 }
474
476 plyr_cnt.SetPlayer( PlayerBase.Cast( entity ) );
477 Container.Cast( GetParent() ).Insert( plyr_cnt );
478 ( Container.Cast( m_Parent ) ).Refresh();
480 showed_items_IDs.Insert( entity.GetID(), plyr_cnt);
481 }
482 else
483 {
484 ContainerWithCargoAndAttachments iwcas = new ContainerWithCargoAndAttachments( this, -1 );
485 iwcas.SetEntity( entity, false );
486 new_showed_items.Insert( entity, iwcas );
487 showed_items_IDs.Insert( entity.GetID(), iwcas );
488 iwcas.UpdateInterval();
489 }
490 }
491 }
492 }
493 else
494 {
495 //TODO MW: remove old containers on one spot (hotfix)
496 con = m_ShowedItems.Get( entity );
497 if ( con )
498 {
499 if ( entity.IsInherited( PlayerBase ) )
500 {
502 if ( !accessInventory && entity.IsAlive() && ( !PlayerBase.Cast( entity ).IsUnconscious() && !PlayerBase.Cast( entity ).IsRestrained() ) )
503 {
504 GetMainWidget().Update();
505 if ( con.IsActive() )
506 need_update_focus = true;
507 Container.Cast( GetParent() ).Remove( con );
508 Remove( con );
509 continue;
510 }
511 }
512
513 if ( entity.IsInherited( BaseBuildingBase ) )
514 {
516 {
517 GetMainWidget().Update();
518 if ( con.IsActive() )
519 need_update_focus = true;
520 Container.Cast( GetParent() ).Remove( con );
521 Remove( con );
522 continue;
523 }
524 }
525
527 showed_items_IDs.Insert( entity.GetID(), m_ShowedItemsIDs.Get( entity.GetID() ) );
528 }
529 }
530 }
531 }
532
534 auto cargoes = VicinityItemManager.GetInstance().GetVicinityCargos();
535 for ( i = 0; i < cargoes.Count(); i++ )
536 {
537 CargoBase cgo = cargoes.Get( i );
538 if ( cgo )
539 {
540 if (game_inventory && !m_ShowedCargos.Contains( cgo ) )
541 {
542 ContainerWithCargo pxc = new ContainerWithCargo( this, -1 );
543 pxc.SetEntity( cgo.GetCargoOwner(), cgo.GetOwnerCargoIndex(), false );
544 new_showed_cargos.Insert( cgo, pxc );
545 pxc.UpdateInterval();
546 }
547 else
548 {
549 if ( m_ShowedCargos.Get( cgo ) )
550 {
551 new_showed_cargos.Insert( cgo, m_ShowedCargos.Get( cgo ) );
552 }
553 }
554 }
555 }
556
557 for ( int ic = 0; ic < m_ShowedCargos.Count(); ic++ )
558 {
559 CargoBase cgo2 = m_ShowedCargos.GetKey( ic );
560 m_ShowedCargos.GetElement( ic ).UpdateInterval();
561 if ( !new_showed_cargos.Contains( cgo2 ) )
562 {
563 Container con2 = m_ShowedCargos.GetElement( ic );
564 if( con2.IsActive() )
565 need_update_focus = true;
566 GetMainWidget().Update();
567 Container.Cast( GetParent() ).Remove( con2 );
568 Remove( con2 );
569 }
570 }
571
575 //Because WTF (zombie container)
576 Container.Cast( GetParent() ).RecomputeOpenedContainers();
578 SetFirstActive();
579 //RecomputeOpenedContainers();
581 m_VicinityIconsContainer.ShowItemsInContainers( m_ShowedItemIcons );
582
584 {
585 Inventory in = Inventory.Cast( GetRoot() );
586 if ( in )
587 in.UpdateConsoleToolbar();
588 }
589 }
void Inventory(LayoutHolder parent)
Definition Inventory.c:76
Definition Fence.c:2
override bool IsPlayerInside(PlayerBase player, string selection)
Definition Fence.c:615
represents base for cargo storage for entities
Definition Cargo.c:7
override void Refresh()
Definition CollapsibleContainer.c:31
override void Remove(LayoutHolder container)
Definition CollapsibleContainer.c:79
void UpdateCollapseButtons()
Definition CollapsibleContainer.c:91
Definition ContainerWithElectricManager.c:2
Definition ZombieBase.c:2
Definition PlayerContainer.c:2
ref map< int, ref Container > m_ShowedItemsIDs
Definition VicinityContainer.c:5
void UpdateHeader(EntityAI entity, Container cont, PlayerBase player)
Updates header dragability to be consistent with current 'icon' behaviour.
Definition VicinityContainer.c:672
ref map< CargoBase, ref Container > m_ShowedCargos
Definition VicinityContainer.c:7
Definition VicinityItemManager.c:2
static VicinityItemManager GetInstance()
Definition VicinityItemManager.c:22
Definition ZombieContainer.c:2
Definition EnConvert.c:106
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:407

Перекрестные ссылки GetGame(), ItemManager::GetInstance(), VicinityItemManager::GetInstance(), GetParent(), GetPlayer(), Inventory(), BaseBuildingBase::IsPlayerInside(), m_Parent, m_ShowedCargos, m_ShowedItemIcons, m_ShowedItems, m_ShowedItemsIDs, m_VicinityIconsContainer, CollapsibleContainer::Refresh(), CollapsibleContainer::Remove(), CollapsibleContainer::UpdateCollapseButtons() и UpdateHeader().

Поля

◆ DISTANCE_TO_ENTITIES

const float DISTANCE_TO_ENTITIES = 1.0
protected

◆ DISTANCE_TO_THE_REST

const float DISTANCE_TO_THE_REST = 0.5
protected

◆ m_IsProcessing

bool m_IsProcessing = false
protected

◆ m_ShowedCargos

ref map<CargoBase, ref Container> m_ShowedCargos = new ref map<CargoBase, ref Container>
private

Используется в UpdateInterval().

◆ m_ShowedItemIcons

ref array<EntityAI> m_ShowedItemIcons = new array<EntityAI>
private

◆ m_ShowedItems

◆ m_ShowedItemsIDs

ref map<int, ref Container> m_ShowedItemsIDs = new ref map<int, ref Container>
private

Используется в UpdateInterval().

◆ m_VicinityIconsContainer


Объявления и описания членов класса находятся в файле: