26 RecomputeOpenedContainers();
43 if(
m_Entity.GetInventory().IsInventoryLockedForLockType( HIDE_INV_FROM_SCRIPT ) ||
m_Hidden )
45 if( m_Body.Count() > 0 && !
m_Hidden )
48 GetMainWidget().Show(
false );
52 if( m_Body.Count() > 0 && !
m_Hidden )
54 if( m_Body.Count() > 0 && !
m_Hidden )
93 ContainerWithCargo cargo = ContainerWithCargo.Cast(m_Body[i]);
99 if (!cargo.IsVisible())
107 if (cargo.IsVisible())
114 RecomputeOpenedContainers();
134 GetMainWidget().Show(
true );
143 image_widget.Show(
true );
173 icon_widget.Show( show );
174 icon_widget.GetParent().Update();
175 icon_widget.GetParent().GetParent().Update();
176 icon_widget.GetParent().GetParent().GetParent().Update();
183 int count = m_Body.Count();
192 return super.CanDisplayAnyCategory();
201 m_SlotIcon.GetRadialIconPanel().Show(
true );
206 m_SlotIcon.GetRadialIconPanel().Show(
false );
213 string attachment_category;
215 return attachment_category;
218 string GetIconName(
string config_path_attachment_categories,
string attachment_category )
220 string icon_path = config_path_attachment_categories+
" " + attachment_category +
" icon";
226 int GetViewIndex(
string config_path_attachment_categories,
string attachment_category )
228 string preview_path = config_path_attachment_categories+
" " + attachment_category +
" view_index";
235 w.GetUserData(slots_icon);
253 if (m_OpenedContainers.Count() > m_ActiveIndex)
260 SlotsIcon icon = c.GetFocusedSlotsIcon();
271 RecomputeOpenedContainers();
286 string config_path_attachment_categories =
"CfgVehicles " + type +
" GUIInventoryAttachmentsProps";
288 int categories_count = attachments_categories_count;
289 if (
m_Entity.GetInventory().GetCargo())
298 for (
int i = 0; i < row_count; i++ )
301 m_Body.Insert( items_cont );
302 m_OpenedContainers.Insert( items_cont );
305 if (i == ( row_count - 1 ) && categories_count %
ITEMS_IN_ROW != 0)
306 items_cont.GetSlotsContainer().SetColumnCount( categories_count %
ITEMS_IN_ROW );
308 items_cont.GetSlotsContainer().SetColumnCount(
ITEMS_IN_ROW );
316 string config_path_attachment_categories =
"CfgVehicles " + type +
" GUIInventoryAttachmentsProps";
322 string attachment_category;
325 for (
int i = 0; i < attachments_categories_count; i++)
329 icon_name =
GetIconName( config_path_attachment_categories, attachment_category );
340 string config = config_path_attachment_categories +
" " + attachment_category +
" name";
349 ar.
Init(attachments_categories_count, i, attachment_category, config_path_attachment_categories,
m_Entity, m_Body.
Count() );
352 ar.SetSlotIcon(icon);
362 if (
m_Entity.GetInventory().GetCargo() )
367 icon = items_cont.
GetSlotIcon( attachments_categories_count );
374 icon.GetMainWidget().Show(
true );
376 ContainerWithCargo iwc =
new ContainerWithCargo(
this, -1 );
377 iwc.Get( 0 ).GetRootWidget().ClearFlags(
WidgetFlags.DRAGGABLE );
378 iwc.SetEntity(
m_Entity, 0,
false );
379 iwc.SetSlotIcon( icon );
387 RecomputeOpenedContainers();
396 string name = w.GetName();
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();
451 for (
int i = 1; i < m_Body.Count(); i++)
453 m_Body.Get( i ).OnHide();
478 RecomputeOpenedContainers();
487 SetOpenForSlotIcon(
true);
503 else if (m_SlotIcon && m_SlotIcon.GetObject())
513 SetOpenForSlotIcon(
false,icon);
530 if (m_OpenedContainers.Count() > m_ActiveIndex)
FindInventoryLocationType
flags for searching locations in inventory
class PluginItemDiagnosticEventHandler extends ScriptedWidgetEventHandler m_Entity
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
protected Widget m_Parent
int GetAttachmentCategoriesCount(string config_path)
void InitIconsContainers()
void ShowInSlots(string category, bool show)
void LoadAttachmentCategoriesIcon(SlotsContainer items_cont, string icon_name, int slot_number)
override void UpdateInterval()
string GetIconName(string config_path_attachment_categories, string attachment_category)
override bool CanSplitEx(EntityAI focusedEntity)
override void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
override bool CanOpenCloseContainerEx(EntityAI focusedEntity)
override void UpdateRadialIcon()
protected SlotsIcon m_CargoSlotsIcon
void SetEntity(EntityAI entity)
void AttachmentCategoriesContainer(LayoutHolder parent, int sort=-1)
override void ExpandCollapseContainer()
override bool CanDisplayAnyCategory()
override void DraggingOverHeader(Widget w, int x, int y, Widget receiver)
protected ref map< string, int > m_CategorySlotIndex
void MouseClick(Widget w)
string GetAttachmentCategory(string config_path_attachment_categories, int i)
override void CollapseButtonOnMouseButtonDown(Widget w)
protected int m_SlotsCount
int GetViewIndex(string config_path_attachment_categories, string attachment_category)
SlotsIcon GetCargoSlotsIcon()
override bool IsDisplayable()
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()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native DayZPlayer GetPlayer()
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
Super root of all classes in Enforce script.
override bool IsDisplayable()
protected ref CollapsibleHeader m_CollapsibleHeader
void SetCollapsibleHeaderArrowState(bool open)
void UpdateCollapseButtons()
override void Insert(LayoutHolder container, int pos=-1, bool immedUpdate=true)
static ColorManager GetInstance()
void SetColor(Widget w, int color)
void ShowSourceDropzone(EntityAI item)
static ItemManager GetInstance()
SlotsIcon GetSlotIcon(int index)
void SetSlotDisplayName(string text)
Widget GetRadialIconPanel()
override void UpdateInterval()
ImageWidget GetGhostSlot()
void SetContainer(Container container)
override bool IsVisible()
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.
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.