59 if (index <
m_Body.Count())
77 return c.GetFocusedSlotsIcon();
106 m_SlotIcon.GetRadialIconPanel().Show(
false );
155 Inventory.GetInstance().UpdateConsoleToolbar();
166 #ifndef PLATFORM_CONSOLE
184 sw.GetScreenPos(
x,
y);
185 sw.GetScreenSize(
x, y_s);
189 float next_pos = f_y + f_h;
190 if (next_pos > (
y + y_s))
192 amount = sw.GetVScrollPos() + next_pos - (
y + y_s) + 2;
193 sw.VScrollToPos(amount);
197 amount = sw.GetVScrollPos() + f_y -
y - 2;
198 sw.VScrollToPos(amount);
212 #ifndef PLATFORM_CONSOLE
226 if (!sw.IsScrollbarVisible())
228 sw.VScrollToPos01(0.0);
230 else if (sw.GetVScrollPos01() > 1.0)
232 sw.VScrollToPos01(1.0);
262 icon.GetRadialIcon().Show(open);
263 icon.GetRadialIconClosed().Show(!open);
285 else if( GetRootWidget() )
286 GetRootWidget().GetScreenSize(
x,
y );
306 else if( GetRootWidget() )
307 GetRootWidget().GetPos(
x,
y );
317 else if( GetRootWidget() )
318 GetRootWidget().GetScreenPos(
x,
y );
418 res =
g_Game.GetPlayer().PredictiveTakeOrSwapAttachment(ent);
475 return focusedEntity.CanBeSplit();
506 return player.CanDropEntity(focusedEntity);
534 EntityAI entityInHands = player.GetItemInHands();
550 return player.GetInventory().CanAddEntityIntoHands(focusedEntity);
588 for (
int i = 0; i < focusedEntity.GetInventory().GetSlotIdCount(); i++)
590 int slot_id = focusedEntity.GetInventory().GetSlotId(i);
591 EntityAI slot_item = player.GetInventory().FindAttachment( slot_id );
592 if (slot_item && player.GetInventory().CanSwapEntitiesEx( focusedEntity, slot_item ))
653 if (focusedEntity != entityInHands)
676 if (focusedEntity.GetHierarchyRootPlayer() == player)
691 dpi = player.GetDayZPlayerInventory();
693 if (itemToAssign && dpi && !dpi.IsProcessing())
695 RadialQuickbarMenu.SetItemToAssign(itemToAssign);
766 for (
int i = 0; i <
m_Body.Count(); i++ )
769 m_Body.Get( i ).UpdateInterval();
859 super.SetActive( active );
865 if (m_MainWidget.FindAnyWidget(
"SelectedContainer"))
867 m_MainWidget.FindAnyWidget(
"SelectedContainer").Show(active);
899 for (
int i = 0; i <
Count(); i++ )
904 if (
Get(i) &&
Get(i).GetMainWidget())
905 Get( i ).GetMainWidget().GetUserData(icon);
962 if (active && active.IsActive())
966 if (!active || !active.IsActive())
997 if (active && active.IsActive())
1002 if (!active || !active.IsActive())
1061 if (active && active.IsActive())
1064 if (icon && icon.GetParent() &&
SlotsContainer.Cast(icon.GetParent()))
1074 active.SetSameLevelNextActive();
1077 if (!active || !active.IsActive())
1106 if (active && active.IsActive())
1109 if (icon && icon.GetParent() &&
SlotsContainer.Cast(icon.GetParent()))
1119 active.SetSameLevelPreviousActive();
1122 if (!active || !active.IsActive())
1148 bool need_reset_focus =
false;
1150 for (i = 0; i <
m_Body.Count(); i++)
1155 c.RecomputeOpenedContainers();
1160 else if (c.IsActive())
1163 need_reset_focus =
true;
1174 need_reset_focus =
true;
1179 need_reset_focus =
false;
1185 if (need_reset_focus)
1199 if ( pos > -1 && pos <
m_Body.Count() )
1203 m_Body.InsertAt( container, pos );
1206 m_Body.Insert( container );
1216 int index =
m_Body.Find( container );
1235 m_Body.RemoveItem( container );
1249 for (
int i = 0; i <
m_Body.Count(); i++ )
1252 m_Body.Get( i ).Refresh();
1258 for (
int i = 0; i <
m_Body.Count(); i++ )
1290 for(
int i = 0; i <
m_Body.Count(); i++)
1293 m_Body.Get( i ).OnShow();
void Inventory(LayoutHolder parent)
FindInventoryLocationType
flags for searching locations in inventory
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
override void SetActive(bool active)
override void CheckHeaderDragability()
override void SetLastFocus()
override void SetActive(bool active)
override void SetNextActive()
override EntityAI GetFocusedItem()
override float GetFocusedContainerHeight(bool contents=false)
override bool IsDisplayable()
override void SetPreviousActive(bool force=false)
override Header GetHeader()
override float GetFocusedContainerYScreenPos(bool contents=false)
override void SetDefaultFocus(bool while_micromanagment_mode=false)
override void SetNextLeftActive()
override void SetLastActive()
override void SetNextRightActive()
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
script counterpart to engine's class Inventory
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
static int GetCombinationFlags(EntityAI entity1, EntityAI entity2)
bool IsMicromanagmentMode()
static ItemManager GetInstance()
void Container(LayoutHolder parent)
bool CanCombineEx(EntityAI focusedEntity)
bool CanSwapOrTakeToHandsEx(EntityAI focusedEntity)
void SetSlotIcon(SlotsIcon icon)
void ExpandCollapseContainer()
override void UpdateInterval()
ref array< ref LayoutHolder > m_Body
override void SetFirstActive()
EntityAI GetFocusedContainerEntity()
ref array< LayoutHolder > m_OpenedContainers
Container GetContainer(int index)
float GetFocusedContainerYPos(bool contents=false)
EntityAI GetFocusedItem()
override void SetLayoutName()
override void SetLastActive()
void SetFocusedColumn(int column)
bool CanAddToQuickbarEx(EntityAI focusedEntity)
bool CanSwapOrTakeToHands()
ScrollWidget GetScrollWidget()
void ResetFocusedContainer()
bool CanTakeToInventory()
const int SORT_CARGO_NEXT_OFFSET
void SetFocusedContainer(Container cont)
void SetSameLevelNextActive()
void DraggingOver(Widget w, int x, int y, Widget receiver)
void SetPreviousActive(bool force=false)
bool TransferItemToVicinity()
const int SORT_ATTACHMENTS_NEXT_OFFSET
bool CanOpenCloseContainer()
void ScrollToActiveContainer(ScrollWidget sw)
Container GetFocusedContainer()
void MoveGridCursor(int direction)
void ScrollToActiveContainer()
void CheckScrollbarVisibility()
void DraggingOverHeader(Widget w, int x, int y, Widget receiver)
bool IsItemWithQuantityActive()
void SetOpenForSlotIcon(bool open, SlotsIcon icon=null)
override void UpdateSelectionIcons()
bool IsLastContainerFocused()
void SetForceShow(bool value)
void HideContent(bool force_hide=false)
bool CanEquipEx(EntityAI focusedEntity)
void SetDefaultFocus(bool while_micromanagment_mode=false)
void Remove(LayoutHolder container)
void Insert(LayoutHolder container, int pos=-1, bool immedUpdate=true)
ScrollWidget GetSlotsScrollWidget()
const int SORT_ATTACHMENTS_OWN
bool AddItemToQuickbarRadial(EntityAI itemToAssign)
void ShowContent(bool force_show=false)
void RecomputeOpenedContainers()
void SetNextRightActive()
override void SetActive(bool active)
Container m_FocusedContainer
void SetHeader(Header header)
bool CanOpenCloseContainerEx(EntityAI focusedEntity)
bool CanDropEx(EntityAI focusedEntity)
void SetActiveIndex(int index)
bool CanTakeToInventoryEx(EntityAI focusedEntity)
void CheckHeaderDragability()
bool CanSplitEx(EntityAI focusedEntity)
void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
bool IsFirstContainerFocused()
void SetColumnCount(int count)
void SetSameLevelPreviousActive()
void CheckScrollbarVisibility(ScrollWidget sw)
float GetFocusedContainerYScreenPos(bool contents=false)
SlotsIcon GetFocusedSlotsIcon()
float GetFocusedContainerHeight(bool contents=false)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.