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

◆ Init()

void AttachmentCategoriesRow::Init ( int attachments_categories_count,
int i,
string attachment_category,
string config_path_attachment_categories,
EntityAI entity,
int parent_m_Body_count )
inlineprotected

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

890 {
891 m_Entity = entity;
892 Header header = GetHeader();
893
894 m_CategoryIdentifier = attachment_category;
895
896 array<string> player_ghosts_slots2 = new array<string>();
897 string categoryName;
898
899 m_RowConfigPath = config_path_attachment_categories + " " + attachment_category + " attachmentSlots";
900 string config_path_category_name = config_path_attachment_categories + " " + attachment_category + " name";
901 g_Game.ConfigGetTextArray(m_RowConfigPath, player_ghosts_slots2);
902 g_Game.ConfigGetText(config_path_category_name, categoryName);
903 header.SetName(categoryName);
904
905 m_AttachmentsContainer.SetHeader(header);
906 SetHeader(null);
907
908 int count = player_ghosts_slots2.Count();
909 int lastRow = count / ITEMS_IN_ROW;
910 SlotsContainer slotsContainer;
911
912 for ( int j = 0; j < count; j++ )
913 {
914 string slotName = player_ghosts_slots2.Get(j);
915 string iconName; //must be in format "set:<setname> image:<imagename>"
916 string path = "CfgSlots" + " Slot_" + slotName;
917
918 int slotId = InventorySlots.GetSlotIdFromString(slotName);
919
920 g_Game.ConfigGetText(path + " ghostIcon", iconName);
921 g_Game.ConfigGetText(path + " name", slotName);
922
923 int row = j / ITEMS_IN_ROW;
924 int column = j % ITEMS_IN_ROW;
925 if (column == 0)
926 {
927 slotsContainer = new SlotsContainer(m_AttachmentsContainer, m_Entity);
928 slotsContainer.GetRootWidget().SetAlpha(0.7);
929 if (row == lastRow)
930 slotsContainer.SetColumnCount(count % ITEMS_IN_ROW);
931 else
932 slotsContainer.SetColumnCount(ITEMS_IN_ROW);
933
934 m_AttachmentsContainer.Insert(slotsContainer);
935 slotsContainer.GetRootWidget().SetSort(row);
936 }
937
938 SlotsIcon icon = slotsContainer.GetSlotIcon(column);
939 WidgetEventHandler.GetInstance().RegisterOnDropReceived(icon.GetMainWidget(), this, "OnDropReceivedFromHeader");
940 WidgetEventHandler.GetInstance().RegisterOnDropReceived(icon.GetGhostSlot(), this, "OnDropReceivedFromHeader");
941 WidgetEventHandler.GetInstance().RegisterOnDropReceived(icon.GetPanelWidget(), this, "OnDropReceivedFromHeader");
942
943 WidgetEventHandler.GetInstance().RegisterOnDraggingOver(icon.GetMainWidget(), this, "DraggingOverHeader");
944 WidgetEventHandler.GetInstance().RegisterOnDraggingOver(icon.GetGhostSlot(), this, "DraggingOverHeader");
945 WidgetEventHandler.GetInstance().RegisterOnDraggingOver(icon.GetPanelWidget(), this, "DraggingOverHeader");
946
947 WidgetEventHandler.GetInstance().RegisterOnDrop(icon.GetMainWidget(), this, "OnIconDrop");
948 WidgetEventHandler.GetInstance().RegisterOnDrop(icon.GetPanelWidget(), this, "OnIconDrop");
949
950 WidgetEventHandler.GetInstance().RegisterOnDoubleClick(icon.GetPanelWidget(), this, "DoubleClick");
951 WidgetEventHandler.GetInstance().RegisterOnMouseButtonUp(icon.GetPanelWidget(), this, "MouseClick");
952
953 icon.GetGhostSlot().LoadImageFile(0, StaticGUIUtils.VerifyIconImageString(StaticGUIUtils.IMAGESETGROUP_INVENTORY, iconName));
954 icon.SetSlotID(slotId);
955 icon.SetSlotDisplayName(InventorySlots.GetSlotDisplayName(slotId));
956
957 icon.Clear();
958 }
960 }
const int ITEMS_IN_ROW
Entity m_Entity
Определения CachedEquipmentStorageBase.c:14
PlayerSpawnPreset slotName
DayZGame g_Game
Определения DayZGame.c:3942
string GetHeader()
Определения ErrorProperties.c:76
string path
Определения OptionSelectorMultistate.c:142
string m_RowConfigPath
Определения AttachmentCategoriesRow.c:4
ref AttachmentsGroupContainer m_AttachmentsContainer
Определения AttachmentCategoriesRow.c:7
string m_CategoryIdentifier
Определения AttachmentCategoriesRow.c:3
void SetName(string name)
Определения Header.c:33
SlotsIcon GetSlotIcon(int index)
Определения SlotsContainer.c:207
Widget GetPanelWidget()
Определения SlotsIcon.c:205
void SetSlotID(int slot_ID)
Определения SlotsIcon.c:195
void SetSlotDisplayName(string text)
Определения SlotsIcon.c:144
void Clear()
Определения SlotsIcon.c:612
ImageWidget GetGhostSlot()
Определения SlotsIcon.c:235

Перекрестные ссылки SlotsIcon::Clear(), g_Game, SlotsIcon::GetGhostSlot(), GetHeader(), WidgetEventHandler::GetInstance(), SlotsIcon::GetPanelWidget(), InventorySlots::GetSlotDisplayName(), SlotsContainer::GetSlotIcon(), InventorySlots::GetSlotIdFromString(), StaticGUIUtils::IMAGESETGROUP_INVENTORY, ITEMS_IN_ROW, m_AttachmentsContainer, m_CategoryIdentifier, m_Entity, m_RowConfigPath, path, RefreshAllSlots(), WidgetEventHandler::RegisterOnDoubleClick(), WidgetEventHandler::RegisterOnDraggingOver(), WidgetEventHandler::RegisterOnDrop(), WidgetEventHandler::RegisterOnDropReceived(), WidgetEventHandler::RegisterOnMouseButtonUp(), Header::SetName(), SlotsIcon::SetSlotDisplayName(), SlotsIcon::SetSlotID(), slotName и StaticGUIUtils::VerifyIconImageString().

Используется в AttachmentCategoriesContainer::InitGhostSlots().