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

◆ InitGhostSlots()

void AttachmentCategoriesContainer::InitGhostSlots ( )
inlineprotected

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

320 {
321 string type = m_Entity.GetType();
322 string config_path_attachment_categories = "CfgVehicles " + type + " GUIInventoryAttachmentsProps";
323
324 int attachments_categories_count = GetAttachmentCategoriesCount( config_path_attachment_categories );
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 {
333 items_cont = GetSlotsContainer( i / ITEMS_IN_ROW );
334 attachment_category = GetAttachmentCategory( config_path_attachment_categories, i );
335 icon_name = GetIconName( config_path_attachment_categories, attachment_category );
336
337 if ( items_cont )
338 {
339 int slot_number = i % ITEMS_IN_ROW;
340 m_CategorySlotIndex.Insert( attachment_category, i );
341 icon = items_cont.GetSlotIcon( slot_number );
342 icon.GetGhostSlot().SetFlags( WidgetFlags.IGNOREPOINTER );
343
344 LoadAttachmentCategoriesIcon( items_cont, icon_name, slot_number );
345
346 string config = config_path_attachment_categories + " " + attachment_category + " name";
347 string name;
348
349 GetGame().ConfigGetText(config,name);
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 //Insert(ar);
358 ar.SetSlotIcon(icon);
359 //icon.SetContainer(ar);
360
361 icon.GetRadialIconPanel().Show( true );
362 ar.Open();
363 icon.SetContainer(ar);
364 Insert(ar);
365 }
366 }
367
368 if ( m_Entity.GetInventory().GetCargo() )
369 {
370 items_cont = GetSlotsContainer( m_SlotsCount - 1 );
371 if ( items_cont )
372 {
373 icon = items_cont.GetSlotIcon( attachments_categories_count );
374 icon.GetGhostSlot().Show( true );
375 icon.GetGhostSlot().LoadImageFile( 0, StaticGUIUtils.VerifyIconImageString(StaticGUIUtils.IMAGESETGROUP_INVENTORY,m_Entity.ConfigGetString("GUIInventoryCargoIcon")) );
376 icon.SetSlotDisplayName(m_Entity.ConfigGetString("GUIInventoryCargoName"));
377 icon.GetGhostSlot().SetFlags( WidgetFlags.IGNOREPOINTER );
378
379 icon.GetRadialIconPanel().Show( true );
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
388 icon.SetContainer(iwc);
389 m_CargoSlotsIcon = icon;
390 }
391 }
392
393 RecomputeOpenedContainers();
394 }
const int ITEMS_IN_ROW
Определения Attachments.c:1
EntityAI m_Entity
Определения ActionDebug.c:11
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
ref map< string, int > m_CategorySlotIndex
Определения AttachmentCategoriesContainer.c:3
void LoadAttachmentCategoriesIcon(SlotsContainer items_cont, string icon_name, int slot_number)
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)
Определения AttachmentCategoriesRow.c:889
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
override void Open()
Определения ContainerWithCargo.c:68
override void Insert(LayoutHolder container, int pos=-1, bool immedUpdate=true)
Определения CollapsibleContainer.c:66
SlotsIcon GetSlotIcon(int index)
Определения SlotsContainer.c:207
void SetSlotDisplayName(string text)
Определения SlotsIcon.c:144
void SetContainer(Container container)
Определения SlotsIcon.c:139
Widget GetRadialIconPanel()
Определения SlotsIcon.c:300
ImageWidget GetGhostSlot()
Определения SlotsIcon.c:235
proto native CGame GetGame()
WidgetFlags
Определения EnWidgets.c:58

Перекрестные ссылки CGame::ConfigGetText(), GetAttachmentCategoriesCount(), GetAttachmentCategory(), GetGame(), SlotsIcon::GetGhostSlot(), GetIconName(), SlotsIcon::GetRadialIconPanel(), SlotsContainer::GetSlotIcon(), GetSlotsContainer(), StaticGUIUtils::IMAGESETGROUP_INVENTORY, AttachmentCategoriesRow::Init(), CollapsibleContainer::Insert(), ITEMS_IN_ROW, LoadAttachmentCategoriesIcon(), m_CargoSlotsIcon, m_CategorySlotIndex, m_Entity, m_SlotsCount, name, ClosableContainer::Open(), SlotsIcon::SetContainer(), SlotsIcon::SetSlotDisplayName() и StaticGUIUtils::VerifyIconImageString().

Используется в SetEntity().