DayZ 1.24
Loading...
Searching...
No Matches
PlayerContainer Class Reference
Inheritance diagram for PlayerContainer:
[legend]
Collaboration diagram for PlayerContainer:
[legend]

Protected Member Functions

override void UpdateRadialIcon ()
 
bool HasEntityContainerVisible (EntityAI entity)
 
SlotsIcon GetSlotsIcon (int row, int column)
 
void PlayerContainer (LayoutHolder parent, int sort=-1)
 
void ~PlayerContainer ()
 
void ItemAttached (EntityAI item, string slot_name)
 
void ItemDetached (EntityAI item, string slot_name)
 
void OnAttachmentReservationSet (EntityAI item, int slot_id)
 
void OnAttachmentReservationRelease (EntityAI item, int slot_id)
 
void AddSlotsContainer (int row_count)
 
void MouseClick (Widget w, int x, int y, int button)
 
float GetMainContainerTopPos ()
 
float GetMainContainerBottomPos ()
 
override void Insert (LayoutHolder container, int pos=-1, bool immedUpdate=true)
 
bool IsItemWithContainerActive ()
 
override bool IsItemWithQuantityActive ()
 
override bool IsItemActive ()
 
bool IsEmptyItemActive ()
 
void UnfocusPlayerAttachmentsContainer ()
 
void DoubleClick (Widget w, int x, int y, int button)
 
override void ExpandCollapseContainer ()
 
bool IsContainerWithCargoActive ()
 
bool IsItemWithAttachmentsActive ()
 
override bool TransferItemToVicinity ()
 
override bool InspectItem ()
 
int GetRecipeCount (bool recipe_anywhere, EntityAI entity1, EntityAI entity2)
 
override bool SplitItem ()
 
override bool EquipItem ()
 
override bool TransferItem ()
 
override EntityAI GetFocusedItem ()
 
override bool Combine ()
 
override bool Select ()
 
void SetPlayer (PlayerBase player)
 
override void OnDropReceivedFromHeader (Widget w, int x, int y, Widget receiver)
 
ItemPreviewWidget GetItemPreviewWidget (Widget w)
 
override void DraggingOverHeader (Widget w, int x, int y, Widget receiver)
 
override void DraggingOver (Widget w, int x, int y, Widget receiver)
 
void OnDropReceivedFromGhostArea (Widget w, int x, int y, Widget receiver)
 
void SwapItemsInOrder (int slot1, int slot2)
 
override void UpdateInterval ()
 
void ToggleContainer (Widget w, EntityAI item)
 
override bool CanOpenCloseContainerEx (EntityAI focusedEntity)
 
void ToggleWidget (Widget w)
 
override void CollapseButtonOnMouseButtonDown (Widget w)
 
bool IsPlayerEquipmentActive ()
 
override void Refresh ()
 
override bool OnChildRemove (Widget w, Widget child)
 
override bool OnChildAdd (Widget w, Widget child)
 

Protected Attributes

ref AttachmentsGroupContainer m_PlayerAttachmentsContainer
 
ref map< int, SlotsIconm_InventorySlots
 
ref map< EntityAI, ref Containerm_ShowedItems = new ref map<EntityAI, ref Container>
 
ref map< int, ref Containerm_ShowedItemsIDs = new ref map<int, ref Container>
 
PlayerBase m_Player
 
const int HEADER_INDEX_OFFSET = 2
 

Additional Inherited Members

- Private Member Functions inherited from CollapsibleContainer
void CollapsibleContainer (LayoutHolder parent, int sort=-1)
 
override void SetLayoutName ()
 
EntityAI GetEntity ()
 
override void OnDropReceivedFromHeader (Widget w, int x, int y, Widget receiver)
 
override void Refresh ()
 
override void OnShow ()
 
override void OnHide ()
 
override void Insert (LayoutHolder container, int pos=-1, bool immedUpdate=true)
 
override void Remove (LayoutHolder container)
 
bool CanDisplayAnyCategory ()
 
void UpdateCollapseButtons ()
 
void LoadDefaultState ()
 
bool IsHidden ()
 
void CollapseButtonOnMouseButtonDown (Widget w)
 
override void Toggle ()
 
override bool OnChildRemove (Widget w, Widget child)
 
override bool OnChildAdd (Widget w, Widget child)
 
override Header GetHeader ()
 
override void SetHeader (Header header)
 
void SetCollapsibleHeaderArrowState (bool open)
 
- Private Attributes inherited from CollapsibleContainer
ref CollapsibleHeader m_CollapsibleHeader
 
bool m_Hidden
 

Detailed Description

Definition at line 1 of file PlayerContainer.c.

Constructor & Destructor Documentation

◆ PlayerContainer()

void PlayerContainer::PlayerContainer ( LayoutHolder parent,
int sort = -1 )
inlineprotected

Definition at line 34 of file PlayerContainer.c.

