329 super.UpdateInterval();
332 vector pos = player.GetPosition();
340 bool isUsedMicromanagment =
false;
342 int m_OldShowedItemIconsCount = m_ShowedItemIcons.Count();
346 if (m_ShowedItemIcons.Find(selectesItem) != -1)
348 isUsedMicromanagment =
true;
351 m_ShowedItemIcons.Clear();
354 for (
int i = 0; i < objects.Count(); i++ )
356 eai = objects.Get( i );
364 if (eai.IsInventoryVisible())
366 showable_items.Insert(eai);
370 m_ShowedItemIcons.Insert(eai);
375 if (isUsedMicromanagment && m_ShowedItemIcons.Find(selectesItem) == -1 )
379 isUsedMicromanagment =
false;
386 for ( i = 0; i < showable_items.Count(); i++ )
388 new_showed_items.Insert(showable_items[i],null);
392 bool need_update_focus =
false;
393 for ( i = 0; i < m_ShowedItems.Count(); i++ )
395 EntityAI ent = m_ShowedItems.GetKey( i );
396 m_ShowedItems.GetElement( i ).UpdateInterval();
397 con = m_ShowedItems.GetElement( i );
398 if ( !new_showed_items.Contains( ent ) )
400 if ( selectesItem && selectesItem.GetHierarchyRoot() == ent)
405 GetMainWidget().Update();
406 if ( con.IsActive() )
407 need_update_focus =
true;
408 Container.Cast( GetParent() ).Remove( con );
418 bool accessInventory =
PlayerBase.DEBUG_INVENTORY_ACCESS;
419 accessInventory |= FreeDebugCamera.GetInstance() && FreeDebugCamera.GetInstance().IsActive();
423 new_showed_items.Clear();
425 for ( i = 0; i < showable_items.Count(); i++ )
427 EntityAI entity = showable_items.Get( i );
430 if ( game_inventory && !m_ShowedItems.Contains( entity ) )
432 string config =
"CfgVehicles " + entity.GetType() +
" GUIInventoryAttachmentsProps";
434 if (
GetGame().ConfigIsExisting( config ) )
438 new_showed_items.Insert( entity, ac );
439 showed_items_IDs.Insert( entity.GetID(), ac);
441 else if ( entity.GetSlotsCountCorrect() > 0 && entity.GetInventory().GetCargo() )
445 if ( entity.IsAlive() )
451 new_showed_items.Insert( entity, zmb_cnt );
452 showed_items_IDs.Insert( entity.GetID(), zmb_cnt );
453 Container.Cast( GetParent() ).Insert( zmb_cnt );
457 ContainerWithCargoAndAttachments iwca =
new ContainerWithCargoAndAttachments(
this, -1 );
458 iwca.SetEntity( entity,
false );
459 new_showed_items.Insert( entity, iwca );
460 showed_items_IDs.Insert( entity.GetID(), iwca );
463 else if ( entity.GetInventory().GetCargo() )
465 ContainerWithCargo iwc =
new ContainerWithCargo(
this, -1 );
466 iwc.SetEntity( entity, 0,
false );
467 new_showed_items.Insert( entity, iwc );
468 showed_items_IDs.Insert( entity.GetID(), iwc );
469 iwc.UpdateInterval();
471 else if ( entity.GetSlotsCountCorrect() > 0 )
473 if ( entity.HasEnergyManager() )
476 iwem.SetEntity( entity,
false );
477 new_showed_items.Insert( entity, iwem );
478 showed_items_IDs.Insert( entity.GetID(), iwem );
485 if (accessInventory ==
false)
487 if ( entity.IsAlive() && ( !
PlayerBase.Cast( entity ).IsUnconscious() && !
PlayerBase.Cast( entity ).IsRestrained() ) )
495 Container.Cast( GetParent() ).Insert( plyr_cnt );
497 new_showed_items.Insert( entity, plyr_cnt );
498 showed_items_IDs.Insert( entity.GetID(), plyr_cnt);
502 ContainerWithCargoAndAttachments iwcas =
new ContainerWithCargoAndAttachments(
this, -1 );
503 iwcas.SetEntity( entity,
false );
504 new_showed_items.Insert( entity, iwcas );
505 showed_items_IDs.Insert( entity.GetID(), iwcas );
506 iwcas.UpdateInterval();
514 con = m_ShowedItems.
Get( entity );
520 if ( !accessInventory && entity.IsAlive() && ( !
PlayerBase.Cast( entity ).IsUnconscious() && !
PlayerBase.Cast( entity ).IsRestrained() ) )
522 GetMainWidget().Update();
523 if ( con.IsActive() )
524 need_update_focus =
true;
525 Container.Cast( GetParent() ).Remove( con );
535 GetMainWidget().Update();
536 if ( con.IsActive() )
537 need_update_focus =
true;
538 Container.Cast( GetParent() ).Remove( con );
544 new_showed_items.Insert( entity, m_ShowedItems.Get( entity ) );
545 showed_items_IDs.Insert( entity.GetID(), m_ShowedItemsIDs.Get( entity.GetID() ) );
553 for ( i = 0; i < cargoes.Count(); i++ )
558 if (game_inventory && !m_ShowedCargos.Contains( cgo ) )
560 ContainerWithCargo pxc =
new ContainerWithCargo(
this, -1 );
561 pxc.SetEntity( cgo.GetCargoOwner(), cgo.GetOwnerCargoIndex(),
false );
562 new_showed_cargos.Insert( cgo, pxc );
563 pxc.UpdateInterval();
567 if ( m_ShowedCargos.Get( cgo ) )
569 new_showed_cargos.Insert( cgo, m_ShowedCargos.Get( cgo ) );
575 for (
int ic = 0; ic < m_ShowedCargos.Count(); ic++ )
577 CargoBase cgo2 = m_ShowedCargos.GetKey( ic );
578 m_ShowedCargos.GetElement( ic ).UpdateInterval();
579 if ( !new_showed_cargos.Contains( cgo2 ) )
581 Container con2 = m_ShowedCargos.GetElement( ic );
582 if( con2.IsActive() )
583 need_update_focus =
true;
584 GetMainWidget().Update();
585 Container.Cast( GetParent() ).Remove( con2 );
590 m_ShowedItems = new_showed_items;
591 m_ShowedItemsIDs = showed_items_IDs;
592 m_ShowedCargos = new_showed_cargos;
594 Container.Cast( GetParent() ).RecomputeOpenedContainers();
595 if (need_update_focus)
599 m_VicinityIconsContainer.ShowItemsInContainers( m_ShowedItemIcons );
601 if ( m_ShowedItemIcons.Count() != m_OldShowedItemIconsCount )
605 in.UpdateConsoleToolbar();