320 {
322 string config_path_attachment_categories = "CfgVehicles " + type + " GUIInventoryAttachmentsProps";
323
325
326 SlotsContainer items_cont;
327 SlotsIcon icon;
328 string attachment_category;
329 string icon_name;
330
331 for (int i = 0; i < attachments_categories_count; i++)
332 {
335 icon_name =
GetIconName( config_path_attachment_categories, attachment_category );
336
337 if ( items_cont )
338 {
343
345
346 string config = config_path_attachment_categories + " " + attachment_category + " name";
348
351
352 AttachmentCategoriesRow ar;
353
354 ar = new AttachmentCategoriesRow( this, -1 );
355 ar.
Init(attachments_categories_count, i, attachment_category, config_path_attachment_categories,
m_Entity, m_Body.Count() );
356
357
358 ar.SetSlotIcon(icon);
359
360
365 }
366 }
367
368 if (
m_Entity.GetInventory().GetCargo() )
369 {
371 if ( items_cont )
372 {
373 icon = items_cont.
GetSlotIcon( attachments_categories_count );
375 icon.
GetGhostSlot().LoadImageFile( 0, StaticGUIUtils.VerifyIconImageString(StaticGUIUtils.IMAGESETGROUP_INVENTORY,
m_Entity.ConfigGetString(
"GUIInventoryCargoIcon")) );
378
380 icon.GetMainWidget().Show( true );
381
382 ContainerWithCargo iwc = new ContainerWithCargo( this, -1 );
383 iwc.Get( 0 ).GetRootWidget().ClearFlags(
WidgetFlags.DRAGGABLE );
384 iwc.SetEntity(
m_Entity, 0,
false );
385 iwc.SetSlotIcon( icon );
386 iwc.Open();
387
390 }
391 }
392
393 RecomputeOpenedContainers();
394 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
ref map< string, int > m_CategorySlotIndex
void LoadAttachmentCategoriesIcon(SlotsContainer items_cont, string icon_name, int slot_number)
SlotsIcon m_CargoSlotsIcon
string GetAttachmentCategory(string config_path_attachment_categories, int i)
int GetAttachmentCategoriesCount(string config_path)
string GetIconName(string config_path_attachment_categories, string attachment_category)
SlotsContainer GetSlotsContainer(int icons_row)
void Init(int attachments_categories_count, int i, string attachment_category, string config_path_attachment_categories, EntityAI entity, int parent_m_Body_count)
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
override void Insert(LayoutHolder container, int pos=-1, bool immedUpdate=true)
SlotsIcon GetSlotIcon(int index)
void SetSlotDisplayName(string text)
void SetContainer(Container container)
Widget GetRadialIconPanel()
ImageWidget GetGhostSlot()
proto native CGame GetGame()