14 #ifdef PLATFORM_CONSOLE
20 leftArea.SetFirstActive();
21 leftArea.ScrollToActiveContainer();
41 RecomputeOpenedContainers();
66 int childrenCount = m_Body.Count();
67 int displayableChildrenCount = 0;
69 if (childrenCount > 0)
102 ContainerWithCargo cargo = ContainerWithCargo.Cast(m_Body[i]);
108 if (!cargo.IsVisible())
114 if (cargo.IsVisible())
117 cargo.UpdateInterval();
119 RecomputeOpenedContainers();
133 slotsContainer.OnHide();
135 displayableChildrenCount++;
139 slotsContainer.OnHide();
144 bool show = displayableChildrenCount > 0 && !
m_Entity.GetInventory().IsInventoryLockedForLockType(HIDE_INV_FROM_SCRIPT);
155 GetMainWidget().Show(show);
163 image_widget.Show(
true);
169 return g_Game.ConfigGetChildrenCount( config_path );
193 icon_widget.Show(show);
194 icon_widget.GetParent().Update();
195 icon_widget.GetParent().GetParent().Update();
196 icon_widget.GetParent().GetParent().GetParent().Update();
209 return super.CanDisplayAnyCategory();
218 m_SlotIcon.GetRadialIconPanel().Show(
true);
223 m_SlotIcon.GetRadialIconPanel().Show(
false);
230 string attachment_category;
231 g_Game.ConfigGetChildName(config_path_attachment_categories, i, attachment_category);
232 return attachment_category;
235 string GetIconName(
string config_path_attachment_categories,
string attachment_category)
237 string icon_path = config_path_attachment_categories+
" " + attachment_category +
" icon";
239 g_Game.ConfigGetText(icon_path, icon_name);
243 int GetViewIndex(
string config_path_attachment_categories,
string attachment_category)
245 string preview_path = config_path_attachment_categories+
" " + attachment_category +
" view_index";
246 return g_Game.ConfigGetInt( preview_path );
261 if (m_OpenedContainers.Count() > m_ActiveIndex)
268 SlotsIcon icon = c.GetFocusedSlotsIcon();
279 RecomputeOpenedContainers();
293 int categoriesCount = 0;
297 if (
m_Entity.GetInventory().GetCargo())
306 for (
int i = 0; i < rowCount; ++i)
309 m_Body.Insert(itemsCont);
310 m_OpenedContainers.Insert(itemsCont);
313 if (i == (rowCount - 1) && categoriesCount %
ITEMS_IN_ROW != 0)
314 itemsCont.GetSlotsContainer().SetColumnCount(categoriesCount %
ITEMS_IN_ROW);
316 itemsCont.GetSlotsContainer().SetColumnCount(
ITEMS_IN_ROW);
326 int childrenCount = m_Body.Count();
330 string attCategoryClass;
334 for (
int i = 0; i < categoriesCount; ++i)
337 attCategoryClass = groupMap.GetKey(i);
338 groupData = groupMap.Get(attCategoryClass);
353 ar.SetSlotIcon(icon);
362 if (
m_Entity.GetInventory().GetCargo())
374 icon.GetMainWidget().Show(
true);
376 ContainerWithCargo iwc =
new ContainerWithCargo(
this, -1);
377 iwc.Get(0).GetRootWidget().ClearFlags(
WidgetFlags.DRAGGABLE);
379 iwc.SetSlotIcon(icon);
387 RecomputeOpenedContainers();
396 string name = w.GetName();
397 name.Replace(
"PanelWidget",
"Render");
406 if (
m_Entity.GetInventory().CanAddAttachment(iw.
GetItem()) && iw.
GetItem().GetInventory().CanRemoveEntity())
410 else if (
m_Entity.GetInventory().CanAddEntityToInventory(iw.
GetItem()) && iw.
GetItem().GetInventory().CanRemoveEntity())
425 string name = w.GetName();
426 name.Replace(
"PanelWidget",
"Render");
446 int childrenCount = m_Body.Count();
447 for (
int i = 1; i < childrenCount; ++i)
449 m_Body.Get(i).OnHide();
472 RecomputeOpenedContainers();
481 SetOpenForSlotIcon(
true);
497 else if (m_SlotIcon && m_SlotIcon.GetObject())
502 SetOpenForSlotIcon(
false,icon);
519 if (m_OpenedContainers.Count() > m_ActiveIndex)
553 if (items_cont && groupData)
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
FindInventoryLocationType
flags for searching locations in inventory
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
map< string, ref TypeAttachmentGroupData > TAttachmentGroupMap
override bool CanDisplayAnyCategory()
override void UpdateInterval()
int GetViewIndex(string config_path_attachment_categories, string attachment_category)
override void DraggingOverHeader(Widget w, int x, int y, Widget receiver)
SlotsIcon GetCargoSlotsIcon()
override void CollapseButtonOnMouseButtonDown(Widget w)
ref map< string, int > m_CategorySlotIndex
void ShowInSlots(string category, bool show)
override void UpdateRadialIcon()
override bool CanOpenCloseContainerEx(EntityAI focusedEntity)
void AttachmentCategoriesContainer(LayoutHolder parent, int sort=-1)
void SetEntity(EntityAI entity)
override void ExpandCollapseContainer()
override void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
void LoadAttachmentCategoriesIcon(SlotsContainer items_cont, string icon_name, int slot_number)
void InitIconsContainers()
SlotsIcon m_CargoSlotsIcon
string GetAttachmentCategory(string config_path_attachment_categories, int i)
int GetAttachmentCategoriesCount(string config_path)
void ~AttachmentCategoriesContainer()
void MouseClick(Widget w)
override bool IsDisplayable()
string GetIconName(string config_path_attachment_categories, string attachment_category)
SlotsContainer GetSlotsContainer(int icons_row)
override void UpdateInterval()
void Init(int attachments_categories_count, int i, string attachment_category, string config_path_attachment_categories, EntityAI entity, int parent_m_Body_count)
string GetCategoryIdentifier()
SlotsContainer GetSlotsContainer()
override bool IsDisplayable()
Super root of all classes in Enforce script.
override bool IsDisplayable()
void CollapsibleContainer(LayoutHolder parent, int sort=-1)
ref CollapsibleHeader m_CollapsibleHeader
void SetCollapsibleHeaderArrowState(bool open)
override void Insert(LayoutHolder container, int pos=-1, bool immedUpdate=true)
void UpdateCollapseButtons()
void SetColor(Widget w, int color)
static ColorManager GetInstance()
void ClosableContainer(LayoutHolder parent, int sort=-1)
void ShowSourceDropzone(EntityAI item)
static ItemManager GetInstance()
SlotsIcon GetSlotIcon(int index)
void SetContainer(Container container)
Widget GetRadialIconPanel()
ImageWidget GetGhostSlot()
void SetSlotDisplayName(string text)
static const int IMAGESETGROUP_INVENTORY
static string VerifyIconImageString(int imageset_group=IMAGESETGROUP_INVENTORY, string icon_name="")
Checks for improperly formated, legacy image names and corrects them to default format.
string m_IconPath
Displayable, unlocalized name.
Data for one attachment group.
TAttachmentGroupMap GetAttachmentGroupMap()
string GetHeaderDisplayName()
void RefreshLocalizedTexts()
Re-reads localized header/name strings without rebuilding slot config data.
int GetValidAttachmnetGroupCount()
Data holder for attachment group classes.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.