35 {
38
40 m_CollapsibleHeader.SetName("#container_inventory");
42 m_Body.Insert(m_PlayerAttachmentsContainer);
43 m_MainWidget = m_RootWidget.FindAnyWidget("body");
44 m_PlayerAttachmentsContainer.GetRootWidget().SetColor(166 << 24 | 80 << 16 | 80 << 8 | 80);
45 WidgetEventHandler.GetInstance().RegisterOnChildAdd(m_MainWidget, this, "OnChildAdd");
46 WidgetEventHandler.GetInstance().RegisterOnChildRemove(m_MainWidget, this, "OnChildRemove");
47
48 //START - InitGhostSlots
49 string config_path_ghosts_slots = "CfgVehicles SurvivorBase InventoryEquipment playerSlots";
52
53 for (int i = 0; i < player_ghosts_slots.Count(); i++)
54 {
55 string slot_name = player_ghosts_slots.Get(i);
56 string path = "CfgSlots" + " " + slot_name;
57
58 if (GetGame().ConfigIsExisting(path))
59 {
60 string icon_name; //icon_name must be in format "set:<setname> image:<imagename>"
61 GetGame().ConfigGetText(path + " ghostIcon", icon_name);
62 int slot_number = i;
64
65 //START - GetWidgetSlot
67 if (row >= m_PlayerAttachmentsContainer.Count())
68 {
69 if (row < (player_ghosts_slots.Count() / ITEMS_IN_ROW))
71 else
73 }
74
76
77 icon.GetMainWidget().Show(true);
78 icon.Clear();
79
80 WidgetEventHandler.GetInstance().RegisterOnDoubleClick(icon.GetPanelWidget(), this, "DoubleClick");
81
82 //END - GetWidgetSlot
83 WidgetEventHandler.GetInstance().RegisterOnDropReceived(icon.GetPanelWidget(), this, "OnDropReceivedFromGhostArea");
84 WidgetEventHandler.GetInstance().RegisterOnDropReceived(icon.GetGhostSlot(), this, "OnDropReceivedFromGhostArea");
85 WidgetEventHandler.GetInstance().RegisterOnDraggingOver(icon.GetGhostSlot(), this, "DraggingOver");
86 WidgetEventHandler.GetInstance().RegisterOnDraggingOver(icon.GetPanelWidget(), this, "DraggingOver");
87 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown(icon.GetPanelWidget(), this, "MouseClick");
88
90 //END - LoadIconIntoWidgetSlot
91
92 GetGame().ConfigGetText(path + " name", slot_name);
94 icon.SetSlotID(slot_id);
95 icon.SetSlotDisplayName(InventorySlots.GetSlotDisplayName(slot_id));
97 }
98 }
99 m_PlayerAttachmentsContainer.GetMainWidget().Update();
100 //END - InitGhostSlots
101 RecomputeOpenedContainers();
102 }
const int ITEMS_IN_ROW
Definition Attachments.c:1
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
ref CollapsibleHeader m_CollapsibleHeader
override Header GetHeader()
override void SetHeader(Header header)
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
SlotsIcon GetSlotsIcon(int row, int column)
ref AttachmentsGroupContainer m_PlayerAttachmentsContainer
void AddSlotsContainer(int row_count)
ref map< int, SlotsIcon > m_InventorySlots
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 WidgetEventHandler GetInstance()
proto native CGame GetGame()

References AddSlotsContainer(), GetGame(), CollapsibleContainer::GetHeader(), WidgetEventHandler::GetInstance(), InventorySlots::GetSlotDisplayName(), InventorySlots::GetSlotIdFromString(), GetSlotsIcon(), StaticGUIUtils::IMAGESETGROUP_INVENTORY, ITEMS_IN_ROW, CollapsibleContainer::m_CollapsibleHeader, m_InventorySlots, m_PlayerAttachmentsContainer, m_RootWidget, path, CollapsibleContainer::SetHeader(), and StaticGUIUtils::VerifyIconImageString().

◆ ~PlayerContainer()

void PlayerContainer::~PlayerContainer ( )
inlineprotected

Definition at line 104 of file PlayerContainer.c.

105 {
106 if (m_Player)
107 {
108 m_Player.GetOnItemAttached().Remove(ItemAttached);
109 m_Player.GetOnItemDetached().Remove(ItemDetached);
110 m_Player.GetOnAttachmentSetLock().Remove(OnAttachmentReservationSet);
111 m_Player.GetOnAttachmentReleaseLock().Remove(OnAttachmentReservationRelease);
112 }
113 }
void OnAttachmentReservationRelease(EntityAI item, int slot_id)
void ItemAttached(EntityAI item, string slot_name)
void OnAttachmentReservationSet(EntityAI item, int slot_id)
PlayerBase m_Player
void ItemDetached(EntityAI item, string slot_name)

References ItemAttached(), ItemDetached(), m_Player, OnAttachmentReservationRelease(), and OnAttachmentReservationSet().

Member Function Documentation

◆ AddSlotsContainer()

void PlayerContainer::AddSlotsContainer ( int row_count)
inlineprotected

◆ CanOpenCloseContainerEx()

override bool PlayerContainer::CanOpenCloseContainerEx ( EntityAI focusedEntity)
inlineprotected

Definition at line 985 of file PlayerContainer.c.

986 {
987 if (focusedEntity)
988 {
990 if (c && c.IsDisplayable())
991 return true;
992 }
993 return false;
994 }
ref map< EntityAI, ref Container > m_ShowedItems

References m_ShowedItems.

◆ CollapseButtonOnMouseButtonDown()

override void PlayerContainer::CollapseButtonOnMouseButtonDown ( Widget w)
inlineprotected

Definition at line 1013 of file PlayerContainer.c.

1014 {
1015 super.CollapseButtonOnMouseButtonDown(w);
1016 }

◆ Combine()

override bool PlayerContainer::Combine ( )
inlineprotected

Definition at line 555 of file PlayerContainer.c.

556 {
557 if (CanCombine())
558 {
559 if (GetFocusedContainer() && (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments)))
560 return GetFocusedContainer().Combine();
561 else
562 {
564 ItemBase item_in_hands = ItemBase.Cast(GetGame().GetPlayer().GetHumanInventory().GetEntityInHands());
565
566 Icon hands_icon = ItemManager.GetInstance().GetHandsPreview().GetIcon();
567
568 if (item_in_hands && item)
569 return hands_icon.CombineItems(item_in_hands, item);
570 }
571 }
572 return true;
573 }
PlayerBase GetPlayer()
Definition Icon.c:2
static ItemManager GetInstance()
override EntityAI GetFocusedItem()

References GetFocusedItem(), GetGame(), ItemManager::GetInstance(), and GetPlayer().

◆ DoubleClick()

void PlayerContainer::DoubleClick ( Widget w,
int x,
int y,
int button )
inlineprotected

Definition at line 362 of file PlayerContainer.c.

