DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ SetEntity() [1/2]

void ClosableContainer::SetEntity ( EntityAI entity,
bool immedUpdate = true )
inlineprotected

См. определение в файле ContainerWithCargoAndAttachments.c строка 318

319 {
320 m_Entity = entity;
321
322 m_Atts = new Attachments( this, m_Entity );
323 m_Atts.InitAttachmentGrid( SORT_ATTACHMENTS_OWN );
324 m_AttachmentSlotsSorted = m_Atts.GetSlotsSorted();
325
326 m_Entity.GetOnItemAttached().Insert( AttachmentAdded );
327 m_Entity.GetOnItemDetached().Insert( AttachmentRemoved );
328
329 m_ClosableHeader.SetItemPreview( m_Entity );
330 CheckHeaderDragability();
331
332 if ( m_Entity.GetInventory().GetCargo() )
333 {
334 m_CargoGrid = new CargoContainer( this, false );
335 m_CargoGrid.GetRootWidget().SetSort( SORT_CARGO_OWN );
336 m_CargoGrid.SetEntity( m_Entity, 0, immedUpdate );
337 m_CargoGrid.UpdateHeaderText(); // TODO: refresh?
338 Insert( m_CargoGrid );
339 }
340 else
341 {
342 string name = m_Entity.GetDisplayName();
343 name.ToUpper();
344 m_ClosableHeader.SetName( name );
345 }
346
350
351 (Container.Cast( m_Parent )).Insert( this );
352
353 foreach ( int slot_id : m_AttachmentSlotsSorted )
354 {
355 EntityAI item = m_Entity.GetInventory().FindAttachment( slot_id );
356 if ( item )
357 AttachmentAddedEx( item, InventorySlots.GetSlotName( slot_id ), m_Entity, false );
358 }
359
361
362 if (m_CargoGrid)
363 {
364 bool hideCargo = m_Entity.GetInventory().IsInventoryLockedForLockType( HIDE_INV_FROM_SCRIPT ) || !m_Entity.CanDisplayCargo() || m_ForcedHide;
365 if (m_CargoGrid.IsVisible() && hideCargo)
366 {
367 HideCargo();
368 }
369 else if (!m_CargoGrid.IsVisible() && !hideCargo)
370 {
371 ShowCargo();
372 }
373 }
374
375 if( IsDisplayable() )
376 SetOpenState( true );
377 else
378 SetOpenState( false );
379
380 if (immedUpdate)
381 m_Parent.m_Parent.Refresh();
382
383 RecomputeOpenedContainers();
384 }
class LogManager EntityAI
EntityAI m_Entity
Определения ActionDebug.c:11
const string Container
Определения CentralEconomy.c:6
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
map
Определения ControlsXboxNew.c:4
Widget m_Parent
Определения SizeToChild.c:92
ref map< EntityAI, ref CargoContainer > m_AttachmentCargos
void AttachmentAddedEx(EntityAI item, string slot, EntityAI parent, bool immedUpdate=true)
void AttachmentRemoved(EntityAI item, string slot, EntityAI parent)
ref map< EntityAI, ref Attachments > m_AttachmentAttachments
ref map< EntityAI, ref AttachmentsWrapper > m_AttachmentAttachmentsContainers
void AttachmentAdded(EntityAI item, string slot, EntityAI parent)
ref CargoContainer m_CargoGrid
Определения ContainerWithCargo.c:3
ref Attachments m_Atts
ref array< int > m_AttachmentSlotsSorted
override bool IsDisplayable()
Определения ContainerWithCargo.c:19

Перекрестные ссылки AttachmentAdded(), AttachmentAddedEx(), AttachmentRemoved(), InventorySlots::GetSlotName(), HideCargo(), IsDisplayable(), m_AttachmentAttachments, m_AttachmentAttachmentsContainers, m_AttachmentCargos, m_AttachmentSlotsSorted, m_Atts, m_CargoGrid, m_Entity, m_Parent, name, RecomputeContainers() и ShowCargo().