348 super.UpdateInterval();
351 vector pos = player.GetPosition();
359 bool isUsedMicromanagment =
false;
361 int m_OldShowedItemIconsCount = m_ShowedItemIcons.Count();
365 if (m_ShowedItemIcons.Find(selectesItem) != -1)
367 isUsedMicromanagment =
true;
370 m_ShowedItemIcons.Clear();
373 for (
int i = 0; i < objects.Count(); i++ )
375 eai = objects.Get( i );
383 if (eai.IsInventoryVisible())
385 showable_items.Insert(eai);
389 m_ShowedItemIcons.Insert(eai);
394 if (isUsedMicromanagment && m_ShowedItemIcons.Find(selectesItem) == -1 )
398 isUsedMicromanagment =
false;
405 for ( i = 0; i < showable_items.Count(); i++ )
407 new_showed_items.Insert(showable_items[i],null);
411 bool need_update_focus =
false;
412 for ( i = 0; i < m_ShowedItems.Count(); i++ )
414 EntityAI ent = m_ShowedItems.GetKey( i );
415 m_ShowedItems.GetElement( i ).UpdateInterval();
416 con = m_ShowedItems.GetElement( i );
417 if ( !new_showed_items.Contains( ent ) )
419 if ( selectesItem && selectesItem.GetHierarchyRoot() == ent)
424 GetMainWidget().Update();
425 if ( con.IsActive() )
426 need_update_focus =
true;
437 bool accessInventory =
PlayerBase.DEBUG_INVENTORY_ACCESS;
438 accessInventory |= FreeDebugCamera.GetInstance() && FreeDebugCamera.GetInstance().IsActive();
442 new_showed_items.Clear();
444 for ( i = 0; i < showable_items.Count(); i++ )
446 EntityAI entity = showable_items.Get( i );
449 if ( game_inventory && !m_ShowedItems.Contains( entity ) )
451 string config =
"CfgVehicles " + entity.GetType() +
" GUIInventoryAttachmentsProps";
453 if (
g_Game.ConfigIsExisting( config ) )
457 new_showed_items.Insert( entity, ac );
458 showed_items_IDs.Insert( entity.GetID(), ac);
460 else if ( entity.GetSlotsCountCorrect() > 0 && entity.GetInventory().GetCargo() )
464 if ( entity.IsAlive() )
470 new_showed_items.Insert( entity, zmb_cnt );
471 showed_items_IDs.Insert( entity.GetID(), zmb_cnt );
476 ContainerWithCargoAndAttachments iwca =
new ContainerWithCargoAndAttachments(
this, -1 );
477 iwca.SetEntity( entity,
false );
478 new_showed_items.Insert( entity, iwca );
479 showed_items_IDs.Insert( entity.GetID(), iwca );
482 else if ( entity.GetInventory().GetCargo() )
484 ContainerWithCargo iwc =
new ContainerWithCargo(
this, -1 );
485 iwc.SetEntity( entity, 0,
false );
486 new_showed_items.Insert( entity, iwc );
487 showed_items_IDs.Insert( entity.GetID(), iwc );
488 iwc.UpdateInterval();
490 else if ( entity.GetSlotsCountCorrect() > 0 )
492 if ( entity.HasEnergyManager() )
495 iwem.SetEntity( entity,
false );
496 new_showed_items.Insert( entity, iwem );
497 showed_items_IDs.Insert( entity.GetID(), iwem );
504 if (accessInventory ==
false)
506 if ( entity.IsAlive() && ( !
PlayerBase.Cast( entity ).IsUnconscious() && !
PlayerBase.Cast( entity ).IsRestrained() ) )
516 new_showed_items.Insert( entity, plyr_cnt );
517 showed_items_IDs.Insert( entity.GetID(), plyr_cnt);
521 ContainerWithCargoAndAttachments iwcas =
new ContainerWithCargoAndAttachments(
this, -1 );
522 iwcas.SetEntity( entity,
false );
523 new_showed_items.Insert( entity, iwcas );
524 showed_items_IDs.Insert( entity.GetID(), iwcas );
525 iwcas.UpdateInterval();
533 con = m_ShowedItems.
Get( entity );
539 if ( !accessInventory && entity.IsAlive() && ( !
PlayerBase.Cast( entity ).IsUnconscious() && !
PlayerBase.Cast( entity ).IsRestrained() ) )
541 GetMainWidget().Update();
542 if ( con.IsActive() )
543 need_update_focus =
true;
554 GetMainWidget().Update();
555 if ( con.IsActive() )
556 need_update_focus =
true;
563 new_showed_items.Insert( entity, m_ShowedItems.Get( entity ) );
564 showed_items_IDs.Insert( entity.GetID(), m_ShowedItemsIDs.Get( entity.GetID() ) );
572 for ( i = 0; i < cargoes.Count(); i++ )
577 if (game_inventory && !m_ShowedCargos.Contains( cgo ) )
579 ContainerWithCargo pxc =
new ContainerWithCargo(
this, -1 );
580 pxc.SetEntity( cgo.GetCargoOwner(), cgo.GetOwnerCargoIndex(),
false );
581 new_showed_cargos.Insert( cgo, pxc );
582 pxc.UpdateInterval();
586 if ( m_ShowedCargos.Get( cgo ) )
588 new_showed_cargos.Insert( cgo, m_ShowedCargos.Get( cgo ) );
594 for (
int ic = 0; ic < m_ShowedCargos.Count(); ic++ )
596 CargoBase cgo2 = m_ShowedCargos.GetKey( ic );
597 m_ShowedCargos.GetElement( ic ).UpdateInterval();
598 if ( !new_showed_cargos.Contains( cgo2 ) )
600 Container con2 = m_ShowedCargos.GetElement( ic );
601 if( con2.IsActive() )
602 need_update_focus =
true;
603 GetMainWidget().Update();
609 m_ShowedItems = new_showed_items;
610 m_ShowedItemsIDs = showed_items_IDs;
611 m_ShowedCargos = new_showed_cargos;
614 if (need_update_focus)
618 m_VicinityIconsContainer.ShowItemsInContainers( m_ShowedItemIcons );
620 if ( m_ShowedItemIcons.Count() != m_OldShowedItemIconsCount )
624 in.UpdateConsoleToolbar();
627 #ifndef PLATFORM_CONSOLE