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

◆ AttachmentAdded()

void HandsContainer::AttachmentAdded ( EntityAI item,
string slot,
EntityAI parent )
inlineprotected

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

1288 {
1289 int slot_id = InventorySlots.GetSlotIdFromString( slot );
1290 int sort = -1;
1291 Attachments att_cont = null;
1292 CargoContainer cont = null;
1293
1294 if( item.GetInventory().GetAttachmentSlotsCount() > 0 )
1295 {
1296 att_cont = new Attachments( this, item );
1297 sort = (m_AttachmentSlotsSorted.Find( slot_id ) * 2) + SORT_ATTACHMENTS_NEXT_OFFSET;
1298 att_cont.InitAttachmentGrid( sort );
1299
1300 m_AttachmentAttachments.Insert( item, att_cont );
1301 m_AttachmentAttachmentsContainers.Insert( item, att_cont.GetWrapper() );
1302
1303 att_cont.UpdateInterval();
1304 if( m_Parent )
1305 m_Parent.Refresh();
1306 Inventory.GetInstance().UpdateConsoleToolbar();
1307 }
1308
1309 if( item.GetInventory().GetCargo() )
1310 {
1311 cont = new CargoContainer( this, true );
1312 sort = (m_AttachmentSlotsSorted.Find( slot_id ) * 2) + SORT_CARGO_NEXT_OFFSET; //m_AttachmentSlotsSorted.Find( slot_id ) + 50
1313 cont.GetRootWidget().SetSort( sort );
1314 cont.SetEntity( item );
1315
1316 Insert(cont, -1);
1317
1318 m_AttachmentCargos.Insert( item, cont );
1319 if( m_Parent )
1320 m_Parent.Refresh();
1321 Inventory.GetInstance().UpdateConsoleToolbar();
1322 }
1323
1324 if (att_cont)
1325 {
1326 att_cont.ShowFalseAttachmentsHeader(true);
1327 if (cont)
1328 {
1329 cont.ShowFalseCargoHeader(false);
1330 cont.UpdateSize();
1331 cont.SetAlternateFalseTextHeaderWidget(att_cont.GetFalseHeaderTextWidget());
1332 }
1333 }
1334 else if (cont)
1335 {
1336 cont.SetAlternateFalseTextHeaderWidget(null); //just to be safe..
1337 }
1338
1339 RecomputeOpenedContainers();
1340 }
void Inventory(LayoutHolder parent)
Определения Inventory.c:74
Widget m_Parent
Определения SizeToChild.c:92
void UpdateInterval()
Определения Attachments.c:321
AttachmentsWrapper GetWrapper()
Определения Attachments.c:44
TextWidget GetFalseHeaderTextWidget()
Определения Attachments.c:606
void InitAttachmentGrid(int att_row_index)
Определения Attachments.c:458
void ShowFalseAttachmentsHeader(bool show)
Определения Attachments.c:596
void CargoContainer(LayoutHolder parent, bool is_attachment=false)
Определения CargoContainer.c:32
ref map< EntityAI, ref CargoContainer > m_AttachmentCargos
Определения HandsContainer.c:10
ref map< EntityAI, AttachmentsWrapper > m_AttachmentAttachmentsContainers
Определения HandsContainer.c:11
ref map< EntityAI, ref Attachments > m_AttachmentAttachments
Определения HandsContainer.c:12
override void Insert(LayoutHolder container, int pos=-1, bool immedUpdate=true)
Определения HandsContainer.c:182
ref array< int > m_AttachmentSlotsSorted
Определения HandsContainer.c:13

Перекрестные ссылки Container::CargoContainer(), Attachments::GetFalseHeaderTextWidget(), InventorySlots::GetSlotIdFromString(), Attachments::GetWrapper(), Attachments::InitAttachmentGrid(), Insert(), Inventory(), m_AttachmentAttachments, m_AttachmentAttachmentsContainers, m_AttachmentCargos, m_AttachmentSlotsSorted, m_Parent, Attachments::ShowFalseAttachmentsHeader() и Attachments::UpdateInterval().

Используется в DestroyAtt(), ShowAtt() и ~HandsContainer().