17 Widget rip = m_SlotIcon.GetRadialIconPanel();
77 icon.GetMainWidget().Show(
true);
101 RecomputeOpenedContainers();
122 if (
icon.IsReserved())
123 m_Player.GetOnAttachmentReleaseLock().Invoke(
item, slot);
132 if (GetFocusedContainer())
133 current_sort = GetFocusedContainer().GetRootWidget().GetSort();
135 if (
item.GetSlotsCountCorrect() > 0)
137 ContainerWithCargoAndAttachments
iwca =
new ContainerWithCargoAndAttachments(
this,
sort_index);
142 if (
iwca.IsDisplayable())
143 icon.GetRadialIconPanel().Show(
true);
145 RecomputeOpenedContainers();
148 else if (
item.GetInventory().GetCargo())
150 ContainerWithCargo
iwc =
new ContainerWithCargo(
this,
sort_index);
153 iwc.UpdateInterval();
156 RecomputeOpenedContainers();
157 if (
iwc.IsDisplayable())
158 icon.GetRadialIconPanel().Show(
true);
165 string config =
"CfgVehicles " +
item.GetType() +
" GUIInventoryAttachmentsProps";
172 SetOpenForSlotIcon(
conta.IsOpened(),
icon);
175 UpdateSelectionIcons();
189 RecomputeOpenedContainers();
190 GetMainWidget().Update();
198 in.UpdateConsoleToolbar();
200 UpdateSelectionIcons();
266 if (
g_Game.IsLeftCtrlDown())
290 GetRootWidget().GetScreenPos(
x,
y);
298 GetRootWidget().GetScreenPos(
x,
y);
299 GetRootWidget().GetScreenSize(
x2,
y2);
307 if (
c_cont && m_Body.Count() > 1)
318 if (++
index < m_Body.Count())
330 RecomputeOpenedContainers();
336 return ent && (
ent.GetInventory().GetCargo() ||
ent.GetSlotsCountCorrect() > 0);
368 if (
w ==
null ||
m_Player.GetInventory().IsInventoryLocked())
373 string name =
w.GetName();
374 name.Replace(
"PanelWidget",
"Render");
391 if (!
item.GetInventory().CanRemoveEntity())
394 if (
player.GetInventory().HasEntityInInventory(
item) &&
player.GetHumanInventory().CanAddEntityInHands(
item))
398 if (
player.GetInventory().CanAddEntityToInventory(
item) &&
item.GetInventory().CanRemoveEntity())
400 if (
item.GetTargetQuantityMax() <
item.GetQuantity())
407 if (
item.GetTargetQuantityMax() <
item.GetQuantity())
418 menu.RefreshQuickbar();
430 return GetFocusedContainer().IsInherited(ContainerWithCargo);
435 return GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments);
442 if (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
443 return GetFocusedContainer().TransferItemToVicinity();
450 if (
item.GetTargetQuantityMax() <
item.GetQuantity())
451 item.SplitIntoStackMaxClient(
null, -1);
463 if (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
464 return GetFocusedContainer().InspectItem();
488 if (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
489 return GetFocusedContainer().SplitItem();
499 if (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
500 return GetFocusedContainer().EquipItem();
516 if (CanTakeToInventory())
522 if (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
523 return GetFocusedContainer().TransferItem();
536 if (!GetFocusedContainer().IsInherited(ContainerWithCargo) && !GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
552 return GetFocusedContainer().GetFocusedItem();
559 if (GetFocusedContainer() && (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments)))
560 return GetFocusedContainer().Combine();
577 if (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
578 return GetFocusedContainer().Select();
684 icon.GetMainWidget().Show(
true);
705 if (!
item.GetInventory().CanRemoveEntity())
717 string name =
w.GetName();
718 name.Replace(
"PanelWidget",
"Render");
807 if (
item.GetInventory().CanRemoveEntity())
876 menu.RefreshQuickbar();
884 menu.RefreshQuickbar();
892 menu.RefreshQuickbar();
909 else if (
m_Player.GetInventory().CanAddAttachment(
item))
921 ItemBase.Cast(
item).SplitIntoStackMaxToInventoryLocationClient(
il);
928 menu.RefreshQuickbar();
948 m_Body.SwapItems(m_Body.Find(
cont1), m_Body.Find(
cont2));
951 RecomputeOpenedContainers();
961 icon.UpdateInterval();
967 cont.UpdateInterval();
975 item.GetInventory().GetCurrentInventoryLocation(
il);
990 if (
c &&
c.IsDisplayable())
1001 string name =
w.GetName();
1002 name.Replace(
"PanelWidget",
"Render");
1007 RecomputeOpenedContainers();
1015 super.CollapseButtonOnMouseButtonDown(
w);
1020 if (GetFocusedContainer() && (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments)))
1029 m_MainWidget.Update();
1031 UpdateSelectionIcons();
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
void Inventory(LayoutHolder parent)
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
FindInventoryLocationType
flags for searching locations in inventory
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
PluginBase GetPlugin(typename plugin_type)
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
override void Remove(LayoutHolder container)
ref CollapsibleHeader m_CollapsibleHeader
override Header GetHeader()
override void SetHeader(Header header)
static ColorManager GetInstance()
script counterpart to engine's class Inventory
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
provides access to slot configuration
static proto native owned string GetSlotDisplayName(int id)
converts slot_id to string
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
static ItemManager GetInstance()
override void ExpandCollapseContainer()
void OnAttachmentReservationRelease(EntityAI item, int slot_id)
override bool IsItemWithQuantityActive()
override void UpdateRadialIcon()
const int HEADER_INDEX_OFFSET
override bool OnChildRemove(Widget w, Widget child)
override bool OnChildAdd(Widget w, Widget child)
float GetMainContainerTopPos()
override void DraggingOver(Widget w, int x, int y, Widget receiver)
override bool InspectItem()
override void CollapseButtonOnMouseButtonDown(Widget w)
bool IsPlayerEquipmentActive()
void ItemAttached(EntityAI item, string slot_name)
SlotsIcon GetSlotsIcon(int row, int column)
override void Insert(LayoutHolder container, int pos=-1, bool immedUpdate=true)
void SetPlayer(PlayerBase player)
override bool EquipItem()
ref map< int, ref Container > m_ShowedItemsIDs
override EntityAI GetFocusedItem()
void ToggleWidget(Widget w)
override bool TransferItem()
void OnAttachmentReservationSet(EntityAI item, int slot_id)
bool HasEntityContainerVisible(EntityAI entity)
float GetMainContainerBottomPos()
bool IsItemWithContainerActive()
override void UpdateInterval()
void UnfocusPlayerAttachmentsContainer()
override bool SplitItem()
override void DraggingOverHeader(Widget w, int x, int y, Widget receiver)
override bool TransferItemToVicinity()
int GetRecipeCount(bool recipe_anywhere, EntityAI entity1, EntityAI entity2)
bool IsContainerWithCargoActive()
override bool CanOpenCloseContainerEx(EntityAI focusedEntity)
ref AttachmentsGroupContainer m_PlayerAttachmentsContainer
void MouseClick(Widget w, int x, int y, int button)
bool IsItemWithAttachmentsActive()
void AddSlotsContainer(int row_count)
void ToggleContainer(Widget w, EntityAI item)
void ItemDetached(EntityAI item, string slot_name)
void SwapItemsInOrder(int slot1, int slot2)
void PlayerContainer(LayoutHolder parent, int sort=-1)
void OnDropReceivedFromGhostArea(Widget w, int x, int y, Widget receiver)
override void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
ItemPreviewWidget GetItemPreviewWidget(Widget w)
override bool IsItemActive()
void DoubleClick(Widget w, int x, int y, int button)
ref map< int, SlotsIcon > m_InventorySlots
ref map< EntityAI, ref Container > m_ShowedItems
static int HasItemQuantity(notnull EntityAI item)
static void TakeOrSplitToInventory(notnull PlayerBase player, notnull EntityAI target, notnull EntityAI item)
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()