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

◆ AttachmentAdded()

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

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

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