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 );
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)
FindInventoryLocationType
flags for searching locations in inventory
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
override void SetActive(bool active)
proto native DayZPlayer GetPlayer()
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.
proto native CGame GetGame()