DayZ 1.30
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 строка 914

915 {
916 m_Entity = entity;
917 Header header = GetHeader();
918
919 m_CategoryIdentifier = attachment_category;
920
921 array<string> player_ghosts_slots2 = new array<string>();
922 string categoryName;
923
924 m_RowConfigPath = config_path_attachment_categories + " " + attachment_category + " attachmentSlots";
925 string config_path_category_name = config_path_attachment_categories + " " + attachment_category + " name";
926 g_Game.ConfigGetTextArray(m_RowConfigPath, player_ghosts_slots2);
927 g_Game.ConfigGetText(config_path_category_name, categoryName);
928 header.SetName(categoryName);
929
930 m_AttachmentsContainer.SetHeader(header);
931 SetHeader(null);
932
933 int count = player_ghosts_slots2.Count();
934 int lastRow = count / ITEMS_IN_ROW;
935 SlotsContainer slotsContainer;
936
937 for (int j = 0; j < count; ++j)
938 {
939 string slotName = player_ghosts_slots2.Get(j);
940 string iconName; //must be in format "set:<setname> image:<imagename>"
941 string path = "CfgSlots" + " Slot_" + slotName;
942
943 int slotId = InventorySlots.GetSlotIdFromString(slotName);
944
945 g_Game.ConfigGetText(path + " ghostIcon", iconName);
946 g_Game.ConfigGetText(path + " name", slotName);
947
948 int row = j / ITEMS_IN_ROW;
949 int column = j % ITEMS_IN_ROW;
950 if (column == 0)
951 {
952 slotsContainer = new SlotsContainer(m_AttachmentsContainer, m_Entity);
953 slotsContainer.GetRootWidget().SetAlpha(0.7);
954 if (row == lastRow)
955 slotsContainer.SetColumnCount(count % ITEMS_IN_ROW);
956 else
957 slotsContainer.SetColumnCount(ITEMS_IN_ROW);
958
959 m_AttachmentsContainer.Insert(slotsContainer);
960 slotsContainer.GetRootWidget().SetSort(row);
961 }
962
963 SlotsIcon icon = slotsContainer.GetSlotIcon(column);
964 WidgetEventHandler.GetInstance().RegisterOnDropReceived(icon.GetMainWidget(), this, "OnDropReceivedFromHeader");
965 WidgetEventHandler.GetInstance().RegisterOnDropReceived(icon.GetGhostSlot(), this, "OnDropReceivedFromHeader");
966 WidgetEventHandler.GetInstance().RegisterOnDropReceived(icon.GetPanelWidget(), this, "OnDropReceivedFromHeader");
967
968 WidgetEventHandler.GetInstance().RegisterOnDraggingOver(icon.GetMainWidget(), this, "DraggingOverHeader");
969 WidgetEventHandler.GetInstance().RegisterOnDraggingOver(icon.GetGhostSlot(), this, "DraggingOverHeader");
970 WidgetEventHandler.GetInstance().RegisterOnDraggingOver(icon.GetPanelWidget(), this, "DraggingOverHeader");
971
972 WidgetEventHandler.GetInstance().RegisterOnDrop(icon.GetMainWidget(), this, "OnIconDrop");
973 WidgetEventHandler.GetInstance().RegisterOnDrop(icon.GetPanelWidget(), this, "OnIconDrop");
974
975 WidgetEventHandler.GetInstance().RegisterOnDoubleClick(icon.GetPanelWidget(), this, "DoubleClick");
976 WidgetEventHandler.GetInstance().RegisterOnMouseButtonUp(icon.GetPanelWidget(), this, "MouseClick");
977
978 icon.GetGhostSlot().LoadImageFile(0, StaticGUIUtils.VerifyIconImageString(StaticGUIUtils.IMAGESETGROUP_INVENTORY, iconName));
979 icon.SetSlotID(slotId);
980 icon.SetSlotDisplayName(InventorySlots.GetSlotDisplayName(slotId));
981
982 icon.Clear();
983 }
985 }
const int ITEMS_IN_ROW
Entity m_Entity
Определения CachedEquipmentStorageBase.c:16
PlayerSpawnPreset slotName
DayZGame g_Game
Определения DayZGame.c:4074
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
override void Clear()
Определения SlotsIcon.c:65
void SetSlotID(int slot_ID)
Определения SlotsIconBase.c:165
ImageWidget GetGhostSlot()
Определения SlotsIconBase.c:205
Widget GetPanelWidget()
Определения SlotsIconBase.c:175
void SetSlotDisplayName(string text)
Определения SlotsIconBase.c:114

Перекрестные ссылки SlotsIcon::Clear(), g_Game, SlotsIconBase::GetGhostSlot(), GetHeader(), WidgetEventHandler::GetInstance(), SlotsIconBase::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(), SlotsIconBase::SetSlotDisplayName(), SlotsIconBase::SetSlotID(), slotName и StaticGUIUtils::VerifyIconImageString().

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