129 {
130 int slot_id = InventorySlots.GetSlotIdFromString( slot );
131 int sort = -1;
132 bool updateNeeded = false;
133 ref Attachments att_cont = null;
134 ref CargoContainer cont = null;
135
136 if ( item.GetInventory().GetAttachmentSlotsCount() > 0 && item.CanDisplayAnyAttachmentSlot() )
137 {
138 updateNeeded = true;
139
140 att_cont = new Attachments( this, item );
142 att_cont.InitAttachmentGrid( sort );
143 att_cont.SetAttachmentSlotID(slot_id);
144
147
148 att_cont.UpdateInterval();
149 }
150
151 if ( item.GetInventory().GetCargo() )
152 {
153 updateNeeded = true;
154
155 cont = new CargoContainer( this, true );
157 cont.GetRootWidget().SetSort( sort );
158 cont.SetEntity( item, false );
159 cont.SetAttachmentSlotID(slot_id);
161
163 }
164
165 if (updateNeeded)
166 {
167 if (att_cont)
168 {
169 att_cont.ShowFalseAttachmentsHeader(true);
170 if (cont)
171 {
172 cont.ShowFalseCargoHeader(false);
173 cont.UpdateSize();
174 cont.SetAlternateFalseTextHeaderWidget(att_cont.GetFalseHeaderTextWidget());
175 }
176 }
177 else if (cont)
178 {
179 cont.SetAlternateFalseTextHeaderWidget(null);
180 cont.UpdateSize();
181 }
182
184 RecomputeOpenedContainers();
185
186 Inventory.GetInstance().UpdateConsoleToolbar();
187
190 }
191 }
void Inventory(LayoutHolder parent)
ref map< EntityAI, ref CargoContainer > m_AttachmentCargos
void RecomputeContainers()
ref map< EntityAI, ref Attachments > m_AttachmentAttachments
ref map< EntityAI, ref AttachmentsWrapper > m_AttachmentAttachmentsContainers
ref array< int > m_AttachmentSlotsSorted