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);
289 else if( GetRootWidget() )
290 GetRootWidget().GetScreenSize(
x,
y );
310 else if( GetRootWidget() )
311 GetRootWidget().GetPos(
x,
y );
321 else if( GetRootWidget() )
322 GetRootWidget().GetScreenPos(
x,
y );
422 res =
g_Game.GetPlayer().PredictiveTakeOrSwapAttachment(ent);
479 return focusedEntity.CanBeSplit();
510 return player.CanDropEntity(focusedEntity);
538 EntityAI entityInHands = player.GetItemInHands();
554 return player.GetInventory().CanAddEntityIntoHands(focusedEntity);
592 for (
int i = 0; i < focusedEntity.GetInventory().GetSlotIdCount(); i++)
594 int slot_id = focusedEntity.GetInventory().GetSlotId(i);
595 EntityAI slot_item = player.GetInventory().FindAttachment( slot_id );
596 if (slot_item && player.GetInventory().CanSwapEntitiesEx( focusedEntity, slot_item ))
657 if (focusedEntity != entityInHands)
680 if (focusedEntity.GetHierarchyRootPlayer() == player)
695 dpi = player.GetDayZPlayerInventory();
697 if (itemToAssign && dpi && !dpi.IsProcessing())
699 RadialQuickbarMenu.SetItemToAssign(itemToAssign);
770 for (
int i = 0; i <
m_Body.Count(); i++ )
773 m_Body.Get( i ).UpdateInterval();
863 super.SetActive( active );
869 if (m_MainWidget.FindAnyWidget(
"SelectedContainer"))
871 m_MainWidget.FindAnyWidget(
"SelectedContainer").Show(active);
903 for (
int i = 0; i <
Count(); i++ )
908 if (
Get(i) &&
Get(i).GetMainWidget())
909 Get( i ).GetMainWidget().GetUserData(icon);
966 if (active && active.IsActive())
970 if (!active || !active.IsActive())
1001 if (active && active.IsActive())
1006 if (!active || !active.IsActive())
1065 if (active && active.IsActive())
1068 if (icon && icon.GetParent() &&
SlotsContainer.Cast(icon.GetParent()))
1078 active.SetSameLevelNextActive();
1081 if (!active || !active.IsActive())
1110 if (active && active.IsActive())
1113 if (icon && icon.GetParent() &&
SlotsContainer.Cast(icon.GetParent()))
1123 active.SetSameLevelPreviousActive();
1126 if (!active || !active.IsActive())
1152 bool need_reset_focus =
false;
1154 for (i = 0; i <
m_Body.Count(); i++)
1159 c.RecomputeOpenedContainers();
1164 else if (c.IsActive())
1167 need_reset_focus =
true;
1178 need_reset_focus =
true;
1183 need_reset_focus =
false;
1189 if (need_reset_focus)
1203 if ( pos > -1 && pos <
m_Body.Count() )
1207 m_Body.InsertAt( container, pos );
1210 m_Body.Insert( container );
1220 int index =
m_Body.Find( container );
1239 m_Body.RemoveItem( container );
1253 for (
int i = 0; i <
m_Body.Count(); i++ )
1256 m_Body.Get( i ).Refresh();
1262 for (
int i = 0; i <
m_Body.Count(); i++ )
1280 for(
int i = 0; i <
m_Body.Count(); i++)
1283 m_Body.Get( i ).OnHide();
1294 for(
int i = 0; i <
m_Body.Count(); i++)
1297 m_Body.Get( i ).OnShow();
void Inventory(LayoutHolder parent)
override void SetActive(bool active)
override void SetPreviousActive(bool force=false)
override void SetNextActive()
override float GetFocusedContainerYScreenPos(bool contents=false)
override void SetLastFocus()
override void SetActive(bool active)
override void SetNextRightActive()
override Header GetHeader()
override void CheckHeaderDragability()
override float GetFocusedContainerHeight(bool contents=false)
override void SetDefaultFocus(bool while_micromanagment_mode=false)
override void SetLastActive()
override void SetNextLeftActive()
override EntityAI GetFocusedItem()
override bool IsDisplayable()
script counterpart to engine's class Inventory
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
proto native int GetSlot()
returns slot id if current type is Attachment
proto native EntityAI GetParent()
returns parent of current inventory location
bool IsMicromanagmentMode()
static int GetCombinationFlags(EntityAI entity1, EntityAI entity2)
static ItemManager GetInstance()
void SetSameLevelNextActive()
void DraggingOver(Widget w, int x, int y, Widget receiver)
void ScrollToActiveContainer()
void SetPreviousActive(bool force=false)
void ExpandCollapseContainer()
void SetDefaultFocus(bool while_micromanagment_mode=false)
float GetFocusedContainerHeight(bool contents=false)
EntityAI GetFocusedItem()
const int SORT_ATTACHMENTS_NEXT_OFFSET
ref array< ref LayoutHolder > m_Body
bool CanOpenCloseContainerEx(EntityAI focusedEntity)
const int SORT_CARGO_NEXT_OFFSET
void SetColumnCount(int count)
bool IsLastContainerFocused()
bool CanDropEx(EntityAI focusedEntity)
void Remove(LayoutHolder container)
void CheckScrollbarVisibility(ScrollWidget sw)
bool CanSwapOrTakeToHands()
override void UpdateSelectionIcons()
override void UpdateInterval()
void ScrollToActiveContainer(ScrollWidget sw)
SlotsIcon GetFocusedSlotsIcon()
void HideContent(bool force_hide=false)
Container GetFocusedContainer()
void SetSlotIcon(SlotsIcon icon)
void MoveGridCursor(int direction)
void DraggingOverHeader(Widget w, int x, int y, Widget receiver)
void CheckScrollbarVisibility()
bool IsItemWithQuantityActive()
void SetActiveIndex(int index)
override void SetActive(bool active)
void SetFocusedColumn(int column)
void RecomputeOpenedContainers()
const int SORT_ATTACHMENTS_OWN
bool CanCombineEx(EntityAI focusedEntity)
ref array< LayoutHolder > m_OpenedContainers
void SetForceShow(bool value)
void SetFocusedContainer(Container cont)
float GetFocusedContainerYPos(bool contents=false)
bool IsFirstContainerFocused()
bool AddItemToQuickbarRadial(EntityAI itemToAssign)
bool CanSwapOrTakeToHandsEx(EntityAI focusedEntity)
bool CanOpenCloseContainer()
float GetFocusedContainerYScreenPos(bool contents=false)
bool CanTakeToInventory()
Container GetContainer(int index)
void SetOpenForSlotIcon(bool open, SlotsIcon icon=null)
bool CanTakeToInventoryEx(EntityAI focusedEntity)
void Insert(LayoutHolder container, int pos=-1, bool immedUpdate=true)
void SetHeader(Header header)
bool CanEquipEx(EntityAI focusedEntity)
void SetSameLevelPreviousActive()
void SetNextRightActive()
Container m_FocusedContainer
EntityAI GetFocusedContainerEntity()
override void SetFirstActive()
bool TransferItemToVicinity()
void Container(LayoutHolder parent)
override void SetLastActive()
override void SetLayoutName()
bool CanSplitEx(EntityAI focusedEntity)
ScrollWidget GetScrollWidget()
void ResetFocusedContainer()
bool CanAddToQuickbarEx(EntityAI focusedEntity)
void CheckHeaderDragability()
void ShowContent(bool force_show=false)
void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
ScrollWidget GetSlotsScrollWidget()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
FindInventoryLocationType
flags for searching locations in inventory
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]