363 {
364 if (button == MouseState.LEFT && !g_Game.IsLeftCtrlDown())
365 {
367
368 if (w == null || m_Player.GetInventory().IsInventoryLocked())
369 return;
370 ItemPreviewWidget iw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
371 if (!iw)
372 {
373 string name = w.GetName();
374 name.Replace("PanelWidget", "Render");
375 iw = ItemPreviewWidget.Cast(w.FindAnyWidget(name));
376 }
377 if (!iw)
378 iw = ItemPreviewWidget.Cast(w);
379
380 ItemBase item = ItemBase.Cast(iw.GetItem());
381
382 if (!item)
383 return;
384
386 iw.GetUserData(icon);
387
388 if (icon && icon.IsReserved())
389 return;
390
391 if (!item.GetInventory().CanRemoveEntity())
392 return;
393
394 if (player.GetInventory().HasEntityInInventory(item) && player.GetHumanInventory().CanAddEntityInHands(item))
395 player.PredictiveTakeEntityToHands(item);
396 else
397 {
398 if (player.GetInventory().CanAddEntityToInventory(item) && item.GetInventory().CanRemoveEntity())
399 {
400 if (item.GetTargetQuantityMax() < item.GetQuantity())
401 item.SplitIntoStackMaxClient(player, -1);
402 else
403 player.PredictiveTakeEntityToInventory(FindInventoryLocationType.ANY, item);
404 }
405 else
406 {
407 if (item.GetTargetQuantityMax() < item.GetQuantity())
408 item.SplitIntoStackMaxHandsClient(player);
409 else
410 player.PredictiveTakeEntityToHands(item);
411 }
412 }
414 HideOwnedTooltip();
415
416 InventoryMenu menu = InventoryMenu.Cast(GetGame().GetUIManager().FindMenu(MENU_INVENTORY));
417 if (menu)
418 menu.RefreshQuickbar();
419 }
420 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Definition DayZGame.c:3528
FindInventoryLocationType
flags for searching locations in inventory
void InventoryMenu()
void ToggleWidget(Widget w)
const int MENU_INVENTORY
Definition constants.c:170
MouseState
Definition EnSystem.c:311

References g_Game, GetGame(), GetPlayer(), InventoryMenu(), m_Player, MENU_INVENTORY, name, and ToggleWidget().

◆ DraggingOver()

override void PlayerContainer::DraggingOver ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected

Definition at line 755 of file PlayerContainer.c.

756 {
757 if (w == null)
758 return;
759
761 bool is_reserved = false;
762
764 receiver.GetUserData(slots_icon);
765
766 if (slots_icon)
767 {
768 receiver_item = slots_icon.GetEntity();
769 is_reserved = slots_icon.IsReserved();
770 }
771
773
774 if (!ipw || !ipw.IsInherited(ItemPreviewWidget))
775 return;
776
777 EntityAI item = ipw.GetItem();
778 if (!item)
779 return;
780
782 {
784 {
786 ItemManager.GetInstance().HideDropzones();
787 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
788 return;
789 }
790 else if (receiver_item.GetInventory().CanAddAttachment(item) || receiver_item.GetInventory().CanAddEntityInCargo(item, item.GetInventory().GetFlipCargo()) && !receiver_item.GetInventory().HasEntityInCargo(item))
791 {
793 ItemManager.GetInstance().HideDropzones();
794 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
795 return;
796 }
797 else if ((ItemBase.Cast(receiver_item)).CanBeCombined(ItemBase.Cast(item)))
798 {
800 ItemManager.GetInstance().HideDropzones();
801 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
802 return;
803 }
804
805 }
806
807 if (item.GetInventory().CanRemoveEntity())
808 {
809 if (m_Player.GetInventory().CanAddAttachment(item))
810 {
812 ItemManager.GetInstance().HideDropzones();
813 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
814 }
815 else if (m_Player.GetInventory().CanAddEntityToInventory(item, FindInventoryLocationType.CARGO | FindInventoryLocationType.ATTACHMENT) && (!m_Player.GetInventory().HasEntityInInventory(item)) || m_Player.GetHumanInventory().HasEntityInHands(item))
816 {
818 ItemManager.GetInstance().HideDropzones();
819 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
820 }
822 {
824 ItemManager.GetInstance().HideDropzones();
825 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
826 }
827 else
828 {
830 ItemManager.GetInstance().HideDropzones();
831 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
832 }
833 }
834 else
835 {
837 ItemManager.GetInstance().HideDropzones();
838 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
839 //ItemManager.GetInstance().ShowSourceDropzone( item );
840 }
841 }
static int COMBINE_COLOR
static int SWAP_COLOR
static int GREEN_COLOR
static int RED_COLOR
static ColorManager GetInstance()
script counterpart to engine's class Inventory
Definition Inventory.c:79
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition Inventory.c:610
ItemPreviewWidget GetItemPreviewWidget(Widget w)

References GameInventory::CanSwapEntitiesEx(), ColorManager::COMBINE_COLOR, ColorManager::GetInstance(), ItemManager::GetInstance(), GetItemPreviewWidget(), ColorManager::GREEN_COLOR, m_Player, ColorManager::RED_COLOR, and ColorManager::SWAP_COLOR.

◆ DraggingOverHeader()

override void PlayerContainer::DraggingOverHeader ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected

Definition at line 727 of file PlayerContainer.c.

728 {
729 if (w == null)
730 return;
732
733 if (!ipw || !ipw.IsInherited(ItemPreviewWidget))
734 return;
735
736 EntityAI item = ipw.GetItem();
737 if (!item)
738 return;
739
740 if (m_Player.GetInventory().CanAddEntityToInventory(item, FindInventoryLocationType.CARGO | FindInventoryLocationType.ATTACHMENT) && !m_Player.GetInventory().HasEntityInInventory(item))
741 {
742 ItemManager.GetInstance().HideDropzones();
743 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
745 }
746 else
747 {
748 ItemManager.GetInstance().HideDropzones();
749 ItemManager.GetInstance().GetRightDropzone().SetAlpha(1);
751 //ItemManager.GetInstance().ShowSourceDropzone( item );
752 }
753 }

References ColorManager::GetInstance(), ItemManager::GetInstance(), GetItemPreviewWidget(), ColorManager::GREEN_COLOR, m_Player, and ColorManager::RED_COLOR.

◆ EquipItem()

override bool PlayerContainer::EquipItem ( )
inlineprotected

Definition at line 495 of file PlayerContainer.c.

496 {
497 if (CanEquip())
498 {
499 if (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
500 return GetFocusedContainer().EquipItem();
501 else
502 {
504 if (item)
505 {
506 GetGame().GetPlayer().PredictiveTakeEntityToInventory(FindInventoryLocationType.ATTACHMENT, item);
507 return true;
508 }
509 }
510 }
511 return false;
512 }

References GetFocusedItem(), and GetGame().

◆ ExpandCollapseContainer()

override void PlayerContainer::ExpandCollapseContainer ( )
inlineprotected

Definition at line 422 of file PlayerContainer.c.

423 {
424 if (m_PlayerAttachmentsContainer.IsActive())
425 ToggleWidget(m_PlayerAttachmentsContainer.GetFocusedSlotsIcon().GetPanelWidget());
426 }

References m_PlayerAttachmentsContainer, and ToggleWidget().

◆ GetFocusedItem()

override EntityAI PlayerContainer::GetFocusedItem ( )
inlineprotected

Definition at line 550 of file PlayerContainer.c.

551 {
552 return GetFocusedContainer().GetFocusedItem();
553 }

Referenced by Combine(), EquipItem(), InspectItem(), IsEmptyItemActive(), IsItemActive(), IsItemWithContainerActive(), IsItemWithQuantityActive(), TransferItem(), and TransferItemToVicinity().

◆ GetItemPreviewWidget()

ItemPreviewWidget PlayerContainer::GetItemPreviewWidget ( Widget w)
inlineprotected

Definition at line 712 of file PlayerContainer.c.

713 {
714 ItemPreviewWidget ipw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
715 if (!ipw)
716 {
717 string name = w.GetName();
718 name.Replace("PanelWidget", "Render");
719 ipw = ItemPreviewWidget.Cast(w.FindAnyWidget(name));
720 }
721 if (!ipw)
722 ipw = ItemPreviewWidget.Cast(w);
723
724 return ipw;
725 }

References name.

Referenced by DraggingOver(), DraggingOverHeader(), OnDropReceivedFromGhostArea(), and OnDropReceivedFromHeader().

◆ GetMainContainerBottomPos()

float PlayerContainer::GetMainContainerBottomPos ( )
inlineprotected

Definition at line 294 of file PlayerContainer.c.

295 {
296 float x, y;
297 float x2, y2;
298 GetRootWidget().GetScreenPos(x, y);
299 GetRootWidget().GetScreenSize(x2, y2);
300 y += y2;
301 return y;
302 }
Icon x
Icon y

References x, and y.

◆ GetMainContainerTopPos()

float PlayerContainer::GetMainContainerTopPos ( )
inlineprotected

Definition at line 287 of file PlayerContainer.c.

288 {
289 float x, y;
290 GetRootWidget().GetScreenPos(x, y);
291 return y;
292 }

References x, and y.

◆ GetRecipeCount()

int PlayerContainer::GetRecipeCount ( bool recipe_anywhere,
EntityAI entity1,
EntityAI entity2 )
inlineprotected

Definition at line 478 of file PlayerContainer.c.

479 {
480 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(GetPlugin(PluginRecipesManager));
481 return plugin_recipes_manager.GetValidRecipes(ItemBase.Cast(entity1), ItemBase.Cast(entity2), null, PlayerBase.Cast(GetGame().GetPlayer()));
482 }
PluginBase GetPlugin(typename plugin_type)

References GetGame(), GetPlayer(), and GetPlugin().

◆ GetSlotsIcon()

SlotsIcon PlayerContainer::GetSlotsIcon ( int row,
int column )
inlineprotected

Definition at line 29 of file PlayerContainer.c.

30 {
31 return m_PlayerAttachmentsContainer.GetSlotsIcon(row, column);
32 }

References m_PlayerAttachmentsContainer.

Referenced by PlayerContainer(), and SetPlayer().

◆ HasEntityContainerVisible()

bool PlayerContainer::HasEntityContainerVisible ( EntityAI entity)
inlineprotected

Definition at line 23 of file PlayerContainer.c.

24 {
26 return (cont && cont.IsOpened());
27 }

References m_ShowedItems.

◆ Insert()

override void PlayerContainer::Insert ( LayoutHolder container,
int pos = -1,
bool immedUpdate = true )
inlineprotected

Definition at line 304 of file PlayerContainer.c.

305 {
307 if (c_cont && m_Body.Count() > 1)
308 {
309 ClosableContainer prev = ClosableContainer.Cast(m_Body.Get(1));
310 int index = 1;
311 int curr_sort = c_cont.GetRootWidget().GetSort();
312 while (prev)
313 {
314 int prev_sort = prev.GetRootWidget().GetSort();
315 if (prev_sort > curr_sort)
316 break;
317
318 if (++index < m_Body.Count())
319 prev = ClosableContainer.Cast(m_Body.Get(index));
320 else
321 break;
322 }
323
324 m_Body.InsertAt(container, index);
325 }
326 else
327 m_Body.Insert(container);
328
329 if (immedUpdate)
330 RecomputeOpenedContainers();
331 }

◆ InspectItem()

override bool PlayerContainer::InspectItem ( )
inlineprotected

Definition at line 461 of file PlayerContainer.c.

462 {
463 if (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
464 return GetFocusedContainer().InspectItem();
465 else
466 {
467 Man player = GetGame().GetPlayer();
469 if (item)
470 {
472 return true;
473 }
474 }
475 return false;
476 }
override bool InspectItem()

References GetFocusedItem(), GetGame(), and InspectItem().

Referenced by InspectItem(), and MouseClick().

◆ IsContainerWithCargoActive()

bool PlayerContainer::IsContainerWithCargoActive ( )
inlineprotected

Definition at line 428 of file PlayerContainer.c.

429 {
430 return GetFocusedContainer().IsInherited(ContainerWithCargo);
431 }

◆ IsEmptyItemActive()

bool PlayerContainer::IsEmptyItemActive ( )
inlineprotected

Definition at line 351 of file PlayerContainer.c.

352 {
354 return ent == null;
355 }

References GetFocusedItem().

◆ IsItemActive()

override bool PlayerContainer::IsItemActive ( )
inlineprotected

Definition at line 345 of file PlayerContainer.c.

346 {
349 }
override bool IsItemWithQuantityActive()
bool IsItemWithContainerActive()

References GetFocusedItem(), IsItemWithContainerActive(), and IsItemWithQuantityActive().

◆ IsItemWithAttachmentsActive()

bool PlayerContainer::IsItemWithAttachmentsActive ( )
inlineprotected

Definition at line 433 of file PlayerContainer.c.

434 {
435 return GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments);
436 }

◆ IsItemWithContainerActive()

bool PlayerContainer::IsItemWithContainerActive ( )
inlineprotected

Definition at line 333 of file PlayerContainer.c.

334 {
336 return ent && (ent.GetInventory().GetCargo() || ent.GetSlotsCountCorrect() > 0);
337 }

References GetFocusedItem().

Referenced by IsItemActive().

◆ IsItemWithQuantityActive()

override bool PlayerContainer::IsItemWithQuantityActive ( )
inlineprotected

Definition at line 339 of file PlayerContainer.c.

340 {
342 return ent && QuantityConversions.HasItemQuantity(ent) && ent.CanBeSplit();
343 }
static int HasItemQuantity(notnull EntityAI item)

References GetFocusedItem(), and QuantityConversions::HasItemQuantity().

Referenced by IsItemActive().

◆ IsPlayerEquipmentActive()

bool PlayerContainer::IsPlayerEquipmentActive ( )
inlineprotected

Definition at line 1018 of file PlayerContainer.c.

1019 {
1020 if (GetFocusedContainer() && (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments)))
1021 return false;
1022
1023 return true;
1024 }

◆ ItemAttached()

void PlayerContainer::ItemAttached ( EntityAI item,
string slot_name )
inlineprotected

Definition at line 115 of file PlayerContainer.c.

116 {
118 SlotsIcon icon = m_InventorySlots.Get(slot);
119
120 if (icon)
121 {
122 if (icon.IsReserved())
123 m_Player.GetOnAttachmentReleaseLock().Invoke(item, slot);
124
125 icon.Init(item);
126
127 if (m_ShowedItems.Contains(item) == false)
128 {
129 string name;
130 int sort_index = Inventory.GetPlayerAttachmentIndex(slot);
131 int current_sort = 9999;
132 if (GetFocusedContainer())
133 current_sort = GetFocusedContainer().GetRootWidget().GetSort();
134
135 if (item.GetSlotsCountCorrect() > 0)
136 {
137 ContainerWithCargoAndAttachments iwca = new ContainerWithCargoAndAttachments(this, sort_index);
138 iwca.SetEntity(item);
139 iwca.SetSlotIcon(icon);
140 WidgetEventHandler.GetInstance().RegisterOnMouseButtonUp(icon.GetPanelWidget(), this, "ToggleWidget");
141
142 if (iwca.IsDisplayable())
143 icon.GetRadialIconPanel().Show(true);
144 m_ShowedItems.Insert(item, iwca);
145 RecomputeOpenedContainers();
146 Refresh();
147 }
148 else if (item.GetInventory().GetCargo())
149 {
150 ContainerWithCargo iwc = new ContainerWithCargo(this, sort_index);
151 iwc.SetEntity(item);
152 iwc.SetSlotIcon(icon);
153 iwc.UpdateInterval();
154 WidgetEventHandler.GetInstance().RegisterOnMouseButtonUp(icon.GetPanelWidget(), this, "ToggleWidget");
155 m_ShowedItems.Insert(item, iwc);
156 RecomputeOpenedContainers();
157 if (iwc.IsDisplayable())
158 icon.GetRadialIconPanel().Show(true);
159
160 Refresh();
161 }
162 }
163
165 string config = "CfgVehicles " + item.GetType() + " GUIInventoryAttachmentsProps";
166 if (conta && conta.IsInherited(ClosableContainer))
167 {
168 bool show_radial_icon = (item.GetInventory().GetCargo() || item.GetSlotsCountCorrect() > 0) && !GetGame().ConfigIsExisting(config);
169 Widget rip = icon.GetRadialIconPanel();
170
171 rip.Show(show_radial_icon);
172 SetOpenForSlotIcon(conta.IsOpened(), icon);
173 }
174 }
175 UpdateSelectionIcons();
176 }
void Inventory(LayoutHolder parent)
Definition Inventory.c:76
override void Refresh()

References GetGame(), WidgetEventHandler::GetInstance(), InventorySlots::GetSlotIdFromString(), Inventory(), m_InventorySlots, m_Player, m_ShowedItems, name, and Refresh().

Referenced by SetPlayer(), and ~PlayerContainer().

◆ ItemDetached()

void PlayerContainer::ItemDetached ( EntityAI item,
string slot_name )
inlineprotected

Definition at line 178 of file PlayerContainer.c.

179 {
181 SlotsIcon icon = m_InventorySlots.Get(slot);
182
183 if (icon)
184 {
186 if (con)
187 {
188 (Container.Cast(con.m_Parent)).Remove(con);
189 RecomputeOpenedContainers();
190 GetMainWidget().Update();
191 Refresh();
192 m_ShowedItems.Remove(item);
193 }
194
195 icon.Clear();
196 Inventory in = Inventory.Cast(GetRoot());
197 if (in)
198 in.UpdateConsoleToolbar();
199 }
200 UpdateSelectionIcons();
201 }
override void Remove(LayoutHolder container)

References InventorySlots::GetSlotIdFromString(), Inventory(), m_InventorySlots, m_ShowedItems, Refresh(), and CollapsibleContainer::Remove().

Referenced by SetPlayer(), and ~PlayerContainer().

◆ MouseClick()

void PlayerContainer::MouseClick ( Widget w,
int x,
int y,
int button )
inlineprotected

Definition at line 224 of file PlayerContainer.c.

225 {
227 w.GetUserData(icon);
228
230 bool isReserved;
231
232 if (icon)
233 {
234 selectedItem = ItemBase.Cast(icon.GetEntity());
235 isReserved = icon.IsReserved();
236
237 }
238
239 if (selectedItem)
240 {
241 switch (button)
242 {
243 case MouseState.RIGHT:
244#ifdef DIAG_DEVELOPER
245 if (GetDayZGame().IsLeftCtrlDown())
246 ShowActionMenu(selectedItem);
247#endif
248
249 if (isReserved)
250 {
251 GetGame().GetPlayer().GetHumanInventory().ClearUserReservedLocationSynced(selectedItem);
252 m_Player.GetOnAttachmentReleaseLock().Invoke(selectedItem, icon.GetSlotID());
253 }
254 break;
255
256 case MouseState.MIDDLE:
257 if (!isReserved)
259
260 break;
261
262 case MouseState.LEFT:
263 if (!isReserved)
264 {
266 if (g_Game.IsLeftCtrlDown())
267 {
268 if (controlledPlayer.CanDropEntity(selectedItem))
269 {
270 if (selectedItem.GetTargetQuantityMax() < selectedItem.GetQuantity())
271 selectedItem.SplitIntoStackMaxClient(null, -1);
272 else
273 controlledPlayer.PhysicalPredictiveDropItem(selectedItem);
274 }
275 }
276 else
277 {
278 bool draggable = !m_Player.GetInventory().HasInventoryReservation(selectedItem, null) && !m_Player.GetInventory().IsInventoryLocked() && selectedItem.GetInventory().CanRemoveEntity() && !m_Player.IsItemsToDelete();
279 ItemManager.GetInstance().SetWidgetDraggable(w, draggable);
280 }
281 }
282 break;
283 }
284 }
285 }
DayZGame GetDayZGame()
Definition DayZGame.c:3530

References g_Game, GetDayZGame(), GetGame(), ItemManager::GetInstance(), GetPlayer(), InspectItem(), and m_Player.

◆ OnAttachmentReservationRelease()

void PlayerContainer::OnAttachmentReservationRelease ( EntityAI item,
int slot_id )
inlineprotected

Definition at line 211 of file PlayerContainer.c.

212 {
214 icon.Clear();
215 }

References m_InventorySlots.

Referenced by SetPlayer(), and ~PlayerContainer().

◆ OnAttachmentReservationSet()

void PlayerContainer::OnAttachmentReservationSet ( EntityAI item,
int slot_id )
inlineprotected

Definition at line 203 of file PlayerContainer.c.

204 {
206
207 if (item)
208 icon.Init(item, true);
209 }

References m_InventorySlots.

Referenced by SetPlayer(), and ~PlayerContainer().

◆ OnChildAdd()

override bool PlayerContainer::OnChildAdd ( Widget w,
Widget child )
inlineprotected

Definition at line 1040 of file PlayerContainer.c.

1041 {
1042 Refresh();
1043 return true;
1044 }

References Refresh().

◆ OnChildRemove()

override bool PlayerContainer::OnChildRemove ( Widget w,
Widget child )
inlineprotected

Definition at line 1034 of file PlayerContainer.c.

1035 {
1036 Refresh();
1037 return true;
1038 }

References Refresh().

◆ OnDropReceivedFromGhostArea()

void PlayerContainer::OnDropReceivedFromGhostArea ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected

Definition at line 843 of file PlayerContainer.c.

844 {
845 ItemManager.GetInstance().HideDropzones();
846 ItemManager.GetInstance().SetIsDragging(false);
847
849 bool is_reserved = false;
850 InventoryMenu menu = InventoryMenu.Cast(GetGame().GetUIManager().FindMenu(MENU_INVENTORY));
851 float stack_max;
852
855 receiver.GetUserData(slots_icon);
856 int slot_id = slots_icon.GetSlotID();
857
858 receiver_item = slots_icon.GetEntity();
859 is_reserved = slots_icon.IsReserved();
861
862 if (!ipw)
863 return;
864
865 ItemBase item = ItemBase.Cast(ipw.GetItem());
867 if (!item)
868 return;
870 {
872 {
873 GetGame().GetPlayer().PredictiveSwapEntities(item, receiver_item);
874
875 if (menu)
876 menu.RefreshQuickbar();
877 return;
878 }
879 else if (receiver_item.GetInventory().CanAddAttachment(item))
880 {
881 GetGame().GetPlayer().PredictiveTakeEntityToTargetAttachment(receiver_item, item);
882
883 if (menu)
884 menu.RefreshQuickbar();
885 return;
886 }
887 else if (receiver_item.GetInventory().CanAddEntityInCargo(item, item.GetInventory().GetFlipCargo()) && !receiver_item.GetInventory().HasEntityInCargo(item))
888 {
890
891 if (menu)
892 menu.RefreshQuickbar();
893 return;
894 }
895 else if ((ItemBase.Cast(receiver_item)).CanBeCombined(ItemBase.Cast(item)))
896 {
898 return;
899 }
900 }
901
902 if (m_Player.GetInventory().CanAddAttachmentEx(item, slot_id))
903 {
904 if (item.GetQuantity() > item.GetTargetQuantityMax(slot_id))
905 item.SplitIntoStackMaxClient(real_player, slot_id);
906 else
907 real_player.PredictiveTakeEntityToTargetAttachmentEx(m_Player, item, slots_icon.GetSlotID());
908 }
909 else if (m_Player.GetInventory().CanAddAttachment(item))
910 {
911 il = new InventoryLocation;
912 m_Player.GetInventory().FindFreeLocationFor(item, FindInventoryLocationType.ATTACHMENT, il);
913 float stackable = item.GetTargetQuantityMax(-1);
914
915 if (il.IsValid())
916 {
917 if (stackable == 0 || stackable >= item.GetQuantity())
918 real_player.PredictiveTakeEntityToTargetAttachment(il.GetParent(), item);
919 else
920
921 ItemBase.Cast(item).SplitIntoStackMaxToInventoryLocationClient(il);
922 }
923 }
924 else if (m_Player.GetInventory().CanAddEntityToInventory(item, FindInventoryLocationType.CARGO | FindInventoryLocationType.ATTACHMENT) && (!m_Player.GetInventory().HasEntityInInventory(item)) || m_Player.GetHumanInventory().HasEntityInHands(item))
926
927 if (menu)
928 menu.RefreshQuickbar();
929 }
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
Definition ItemBase.c:5528
InventoryLocation.
static void TakeOrSplitToInventory(notnull PlayerBase player, notnull EntityAI target, notnull EntityAI item)

References GameInventory::CanSwapEntitiesEx(), CombineItemsClient(), GetGame(), ItemManager::GetInstance(), GetItemPreviewWidget(), GetPlayer(), InventoryMenu(), m_Player, MENU_INVENTORY, and SplitItemUtils::TakeOrSplitToInventory().

◆ OnDropReceivedFromHeader()

override void PlayerContainer::OnDropReceivedFromHeader ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected

Definition at line 694 of file PlayerContainer.c.

695 {
697
698 if (!ipw.IsInherited(ItemPreviewWidget))
699 return;
700
701 EntityAI item = ipw.GetItem();
702 if (!item)
703 return;
704
705 if (!item.GetInventory().CanRemoveEntity())
706 return;
707
708 if (m_Player.GetInventory().CanAddEntityToInventory(item, FindInventoryLocationType.CARGO | FindInventoryLocationType.ATTACHMENT) && (!m_Player.GetInventory().HasEntityInInventory(item)))
709 m_Player.PredictiveTakeEntityToInventory(FindInventoryLocationType.CARGO | FindInventoryLocationType.ATTACHMENT, item);
710 }

References GetItemPreviewWidget(), and m_Player.

◆ Refresh()

override void PlayerContainer::Refresh ( )
inlineprotected

Definition at line 1026 of file PlayerContainer.c.

1027 {
1028 super.Refresh();
1029 m_MainWidget.Update();
1030 m_RootWidget.Update();
1031 UpdateSelectionIcons();
1032 }

References m_RootWidget.

Referenced by ItemAttached(), ItemDetached(), OnChildAdd(), OnChildRemove(), ToggleContainer(), and ToggleWidget().

◆ Select()

override bool PlayerContainer::Select ( )
inlineprotected

Definition at line 575 of file PlayerContainer.c.

576 {
577 if (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
578 return GetFocusedContainer().Select();
579 else
580 {
582 EntityAI selected_item = ItemManager.GetInstance().GetSelectedItem();
583 SlotsIcon focused_slot = GetFocusedSlotsIcon();
584 EntityAI focused_item = focused_slot.GetEntity();
585 if (focused_slot.IsReserved() || focused_item != selected_item)
586 {
587 if (selected_item)
588 {
589 if (selected_item.GetInventory().CanRemoveEntity())
590 {
591 if (m_Player.GetInventory().CanAddAttachmentEx(selected_item, focused_slot.GetSlotID()))
592 {
593 player.PredictiveTakeEntityToTargetAttachmentEx(m_Player, selected_item, focused_slot.GetSlotID());
594 //m_Player.PredictiveTakeEntityAsAttachmentEx( selected_item, focused_slot.GetSlotID() );
595 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
596 return true;
597
598 }
599 else if (m_Player.GetInventory().CanAddAttachment(selected_item))
600 {
601 player.PredictiveTakeEntityToTargetAttachment(m_Player, selected_item);
602 //m_Player.PredictiveTakeEntityToInventory( FindInventoryLocationType.ATTACHMENT, selected_item );
603 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
604 return true;
605 }
606 }
607 }
608 else
609 {
610 if (focused_item && focused_item.GetInventory().CanRemoveEntity())
611 {
612 EntityAI item_in_hands = player.GetHumanInventory().GetEntityInHands();
613 if (item_in_hands && item_in_hands.GetInventory().CanRemoveEntity())
614 {
616 {
617 player.PredictiveSwapEntities(item_in_hands, focused_item);
618 return true;
619 }
620 else
621 {
623 if (player.GetHumanInventory().FindFreeLocationFor(item_in_hands, FindInventoryLocationType.ANY, il_hands_dst))
624 {
626
627 if (player.NeedInventoryJunctureFromServer(item_in_hands, item_in_hands.GetHierarchyParent(), il_hands_dst.GetParent()) || GetGame().GetPlayer().NeedInventoryJunctureFromServer(focused_item, focused_item.GetHierarchyParent(), GetGame().GetPlayer()))
628 invMode = InventoryMode.JUNCTURE;
629
630 player.GetHumanInventory().ForceSwapEntities(invMode, focused_item, item_in_hands, il_hands_dst);
631 return true;
632 }
633 }
634 }
635 else
636 {
637 if (player.GetHumanInventory().CanAddEntityInHands(focused_item))
638 {
639 player.PredictiveTakeEntityToHands(focused_item);
640 return true;
641 }
642 }
643 }
644 }
645 }
646 }
647 return false;
648 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22

References GameInventory::CanSwapEntitiesEx(), GetGame(), ItemManager::GetInstance(), GetPlayer(), and m_Player.

◆ SetPlayer()

void PlayerContainer::SetPlayer ( PlayerBase player)
inlineprotected

Definition at line 650 of file PlayerContainer.c.

651 {
652 if (m_Player)
653 {
654 m_Player.GetOnItemAttached().Remove(ItemAttached);
655 m_Player.GetOnItemDetached().Remove(ItemDetached);
656 m_Player.GetOnAttachmentSetLock().Remove(OnAttachmentReservationSet);
657 m_Player.GetOnAttachmentReleaseLock().Remove(OnAttachmentReservationRelease);
658 }
659
661 if (m_Player)
662 {
663 m_Player.GetOnItemAttached().Insert(ItemAttached);
664 m_Player.GetOnItemDetached().Insert(ItemDetached);
665 m_Player.GetOnAttachmentSetLock().Insert(OnAttachmentReservationSet);
666 m_Player.GetOnAttachmentReleaseLock().Insert(OnAttachmentReservationRelease);
667 }
668
669 //START - InitGhostSlots
670 string config_path_ghosts_slots = "CfgVehicles SurvivorBase InventoryEquipment playerSlots";
673
674 for (int i = 0; i < player_ghosts_slots.Count(); i++)
675 {
676 string slot_name = player_ghosts_slots.Get(i);
677
678 int column = i % ITEMS_IN_ROW;
679 int row = i / ITEMS_IN_ROW;
680
682
683 icon.SetSlotParent(m_Player);
684 icon.GetMainWidget().Show(true);
685 icon.Clear();
686
687 GetGame().ConfigGetText("CfgSlots" + " " + slot_name + " name", slot_name);
688 EntityAI item = m_Player.GetInventory().FindAttachment(InventorySlots.GetSlotIdFromString(slot_name));
689 if (item)
691 }
692 }

References GetGame(), InventorySlots::GetSlotIdFromString(), GetSlotsIcon(), ItemAttached(), ItemDetached(), ITEMS_IN_ROW, m_Player, OnAttachmentReservationRelease(), and OnAttachmentReservationSet().

◆ SplitItem()

override bool PlayerContainer::SplitItem ( )
inlineprotected

Definition at line 484 of file PlayerContainer.c.

485 {
486 if (CanSplit())
487 {
488 if (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
489 return GetFocusedContainer().SplitItem();
490 }
491
492 return false;
493 }

◆ SwapItemsInOrder()

void PlayerContainer::SwapItemsInOrder ( int slot1,
int slot2 )
inlineprotected

Definition at line 931 of file PlayerContainer.c.

932 {
933 EntityAI item1 = m_Player.GetInventory().FindAttachment(slot1);
934 EntityAI item2 = m_Player.GetInventory().FindAttachment(slot2);
935
936 if (item1 && item2)
937 {
940 if (cont1 && cont2)
941 {
942 int sort1 = cont1.GetRootWidget().GetSort();
943 int sort2 = cont2.GetRootWidget().GetSort();
944
945 cont1.GetRootWidget().SetSort(sort2);
946 cont2.GetRootWidget().SetSort(sort1);
947
948 m_Body.SwapItems(m_Body.Find(cont1), m_Body.Find(cont2));
949 }
950 }
951 RecomputeOpenedContainers();
952 }

References m_Player, and m_ShowedItems.

◆ ToggleContainer()

void PlayerContainer::ToggleContainer ( Widget w,
EntityAI item )
inlineprotected

Definition at line 972 of file PlayerContainer.c.

973 {
975 item.GetInventory().GetCurrentInventoryLocation(il);
976 SlotsIcon icon = m_InventorySlots.Get(il.GetSlot());
978 if (c)
979 {
980 c.Toggle();
981 Refresh();
982 }
983 }

References m_InventorySlots, m_ShowedItems, and Refresh().

Referenced by ToggleWidget().

◆ ToggleWidget()

void PlayerContainer::ToggleWidget ( Widget w)
inlineprotected

Definition at line 997 of file PlayerContainer.c.

998 {
999 if (ItemManager.GetInstance().IsDragging())
1000 return;
1001 string name = w.GetName();
1002 name.Replace("PanelWidget", "Render");
1003 ItemPreviewWidget ipw = ItemPreviewWidget.Cast(w.FindAnyWidget(name));
1004 if (ipw.GetItem())
1005 {
1006 ToggleContainer(w, ipw.GetItem());
1007 RecomputeOpenedContainers();
1008 }
1009
1010 Refresh();
1011 }
void ToggleContainer(Widget w, EntityAI item)

References ItemManager::GetInstance(), name, Refresh(), and ToggleContainer().

Referenced by DoubleClick(), and ExpandCollapseContainer().

◆ TransferItem()

override bool PlayerContainer::TransferItem ( )
inlineprotected

Definition at line 514 of file PlayerContainer.c.

515 {
516 if (CanTakeToInventory())
517 {
520 if (left_area)
521 {
522 if (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
523 return GetFocusedContainer().TransferItem();
524 else
525 {
527 if (item)
528 {
529 GetGame().GetPlayer().PredictiveTakeEntityToInventory(FindInventoryLocationType.CARGO, item);
530 return true;
531 }
532 }
533 }
534 else
535 {
536 if (!GetFocusedContainer().IsInherited(ContainerWithCargo) && !GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
537 {
539 if (item)
540 {
541 GetGame().GetPlayer().PredictiveTakeEntityToInventory(FindInventoryLocationType.CARGO, item);
542 return true;
543 }
544 }
545 }
546 }
547 return false;
548 }
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:389

References GetFocusedItem(), GetGame(), and GetParent().

◆ TransferItemToVicinity()

override bool PlayerContainer::TransferItemToVicinity ( )
inlineprotected

Definition at line 438 of file PlayerContainer.c.

439 {
440 if (CanDrop())
441 {
442 if (GetFocusedContainer().IsInherited(ContainerWithCargo) || GetFocusedContainer().IsInherited(ContainerWithCargoAndAttachments))
443 return GetFocusedContainer().TransferItemToVicinity();
444 else
445 {
446 Man player = GetGame().GetPlayer();
448 if (item && player.CanDropEntity(item))
449 {
450 if (item.GetTargetQuantityMax() < item.GetQuantity())
451 item.SplitIntoStackMaxClient(null, -1);
452 else
453 player.PhysicalPredictiveDropItem(item);
454 return true;
455 }
456 }
457 }
458 return false;
459 }

References GetFocusedItem(), and GetGame().

◆ UnfocusPlayerAttachmentsContainer()

void PlayerContainer::UnfocusPlayerAttachmentsContainer ( )
inlineprotected

Definition at line 357 of file PlayerContainer.c.

358 {
359 m_PlayerAttachmentsContainer.UnfocusAll();
360 }

References m_PlayerAttachmentsContainer.

◆ UpdateInterval()

override void PlayerContainer::UpdateInterval ( )
inlineprotected

Definition at line 954 of file PlayerContainer.c.

955 {
956 int i;
957 for (i = 0; i < m_InventorySlots.Count(); i++)
958 {
959 SlotsIcon icon = m_InventorySlots.GetElement(i);
960 if (icon)
961 icon.UpdateInterval();
962 }
963 for (i = 0; i < m_ShowedItems.Count(); i++)
964 {
965 Container cont = m_ShowedItems.GetElement(i);
966 if (cont)
967 cont.UpdateInterval();
968 }
969 }

References m_InventorySlots, and m_ShowedItems.

◆ UpdateRadialIcon()

override void PlayerContainer::UpdateRadialIcon ( )
inlineprotected

Definition at line 11 of file PlayerContainer.c.

12 {
13 if (m_SlotIcon)
14 {
17 Widget rip = m_SlotIcon.GetRadialIconPanel();
18 rip.Show(!m_Player.GetInventory().IsInventoryLockedForLockType(HIDE_INV_FROM_SCRIPT) && m_Player.CanDisplayCargo());
19 SetOpenForSlotIcon(show_radial_icon);
20 }
21 }

References CollapsibleContainer::IsHidden(), and m_Player.

Member Data Documentation

◆ HEADER_INDEX_OFFSET

const int PlayerContainer::HEADER_INDEX_OFFSET = 2
protected

Definition at line 9 of file PlayerContainer.c.

◆ m_InventorySlots

◆ m_Player

◆ m_PlayerAttachmentsContainer

ref AttachmentsGroupContainer PlayerContainer::m_PlayerAttachmentsContainer
protected

◆ m_ShowedItems

◆ m_ShowedItemsIDs

ref map<int, ref Container> PlayerContainer::m_ShowedItemsIDs = new ref map<int, ref Container>
protected

Definition at line 6 of file PlayerContainer.c.


The documentation for this class was generated from the following file: