14 #ifdef PLATFORM_CONSOLE
20 leftArea.SetFirstActive();
21 leftArea.ScrollToActiveContainer();
41 RecomputeOpenedContainers();
58 if(
m_Entity.GetInventory().IsInventoryLockedForLockType( HIDE_INV_FROM_SCRIPT ) ||
m_Hidden )
60 if( m_Body.Count() > 0 && !
m_Hidden )
63 GetMainWidget().Show(
false );
67 if( m_Body.Count() > 0 && !
m_Hidden )
69 if( m_Body.Count() > 0 && !
m_Hidden )
108 ContainerWithCargo cargo = ContainerWithCargo.Cast(m_Body[i]);
114 if (!cargo.IsVisible())
122 if (cargo.IsVisible())
127 cargo.UpdateInterval();
129 RecomputeOpenedContainers();
149 GetMainWidget().Show(
true );
158 image_widget.Show(
true );
164 return g_Game.ConfigGetChildrenCount( config_path );
188 icon_widget.Show( show );
189 icon_widget.GetParent().Update();
190 icon_widget.GetParent().GetParent().Update();
191 icon_widget.GetParent().GetParent().GetParent().Update();
198 int count = m_Body.Count();
207 return super.CanDisplayAnyCategory();
216 m_SlotIcon.GetRadialIconPanel().Show(
true );
221 m_SlotIcon.GetRadialIconPanel().Show(
false );
228 string attachment_category;
229 g_Game.ConfigGetChildName(config_path_attachment_categories, i, attachment_category);
230 return attachment_category;
233 string GetIconName(
string config_path_attachment_categories,
string attachment_category )
235 string icon_path = config_path_attachment_categories+
" " + attachment_category +
" icon";
237 g_Game.ConfigGetText(icon_path, icon_name);
241 int GetViewIndex(
string config_path_attachment_categories,
string attachment_category )
243 string preview_path = config_path_attachment_categories+
" " + attachment_category +
" view_index";
244 return g_Game.ConfigGetInt( preview_path );;
259 if (m_OpenedContainers.Count() > m_ActiveIndex)
266 SlotsIcon icon = c.GetFocusedSlotsIcon();
277 RecomputeOpenedContainers();
292 string config_path_attachment_categories =
"CfgVehicles " + type +
" GUIInventoryAttachmentsProps";
294 int categories_count = attachments_categories_count;
295 if (
m_Entity.GetInventory().GetCargo())
304 for (
int i = 0; i < row_count; i++ )
307 m_Body.Insert( items_cont );
308 m_OpenedContainers.Insert( items_cont );
311 if (i == ( row_count - 1 ) && categories_count %
ITEMS_IN_ROW != 0)
312 items_cont.GetSlotsContainer().SetColumnCount( categories_count %
ITEMS_IN_ROW );
314 items_cont.GetSlotsContainer().SetColumnCount(
ITEMS_IN_ROW );
322 string config_path_attachment_categories =
"CfgVehicles " + type +
" GUIInventoryAttachmentsProps";
328 string attachment_category;
331 for (
int i = 0; i < attachments_categories_count; i++)
335 icon_name =
GetIconName( config_path_attachment_categories, attachment_category );
346 string config = config_path_attachment_categories +
" " + attachment_category +
" name";
355 ar.
Init(attachments_categories_count, i, attachment_category, config_path_attachment_categories,
m_Entity, m_Body.Count() );
358 ar.SetSlotIcon(icon);
368 if (
m_Entity.GetInventory().GetCargo() )
373 icon = items_cont.
GetSlotIcon( attachments_categories_count );
380 icon.GetMainWidget().Show(
true );
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 );
393 RecomputeOpenedContainers();
402 string name = w.GetName();
403 name.Replace(
"PanelWidget",
"Render");
412 if(
m_Entity.GetInventory().CanAddAttachment( iw.
GetItem() ) && iw.
GetItem().GetInventory().CanRemoveEntity() )
416 else if(
m_Entity.GetInventory().CanAddEntityToInventory( iw.
GetItem() ) && iw.
GetItem().GetInventory().CanRemoveEntity() )
431 string name = w.GetName();
432 name.Replace(
"PanelWidget",
"Render");
457 for (
int i = 1; i < m_Body.Count(); i++)
459 m_Body.Get( i ).OnHide();
484 RecomputeOpenedContainers();
493 SetOpenForSlotIcon(
true);
509 else if (m_SlotIcon && m_SlotIcon.GetObject())
514 SetOpenForSlotIcon(
false,icon);
531 if (m_OpenedContainers.Count() > m_ActiveIndex)
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
FindInventoryLocationType
flags for searching locations in inventory
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
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 SetSlotDisplayName(string text)
void SetContainer(Container container)
Widget GetRadialIconPanel()
ImageWidget GetGhostSlot()
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.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.