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

Protected Member Functions

void CargoContainer (LayoutHolder parent, bool is_attachment=false)
 
void ~CargoContainer ()
 
int GetCargoIndex ()
 
void AddedToCargoEx (EntityAI item, bool refresh=true)
 
void AddedToCargo (EntityAI item)
 
void RemovedFromCargo (EntityAI item)
 
void MovedInCargo (EntityAI item)
 
void SetLock (EntityAI item)
 
void ReleaseLock (EntityAI item)
 
override void SetLayoutName ()
 
void SetEntity (EntityAI item, int cargo_index=0, bool immedUpdate=true)
 
EntityAI GetEntity ()
 
void UpdateHeaderText ()
 
void InitGridHeight ()
 
void UpdateSize ()
 
float GetIconSize ()
 
float GetSpaceSize ()
 
int GetCargoCapacity ()
 
int GetMaxCargoCapacity ()
 
Icon GetIcon (EntityAI item)
 
Icon GetIcon (int index)
 
Icon GetFocusedIcon ()
 
override float GetFocusedContainerHeight (bool contents=false)
 
override float GetFocusedContainerYPos (bool contents=false)
 
override float GetFocusedContainerYScreenPos (bool contents=false)
 
void UpdateSelection ()
 
void UpdateRowVisibility (int count)
 
override void Refresh ()
 
void RefreshImpl ()
 
override void UpdateInterval ()
 
Icon InitIconEx (Icon icon, EntityAI item, int pos_x, int pos_y, bool refresh=true)
 
Icon InitIcon (Icon icon, EntityAI item, int pos_x, int pos_y)
 
bool HasItem (EntityAI item)
 
override bool TransferItemToVicinity ()
 
override void SetDefaultFocus (bool while_micromanagment_mode=false)
 
override void SetLastFocus ()
 
override void Unfocus ()
 
override void UnfocusAll ()
 
override void SetNextActive ()
 
override void SetPreviousActive (bool force=false)
 
override void SetNextRightActive ()
 
override void SetNextLeftActive ()
 
override EntityAI GetFocusedItem ()
 
override void SetLastActive ()
 
override void SetActive (bool active)
 
override bool IsItemActive ()
 
override bool IsItemWithQuantityActive ()
 
override bool IsEmpty ()
 
int GetRecipeCount (bool recipe_anywhere, ItemBase entity1, ItemBase entity2, PlayerBase player)
 
override bool CanCombineAmmo ()
 
override bool TransferItem ()
 
override bool SplitItem ()
 
override bool EquipItem ()
 
override bool SelectItem ()
 
override bool Select ()
 
override bool Combine ()
 
void ShowFalseCargoHeader (bool show)
 
void SetAlternateFalseTextHeaderWidget (TextWidget w)
 
void ClosableContainer (LayoutHolder parent, int sort=-1)
 
override bool IsDisplayable ()
 
override void UpdateRadialIcon ()
 
void SetOpenState (bool state)
 
override Header GetHeader ()
 
override void Open ()
 
override void Close ()
 
override void SetLayoutName ()
 
override void OnShow ()
 
override LayoutHolder Get (int x)
 
override void Refresh ()
 
void CloseButtonOnMouseButtonDown ()
 
override float GetFocusedContainerHeight (bool contents=false)
 
override float GetFocusedContainerYPos (bool contents=false)
 
override float GetFocusedContainerYScreenPos (bool contents=false)
 
void MoveContainerUp (Widget cont)
 
void MoveContainerDown (Widget cont)
 
override void CheckHeaderDragability ()
 

Protected Attributes

const int ROWS_NUMBER_XBOX = 5
 
CargoBase m_Cargo
 
int m_CargoIndex = -1
 
int m_FocusedItemPosition = -1
 
ref array< ref CargoContainerRowm_Rows
 
ref array< ref Iconm_Icons
 
ref map< EntityAI, ref Param3< ref Icon, int, int > > m_ShowedItemPositions
 
ref map< EntityAI, ref Param3< ref Icon, int, int > > m_ShowedLockPositions
 
float m_IconSize
 
float m_SpaceSize
 
bool m_IsAttachment
 
TextWidget m_FalseHeaderTextWidget
 
TextWidget m_AlternateFalseHeaderTextWidget
 
Widget m_CargoHeader
 
Widget m_CargoContainer
 
Widget m_ItemsContainer
 
ref SizeToChild m_Resizer1
 
ref SizeToChild m_Resizer2
 
ref Timer m_ResizeTimer
 
ref ClosableHeader m_ClosableHeader
 
bool m_LockCargo
 

Detailed Description

Definition at line 2 of file CargoContainer.c.

Constructor & Destructor Documentation

◆ ~CargoContainer()

void Container::~CargoContainer ( )
inlineprotected

Definition at line 52 of file CargoContainer.c.

53 {
54 if (m_Entity)
55 {
56 m_Entity.GetOnItemAddedIntoCargo().Remove(AddedToCargo);
57 m_Entity.GetOnItemRemovedFromCargo().Remove(RemovedFromCargo);
58 m_Entity.GetOnItemMovedInCargo().Remove(MovedInCargo);
59 m_Entity.GetOnSetLock().Remove(SetLock);
60 m_Entity.GetOnReleaseLock().Remove(ReleaseLock);
61 }
62 }
EntityAI m_Entity
Definition ActionDebug.c:11
void MovedInCargo(EntityAI item)
void SetLock(EntityAI item)
void RemovedFromCargo(EntityAI item)
void AddedToCargo(EntityAI item)
void ReleaseLock(EntityAI item)

References m_Entity, and SetLock().

Member Function Documentation

◆ AddedToCargo()

void Container::AddedToCargo ( EntityAI item)
inlineprotected

Definition at line 110 of file CargoContainer.c.

111 {
113 }
void AddedToCargoEx(EntityAI item, bool refresh=true)

References AddedToCargoEx().

◆ AddedToCargoEx()

void Container::AddedToCargoEx ( EntityAI item,
bool refresh = true )
inlineprotected

Definition at line 66 of file CargoContainer.c.

67 {
69 item.GetInventory().GetCurrentInventoryLocation(il);
70 int x = il.GetCol();
71 int y = il.GetRow();
72
73 if (m_ShowedItemPositions.Contains(item))
74 {
76 InitIconEx(item_pos.param1, item, x, y, refresh);
77 item_pos.param2 = x;
78 item_pos.param3 = y;
79 }
80 else
81 {
82 ref Icon icon = new Icon(this, false);
83 m_Icons.Insert(icon);
86 }
87
88 if (refresh)
90
91#ifdef PLATFORM_CONSOLE
92 for (int i = 0; i < m_Cargo.GetItemCount(); i++)
93 {
96 if (data)
97 {
98 data.param1.SetCargoPos(i);
99 data.param1.SetPos();
100 }
101 }
102
104
105 if (refresh)
106 Refresh();
107#endif
108 }
Icon x
Icon y
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
ref array< ref Icon > m_Icons
int m_FocusedItemPosition
ref map< EntityAI, ref Param3< ref Icon, int, int > > m_ShowedItemPositions
CargoBase m_Cargo
override void Refresh()
void UpdateHeaderText()
Icon InitIconEx(Icon icon, EntityAI item, int pos_x, int pos_y, bool refresh=true)
Definition Icon.c:2
InventoryLocation.
Definition EnMath.c:7
static proto float Min(float x, float y)
Returns smaller of two given values.

References CargoBase::GetItem(), CargoBase::GetItemCount(), InitIconEx(), Math::Min(), Refresh(), UpdateHeaderText(), x, and y.

Referenced by AddedToCargo(), and SetEntity().

◆ CanCombineAmmo()

override bool Container::CanCombineAmmo ( )
inlineprotected

Definition at line 747 of file CargoContainer.c.

748 {
749 if (GetFocusedIcon())
750 {
752
754 ItemBase item_in_hands = ItemBase.Cast(GetGame().GetPlayer().GetHumanInventory().GetEntityInHands());
755
756 return (amc.CanPerformActionFromInventory(item_in_hands, entity) || amc.CanSetActionFromInventory(item_in_hands, entity));
757 }
758 return false;
759 }
Object GetObject()
void GetActionManager()
PlayerBase GetPlayer()
Icon GetFocusedIcon()
proto native CGame GetGame()

References GetActionManager(), GetFocusedIcon(), GetGame(), GetObject(), and GetPlayer().

◆ CargoContainer()

void Container::CargoContainer ( LayoutHolder parent,
bool is_attachment = false )
inlineprotected

Definition at line 30 of file CargoContainer.c.

31 {
37
38 m_CargoContainer = m_RootWidget.FindAnyWidget("grid_background");
39 m_ItemsContainer = m_RootWidget.FindAnyWidget("grid_overlay");
40 m_CargoHeader = m_RootWidget.FindAnyWidget("grid_container_header_spacer");
41#ifndef PLATFORM_CONSOLE
42 m_RootWidget.GetScript(m_Resizer1);
43#endif
44 m_RootWidget.FindAnyWidget("grid_container").GetScript(m_Resizer2);
46 m_FalseHeaderTextWidget = TextWidget.Cast(m_CargoHeader.FindAnyWidget("TextWidget0"));
47
48 m_MainWidget = m_CargoContainer;
50 }
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
Widget m_ItemsContainer
ref SizeToChild m_Resizer2
Widget m_CargoHeader
TextWidget m_FalseHeaderTextWidget
ref SizeToChild m_Resizer1
Widget m_CargoContainer
ref map< EntityAI, ref Param3< ref Icon, int, int > > m_ShowedLockPositions
bool m_IsAttachment
ref array< ref CargoContainerRow > m_Rows

References m_CargoContainer, and m_RootWidget.

Referenced by HandsContainer::AttachmentAdded(), HandsContainer::AttachmentRemoved(), HandsContainer::DestroyCargo(), HandsContainer::ShowAtt(), and HandsContainer::UnfocusGrid().

◆ CheckHeaderDragability()

override void Container::CheckHeaderDragability ( )
inlineprotected

Definition at line 171 of file ClosableContainer.c.

172 {
173 super.CheckHeaderDragability();
174
175 if (m_ClosableHeader && m_Entity) //TODO: do the entity check here?
176 {
177 int flag = m_ClosableHeader.GetMainWidget().GetFlags();
178 bool old = flag & WidgetFlags.DRAGGABLE;
179 bool current = ItemBase.Cast(m_Entity) && m_Entity.IsTakeable();
180 //bool changed = false;
181 if (old && !current)
182 {
183 m_ClosableHeader.GetMainWidget().ClearFlags(WidgetFlags.DRAGGABLE);
185 if (drag && drag == m_ClosableHeader.GetMainWidget())
186 {
188 m_ClosableHeader.OnDropHeader(null);
189 }
190
191 //changed = true;
192 }
193 else if (!old && current)
194 {
195 m_ClosableHeader.GetMainWidget().SetFlags(WidgetFlags.DRAGGABLE);
196 //changed = true;
197 }
198 /*if (old != current)
199 {
200 flag &= ~WidgetFlags.DRAGGABLE;
201 m_ClosableHeader.GetMainWidget().SetFlags( flag );
202 }*/
203 }
204 }
ref ClosableHeader m_ClosableHeader
WidgetFlags
Definition EnWidgets.c:58
proto native Widget CancelWidgetDragging()
proto native Widget GetDragWidget()

References CancelWidgetDragging(), GetDragWidget(), and m_Entity.

Referenced by LayoutHolder::UpdateInterval().

◆ ClosableContainer()

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

Definition at line 6 of file ClosableContainer.c.

7 {
8 m_Body = new array<ref LayoutHolder>;
9 m_ClosableHeader = new ClosableHeader(this, "CloseButtonOnMouseButtonDown");
10
11 if (sort > -1)
12 m_RootWidget.SetSort(sort + 2);
13
14 m_MainWidget = m_MainWidget.FindWidget("body");
15 }

References m_RootWidget.

◆ Close()

override void Container::Close ( )
inlineprotected

Definition at line 73 of file ClosableContainer.c.

74 {
75 ItemManager.GetInstance().SetDefaultOpenState(m_Entity.GetType(), false);
76 super.Close();
77 SetOpenForSlotIcon(false);
78 OnHide();
79 m_Parent.m_Parent.Refresh(); //TODO: ???
80 }
override void OnHide()
Widget m_Parent
Definition SizeToChild.c:86
static ItemManager GetInstance()

References ItemManager::GetInstance(), m_Entity, m_Parent, and OnHide().

Referenced by LayoutHolder::Toggle().

◆ CloseButtonOnMouseButtonDown()

void Container::CloseButtonOnMouseButtonDown ( )
inlineprotected

Definition at line 106 of file ClosableContainer.c.

107 {
108 Close();
109 }
override void Close()

References ClosableContainer::Close().

◆ Combine()

override bool Container::Combine ( )
inlineprotected

Definition at line 894 of file CargoContainer.c.

895 {
896 if (CanCombine())
897 {
898 if (GetFocusedIcon())
899 {
901 if (icon)
902 {
903 EntityAI item_in_hands = GetGame().GetPlayer().GetHumanInventory().GetEntityInHands();
904 EntityAI prev_item = EntityAI.Cast(icon.GetObject());
906 return icon.CombineItems(item_in_hands, prev_item);
907 }
908 }
909 }
910 return false;
911 }

References GetFocusedIcon(), and GetGame().

◆ EquipItem()

override bool Container::EquipItem ( )
inlineprotected

Definition at line 801 of file CargoContainer.c.

802 {
803 if (CanEquip())
804 {
805 if (GetFocusedIcon())
806 {
808 if (entity)
809 {
810 GetGame().GetPlayer().PredictiveTakeEntityToInventory(FindInventoryLocationType.ATTACHMENT, entity);
811 return true;
812 }
813 }
814 }
815 return false;
816 }
FindInventoryLocationType
flags for searching locations in inventory

References GetFocusedIcon(), GetGame(), and GetObject().

◆ Get()

override LayoutHolder Container::Get ( int x)
inlineprotected

Definition at line 93 of file ClosableContainer.c.

94 {
95 if (m_Body && x < m_Body.Count() && x >= 0)
96 return m_Body.Get(x);
97 return null;
98 }

References LayoutHolder::Count(), and x.

◆ GetCargoCapacity()

int Container::GetCargoCapacity ( )
inlineprotected

Definition at line 376 of file CargoContainer.c.

377 {
378#ifdef PLATFORM_CONSOLE
379#ifndef PLATFORM_WINDOWS
380 return CargoList.Cast(m_Cargo).GetTotalWeight(null);
381#endif
382#endif
383 int total_size = 0;
384 for (int i = 0; i < m_Cargo.GetItemCount(); ++i)
385 {
386 int x, y;
388 total_size += x * y;
389 }
390 return total_size;
391 }
proto bool GetItemSize(int index, out int w, out int h)

References CargoBase::GetItemCount(), CargoBase::GetItemSize(), x, and y.

Referenced by UpdateHeaderText().

◆ GetCargoIndex()

int Container::GetCargoIndex ( )
inlineprotected

Definition at line 64 of file CargoContainer.c.

64{ return m_CargoIndex; }

References m_CargoIndex.

◆ GetEntity()

EntityAI Container::GetEntity ( )
inlineprotected

Definition at line 280 of file CargoContainer.c.

281 {
282 return m_Entity;
283 }

References m_Entity.

◆ GetFocusedContainerHeight() [1/2]

override float Container::GetFocusedContainerHeight ( bool contents = false)
inlineprotected

Definition at line 428 of file CargoContainer.c.

429 {
430 float x, y;
431 if (contents && GetFocusedIcon())
432 GetFocusedIcon().GetRootWidget().GetScreenSize(x, y);
433 else
434 GetRootWidget().GetScreenSize(x, y);
435 return y;
436 }

References GetFocusedIcon(), x, and y.

Referenced by LeftArea::GetCurrentContainerBottomY(), RightArea::GetCurrentContainerBottomY(), and LayoutHolder::ScrollToActiveContainer().

◆ GetFocusedContainerHeight() [2/2]

override float Container::GetFocusedContainerHeight ( bool contents = false)
inlineprotected

Definition at line 111 of file ClosableContainer.c.

112 {
113 float x, y;
114 if (contents && GetFocusedContainer())
115 y = GetFocusedContainer().GetFocusedContainerHeight(contents);
116 else if (GetRootWidget())
117 GetRootWidget().GetScreenSize(x, y);
118 return y;
119 }
float GetFocusedContainerHeight(bool contents=false)
Definition Container.c:220

References LayoutHolder::GetFocusedContainerHeight(), x, and y.

◆ GetFocusedContainerYPos() [1/2]

override float Container::GetFocusedContainerYPos ( bool contents = false)
inlineprotected

Definition at line 438 of file CargoContainer.c.

439 {
440 float x, y;
441 if (contents && GetFocusedIcon())
442 GetFocusedIcon().GetRootWidget().GetPos(x, y);
443 else
444 GetRootWidget().GetPos(x, y);
445 return y;
446 }

References GetFocusedIcon(), x, and y.

◆ GetFocusedContainerYPos() [2/2]

override float Container::GetFocusedContainerYPos ( bool contents = false)
inlineprotected

Definition at line 121 of file ClosableContainer.c.

122 {
123 float x, y;
124 if (contents && GetFocusedContainer())
125 y = GetFocusedContainer().GetFocusedContainerYPos(contents);
126 else if (GetRootWidget())
127 GetRootWidget().GetPos(x, y);
128 return y;
129 }
float GetFocusedContainerYPos(bool contents=false)
Definition Container.c:241

References LayoutHolder::GetFocusedContainerYPos(), x, and y.

◆ GetFocusedContainerYScreenPos() [1/2]

override float Container::GetFocusedContainerYScreenPos ( bool contents = false)
inlineprotected

Definition at line 448 of file CargoContainer.c.

449 {
450 float x, y;
451 if (contents && GetFocusedIcon())
452 GetFocusedIcon().GetRootWidget().GetScreenPos(x, y);
453 else
454 GetRootWidget().GetScreenPos(x, y);
455 return y;
456 }

References GetFocusedIcon(), x, and y.

Referenced by LeftArea::GetCurrentContainerBottomY(), RightArea::GetCurrentContainerBottomY(), LeftArea::GetCurrentContainerTopY(), RightArea::GetCurrentContainerTopY(), and LayoutHolder::ScrollToActiveContainer().

◆ GetFocusedContainerYScreenPos() [2/2]

override float Container::GetFocusedContainerYScreenPos ( bool contents = false)
inlineprotected

Definition at line 131 of file ClosableContainer.c.

132 {
133 float x, y;
134 if (contents && GetFocusedContainer())
135 y = GetFocusedContainer().GetFocusedContainerYScreenPos(contents);
136 else if (GetRootWidget())
137 GetRootWidget().GetScreenPos(x, y);
138 return y;
139 }
float GetFocusedContainerYScreenPos(bool contents=false)
Definition Container.c:252

References LayoutHolder::GetFocusedContainerYScreenPos(), x, and y.

◆ GetFocusedIcon()

◆ GetFocusedItem()

◆ GetHeader()

◆ GetIcon() [1/2]

Icon Container::GetIcon ( EntityAI item)
inlineprotected

Definition at line 403 of file CargoContainer.c.

404 {
405 if (item && m_ShowedItemPositions.Contains(item))
406 {
408 return data.param1;
409 }
410 return null;
411 }

◆ GetIcon() [2/2]

Icon Container::GetIcon ( int index)
inlineprotected

Definition at line 413 of file CargoContainer.c.

414 {
415 if (m_Cargo == null)
416 return null;
417
418 if (index >= 0 && m_Cargo.GetItemCount() > index)
419 return GetIcon(m_Cargo.GetItem(index));
420 return null;
421 }

References GetIcon(), CargoBase::GetItem(), and CargoBase::GetItemCount().

◆ GetIconSize()

float Container::GetIconSize ( )
inlineprotected

Definition at line 366 of file CargoContainer.c.

367 {
368 return m_IconSize;
369 }
float m_IconSize

References m_IconSize.

◆ GetMaxCargoCapacity()

int Container::GetMaxCargoCapacity ( )
inlineprotected

Definition at line 393 of file CargoContainer.c.

394 {
395#ifdef PLATFORM_CONSOLE
396#ifndef PLATFORM_WINDOWS
397 return CargoList.Cast(m_Cargo).GetMaxWeight();
398#endif
399#endif
400 return m_Cargo.GetWidth() * m_Cargo.GetHeight();
401 }
proto native int GetWidth()
proto native int GetHeight()

References CargoBase::GetHeight(), and CargoBase::GetWidth().

Referenced by UpdateHeaderText().

◆ GetRecipeCount()

int Container::GetRecipeCount ( bool recipe_anywhere,
ItemBase entity1,
ItemBase entity2,
PlayerBase player )
inlineprotected

Definition at line 741 of file CargoContainer.c.

742 {
743 PluginRecipesManager recipes_manager = PluginRecipesManager.Cast(GetPlugin(PluginRecipesManager));
744 return recipes_manager.GetValidRecipes(entity1, entity2, null, player);
745 }
PluginBase GetPlugin(typename plugin_type)

References GetPlugin().

◆ GetSpaceSize()

float Container::GetSpaceSize ( )
inlineprotected

Definition at line 371 of file CargoContainer.c.

372 {
373 return m_SpaceSize;
374 }
float m_SpaceSize

References m_SpaceSize.

◆ HasItem()

bool Container::HasItem ( EntityAI item)
inlineprotected

Definition at line 563 of file CargoContainer.c.

564 {
565 return m_ShowedItemPositions.Contains(item);
566 }

◆ InitGridHeight()

void Container::InitGridHeight ( )
inlineprotected

Definition at line 313 of file CargoContainer.c.

314 {
315 m_Rows.Clear();
316 m_ShowedItemPositions.Clear();
317
319
320#ifdef PLATFORM_CONSOLE
321 int cargo_height = 1;
322#else
323 int cargo_height = m_Entity.GetInventory().GetCargoFromIndex(m_CargoIndex).GetHeight();
324#endif
325
326 for (int j = 0; j < cargo_height; j++)
327 {
328 row = new CargoContainerRow(this);
329
330 row.SetNumber(j);
331 row.SetEntity(m_Entity);
332
333#ifdef PLATFORM_WINDOWS
334#ifndef PLATFORM_CONSOLE
335 row.SetWidth(m_Entity.GetInventory().GetCargoFromIndex(m_CargoIndex).GetWidth(), false);
336#endif
337#endif
338
339 row.GetRootWidget().SetSort(j, false);
340 m_Rows.Insert(row);
341 }
342
343 float y;
344 row.GetRootWidget().FindAnyWidget("Icon0").GetScreenSize(y, m_IconSize);
345#ifdef PLATFORM_WINDOWS
346#ifndef PLATFORM_CONSOLE
347 row.GetRootWidget().FindAnyWidget("Spacer0").GetScreenSize(m_SpaceSize, y);
348#endif
349#endif
350
351 m_Resizer2.ResizeParentToChild();
352#ifndef PLATFORM_CONSOLE
353 m_Resizer1.ResizeParentToChild();
354#endif
355 }

References m_Entity, and y.

Referenced by SetEntity().

◆ InitIcon()

Icon Container::InitIcon ( Icon icon,
EntityAI item,
int pos_x,
int pos_y )
inlineprotected

Definition at line 558 of file CargoContainer.c.

559 {
560 return InitIconEx(icon, item, pos_x, pos_y);
561 }

References InitIconEx().

◆ InitIconEx()

Icon Container::InitIconEx ( Icon icon,
EntityAI item,
int pos_x,
int pos_y,
bool refresh = true )
inlineprotected

Definition at line 531 of file CargoContainer.c.

532 {
533#ifdef PLATFORM_CONSOLE
534 icon.SetSize(1, 1);
535#ifdef PLATFORM_WINDOWS
536 pos_y = pos_y * 5 + pos_x;
537#endif
538 icon.SetCargoPos(pos_y);
539 icon.SetPosY(pos_y);
540 icon.SetPosEx(refresh);
541#else
542 int size_x, size_y;
543 GetGame().GetInventoryItemSize(InventoryItem.Cast(item), size_x, size_y);
544
545 if (item.GetInventory().GetFlipCargo())
546 icon.SetSize(size_y, size_x);
547 else
548 icon.SetSize(size_x, size_y);
549
550 icon.SetPosX(pos_x);
551 icon.SetPosY(pos_y);
552 icon.SetPosEx(refresh);
553#endif
554 icon.InitEx(item, refresh);
555 return icon;
556 }

References GetGame().

Referenced by AddedToCargoEx(), and InitIcon().

◆ IsDisplayable()

override bool Container::IsDisplayable ( )
inlineprotected

Definition at line 17 of file ClosableContainer.c.

18 {
19 for (int i = 0; i < m_Body.Count(); i++)
20 {
21 LayoutHolder c = m_Body[i];
22 if (c && c.IsDisplayable())
23 return true;
24 }
25 return false;
26 }

◆ IsEmpty()

override bool Container::IsEmpty ( )
inlineprotected

Definition at line 736 of file CargoContainer.c.

737 {
738 return m_Icons.Count() == 0;
739 }

Referenced by AttachmentsWrapper::IsDisplayable(), AttachmentCategoriesContainer::IsDisplayable(), and IsItemWithQuantityActive().

◆ IsItemActive()

override bool Container::IsItemActive ( )
inlineprotected

Definition at line 716 of file CargoContainer.c.

717 {
718 if (GetFocusedIcon())
719 {
721 return (item != null);
722 }
723 return false;
724 }

References GetFocusedIcon(), and GetObject().

◆ IsItemWithQuantityActive()

override bool Container::IsItemWithQuantityActive ( )
inlineprotected

Definition at line 726 of file CargoContainer.c.

727 {
728 if (GetFocusedIcon())
729 {
731 return (!IsEmpty() && QuantityConversions.HasItemQuantity(item) && item.CanBeSplit());
732 }
733 return false;
734 }
override bool IsEmpty()
static int HasItemQuantity(notnull EntityAI item)

References GetFocusedIcon(), GetObject(), QuantityConversions::HasItemQuantity(), and IsEmpty().

◆ MoveContainerDown()

void Container::MoveContainerDown ( Widget cont)
inlineprotected

Definition at line 156 of file ClosableContainer.c.

157 {
158 if (m_Entity)
159 {
161 m_Entity.GetInventory().GetCurrentInventoryLocation(loc);
162 if (loc.IsValid())
163 {
164 int slot = loc.GetSlot();
165 Inventory.MoveAttachmentDown(slot);
166 UpdateSelectionIcons();
167 }
168 }
169 }
void Inventory(LayoutHolder parent)
Definition Inventory.c:76

References Inventory(), and m_Entity.

◆ MoveContainerUp()

void Container::MoveContainerUp ( Widget cont)
inlineprotected

Definition at line 141 of file ClosableContainer.c.

142 {
143 if (m_Entity)
144 {
146 m_Entity.GetInventory().GetCurrentInventoryLocation(loc);
147 if (loc.IsValid())
148 {
149 int slot = loc.GetSlot();
150 Inventory.MoveAttachmentUp(slot);
151 UpdateSelectionIcons();
152 }
153 }
154 }

References Inventory(), and m_Entity.

◆ MovedInCargo()

void Container::MovedInCargo ( EntityAI item)
inlineprotected

Definition at line 144 of file CargoContainer.c.

145 {
147 item.GetInventory().GetCurrentInventoryLocation(il);
148
149 int x = il.GetCol();
150#ifdef PLATFORM_CONSOLE
151 int y = il.GetRow() - 1;
152#else
153 int y = il.GetRow();
154#endif
155 if (m_ShowedItemPositions.Contains(item))
156 {
158 if (data.param1)
159 {
160 if (data.param2 != x || data.param3 != y)
161 {
162 data.param2 = x;
163 data.param3 = y;
164#ifdef PLATFORM_CONSOLE
165 data.param1.SetCargoPos(data.param3);
166#endif
167#ifdef PLATFORM_WINDOWS
168 data.param1.SetPosX(data.param2);
169 data.param1.SetPosY(data.param3);
170#endif
171 }
172 data.param1.UpdateInterval();
173 }
174 }
176 }
void UpdateSelection()

References UpdateSelection(), x, and y.

◆ OnShow()

override void Container::OnShow ( )
inlineprotected

Definition at line 87 of file ClosableContainer.c.

88 {
89 if (IsOpened())
90 super.OnShow();
91 }
bool IsOpened()

References ClosableContainer::IsOpened().

◆ Open()

override void Container::Open ( )
inlineprotected

Definition at line 61 of file ClosableContainer.c.

62 {
63 if (IsDisplayable())
64 {
65 super.Open();
66 ItemManager.GetInstance().SetDefaultOpenState(m_Entity.GetType(), true);
67 SetOpenForSlotIcon(true);
68 OnShow();
69 m_Parent.m_Parent.Refresh();
70 }
71 }
override bool IsDisplayable()
override void OnShow()

References ItemManager::GetInstance(), ClosableContainer::IsDisplayable(), m_Entity, m_Parent, and OnShow().

Referenced by LayoutHolder::Toggle().

◆ Refresh() [1/2]

override void Container::Refresh ( )
inlineprotected

Definition at line 505 of file CargoContainer.c.

506 {
507#ifdef PLATFORM_CONSOLE
508 if (!m_ResizeTimer)
509 m_ResizeTimer = new Timer();
510 if (m_ResizeTimer.IsRunning())
511 m_ResizeTimer.Stop();
512 m_ResizeTimer.Run(0.05, this, "RefreshImpl");
513#endif
514 }
ref Timer m_ResizeTimer

Referenced by AddedToCargoEx(), LayoutHolder::Insert(), LayoutHolder::Remove(), RemovedFromCargo(), and SetEntity().

◆ Refresh() [2/2]

override void Container::Refresh ( )
inlineprotected

Definition at line 100 of file ClosableContainer.c.

101 {
102 if (!m_Closed)
103 super.Refresh();
104 }

◆ RefreshImpl()

void Container::RefreshImpl ( )
inlineprotected

Definition at line 516 of file CargoContainer.c.

517 {
520 }
void UpdateRowVisibility(int count)

References UpdateRowVisibility(), and UpdateSelection().

◆ ReleaseLock()

void Container::ReleaseLock ( EntityAI item)
inlineprotected

Definition at line 199 of file CargoContainer.c.

200 {
201#ifndef PLATFORM_CONSOLE
202 if (m_ShowedLockPositions.Contains(item))
203 {
204 Icon ic = m_ShowedLockPositions.Get(item).param1;
205 m_Icons.RemoveItem(ic);
207 item.GetOnReleaseLock().Remove(ReleaseLock);
208 }
209#endif
210 }

◆ RemovedFromCargo()

void Container::RemovedFromCargo ( EntityAI item)
inlineprotected

Definition at line 115 of file CargoContainer.c.

116 {
118 if (data)
119 {
120 m_Icons.RemoveItem(data.param1);
122 }
123
125
126#ifdef PLATFORM_CONSOLE
127 for (int i = 0; i < m_Cargo.GetItemCount(); i++)
128 {
131 if (data && data.param1)
132 {
133 data.param1.SetCargoPos(i);
134 data.param1.SetPos();
135 }
136 }
137
139
140 Refresh();
141#endif
142 }

References CargoBase::GetItem(), CargoBase::GetItemCount(), Math::Min(), Refresh(), and UpdateHeaderText().

◆ Select()

override bool Container::Select ( )
inlineprotected

Definition at line 833 of file CargoContainer.c.

834 {
836 EntityAI selected_item = ItemManager.GetInstance().GetSelectedItem();
837 DayZPlayer player = GetGame().GetPlayer();
838
839
841 {
842 if (selected_item)
843 {
844 if (selected_item.GetInventory().CanRemoveEntity() && m_Entity)
845 {
846 bool can_add = m_Entity.GetInventory().CanAddEntityInCargo(selected_item, selected_item.GetInventory().GetFlipCargo());
847 bool in_cargo = !player.GetInventory().HasEntityInInventory(selected_item) || !m_Entity.GetInventory().HasEntityInCargo(selected_item);
848 if (can_add && in_cargo)
849 {
850 player.PredictiveTakeEntityToTargetCargo(m_Entity, selected_item);
851 Container selected_cont2 = ItemManager.GetInstance().GetSelectedContainer();
852 if (selected_cont2)
853 selected_cont2.SetActive(false);
854
855 SetActive(true);
857 return true;
858 }
859 else
860 {
861 Container selected_cont = ItemManager.GetInstance().GetSelectedContainer();
862 if (selected_cont)
863 selected_cont.SetActive(false);
864
865 SetActive(true);
866 SetDefaultFocus(true);
867 }
868 }
869 }
870 else if (focused_item && focused_item.GetInventory().CanRemoveEntity())
871 {
872 EntityAI item_in_hands = GetGame().GetPlayer().GetHumanInventory().GetEntityInHands();
873 if (item_in_hands)
874 {
876 {
877 player.PredictiveSwapEntities(item_in_hands, focused_item);
878 return true;
879 }
880 }
881 else
882 {
883 if (player.GetHumanInventory().CanAddEntityInHands(focused_item))
884 {
885 player.PredictiveTakeEntityToHands(focused_item);
886 return true;
887 }
888 }
889 }
890 }
891 return false;
892 }
void SetActive()
Definition TrapBase.c:409
override EntityAI GetFocusedItem()
override void SetDefaultFocus(bool while_micromanagment_mode=false)
script counterpart to engine's class Inventory
Definition Inventory.c:79
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition Inventory.c:610

References GameInventory::CanSwapEntitiesEx(), GetFocusedItem(), GetGame(), ItemManager::GetInstance(), m_Entity, SetActive(), and SetDefaultFocus().

Referenced by HandsContainer::OnSelectButton().

◆ SelectItem()

override bool Container::SelectItem ( )
inlineprotected

Definition at line 818 of file CargoContainer.c.

819 {
821 if (focused_item)
822 {
823 ItemBase item = ItemBase.Cast(focused_item.GetObject());
824 if (item && item.IsTakeable() && item.CanPutIntoHands(null))
825 {
826 ItemManager.GetInstance().SetSelectedItemEx(item, this, focused_item);
827 return true;
828 }
829 }
830 return false;
831 }

References GetFocusedIcon(), and ItemManager::GetInstance().

◆ SetActive()

override void Container::SetActive ( bool active)
inlineprotected

Definition at line 710 of file CargoContainer.c.

711 {
712 super.SetActive(active);
714 }

References UpdateSelection().

◆ SetAlternateFalseTextHeaderWidget()

void Container::SetAlternateFalseTextHeaderWidget ( TextWidget w)
inlineprotected

Definition at line 918 of file CargoContainer.c.

919 {
922 if (update)
924 }
TextWidget m_AlternateFalseHeaderTextWidget

References m_AlternateFalseHeaderTextWidget, and UpdateHeaderText().

◆ SetDefaultFocus()

override void Container::SetDefaultFocus ( bool while_micromanagment_mode = false)
inlineprotected

Definition at line 589 of file CargoContainer.c.

590 {
591 super.SetDefaultFocus(while_micromanagment_mode);
592
593 Unfocus();
596 }
override void Unfocus()

References Unfocus(), and UpdateSelection().

Referenced by Select(), LayoutHolder::SetActive(), LayoutHolder::SetFirstActive(), and SetLastFocus().

◆ SetEntity()

void Container::SetEntity ( EntityAI item,
int cargo_index = 0,
bool immedUpdate = true )
inlineprotected

Definition at line 239 of file CargoContainer.c.

240 {
241 if (item)
242 {
243 m_Entity = item;
244 m_Cargo = item.GetInventory().GetCargoFromIndex(cargo_index);
246
247 m_Entity.GetOnItemAddedIntoCargo().Insert(AddedToCargo);
248 m_Entity.GetOnItemRemovedFromCargo().Insert(RemovedFromCargo);
249 m_Entity.GetOnItemMovedInCargo().Insert(MovedInCargo);
250 m_Entity.GetOnSetLock().Insert(SetLock);
251 m_Entity.GetOnReleaseLock().Insert(ReleaseLock);
252
253 if (immedUpdate)
255
257 m_MainWidget = m_ItemsContainer;
258
259 if (m_Cargo)
260 {
261 int i;
262 int prev_count = m_ShowedItemPositions.Count();
263
264 //START - Add new item Icons
265 for (i = 0; i < m_Cargo.GetItemCount(); i++)
266 {
268 if (cargo_item)
270 }
271
272#ifdef PLATFORM_CONSOLE
273 if (immedUpdate)
274 Refresh();
275#endif
276 }
277 }
278 }
void InitGridHeight()

References AddedToCargoEx(), CargoBase::GetItem(), CargoBase::GetItemCount(), InitGridHeight(), m_Entity, m_ItemsContainer, Refresh(), SetLock(), and UpdateHeaderText().

◆ SetLastActive()

override void Container::SetLastActive ( )
inlineprotected

Definition at line 701 of file CargoContainer.c.

702 {
703 super.SetLastActive();
704 if (GetFocusedIcon())
705 GetFocusedIcon().SetActive(false);
708 }
const int ROWS_NUMBER_XBOX
override void SetActive(bool active)
Definition Icon.c:103

References GetFocusedIcon(), Icon::SetActive(), and UpdateSelection().

Referenced by AttachmentsGroupContainer::SetPreviousActive(), and LayoutHolder::SetPreviousActive().

◆ SetLastFocus()

override void Container::SetLastFocus ( )
inlineprotected

Definition at line 598 of file CargoContainer.c.

599 {
601 }

References SetDefaultFocus().

Referenced by LayoutHolder::SetLastActive().

◆ SetLayoutName() [1/2]

override void Container::SetLayoutName ( )
inlineprotected

Definition at line 212 of file CargoContainer.c.

213 {
214#ifdef PLATFORM_CONSOLE
216#else
217 switch (InventoryMenu.GetWidthType())
218 {
219 case ScreenWidthType.NARROW:
220 {
222 break;
223 }
224 case ScreenWidthType.MEDIUM:
225 {
227 break;
228 }
229 case ScreenWidthType.WIDE:
230 {
232 break;
233 }
234 }
235#endif
236
237 }
ScreenWidthType
void InventoryMenu()
const string CargoContainerXbox
const string CargoContainerWide
const string CargoContainerNarrow
const string CargoContainerMedium

References WidgetLayoutName::CargoContainerMedium, WidgetLayoutName::CargoContainerNarrow, WidgetLayoutName::CargoContainerWide, WidgetLayoutName::CargoContainerXbox, and InventoryMenu().

◆ SetLayoutName() [2/2]

override void Container::SetLayoutName ( )
inlineprotected

Definition at line 82 of file ClosableContainer.c.

83 {
85 }
const string ClosableContainer

References WidgetLayoutName::ClosableContainer.

◆ SetLock()

void Container::SetLock ( EntityAI item)
inlineprotected

Definition at line 178 of file CargoContainer.c.

179 {
180#ifndef PLATFORM_CONSOLE
181 if (GetGame().GetPlayer())
182 {
184 int index = GetGame().GetPlayer().GetHumanInventory().FindUserReservedLocationIndex(item);
185 if (index >= 0)
186 {
187 GetGame().GetPlayer().GetHumanInventory().GetUserReservedLocation(index, il);
188
189 ref Icon icon = new Icon(this, false);
190 m_Icons.Insert(icon);
191 icon.InitLock(m_Entity, item, il.GetCol(), il.GetRow(), il.GetFlip());
193 item.GetOnReleaseLock().Insert(ReleaseLock);
194 }
195 }
196#endif
197 }

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

◆ SetNextActive()

override void Container::SetNextActive ( )
inlineprotected

Definition at line 620 of file CargoContainer.c.

621 {
622 Unfocus();
624 int max_row = (m_Icons.Count() - 1) / ROWS_NUMBER_XBOX;
625
626 if (max_row > focused_row)
627 {
629 if (m_FocusedItemPosition >= m_Icons.Count())
630 m_FocusedItemPosition = m_Icons.Count() - 1;
632 }
633 else
634 SetActive(false);
635 }

References ROWS_NUMBER_XBOX, SetActive(), Unfocus(), and UpdateSelection().

Referenced by LayoutHolder::MoveGridCursor().

◆ SetNextLeftActive()

override void Container::SetNextLeftActive ( )
inlineprotected

Definition at line 672 of file CargoContainer.c.

673 {
674 if (m_Icons.Count() > 0)
675 {
676 Unfocus();
679 int row_max = row_min + ROWS_NUMBER_XBOX - 1;
680
681 if (row_max >= m_Icons.Count())
682 row_max = m_Icons.Count() - 1;
683
687
689 }
690 }

References ROWS_NUMBER_XBOX, Unfocus(), and UpdateSelection().

Referenced by LayoutHolder::MoveGridCursor().

◆ SetNextRightActive()

override void Container::SetNextRightActive ( )
inlineprotected

Definition at line 652 of file CargoContainer.c.

653 {
654 if (m_Icons.Count() > 0)
655 {
656 Unfocus();
659 int row_max = row_min + ROWS_NUMBER_XBOX - 1;
660
661 if (row_max >= m_Icons.Count())
662 row_max = m_Icons.Count() - 1;
663
667
669 }
670 }

References ROWS_NUMBER_XBOX, Unfocus(), and UpdateSelection().

Referenced by LayoutHolder::MoveGridCursor().

◆ SetOpenState()

void Container::SetOpenState ( bool state)
inlineprotected

Definition at line 46 of file ClosableContainer.c.

47 {
48 ItemManager.GetInstance().SetDefaultOpenState(m_Entity.GetType(), state);
49 m_Closed = !state;
50 if (!m_Closed)
51 OnShow();
52 else
53 OnHide();
54 }

References ItemManager::GetInstance(), m_Entity, OnHide(), and OnShow().

◆ SetPreviousActive()

override void Container::SetPreviousActive ( bool force = false)
inlineprotected

Definition at line 637 of file CargoContainer.c.

638 {
639 Unfocus();
641
642 if (focused_row > 0)
643 {
646 }
647 else
648 SetActive(false);
649 }

References ROWS_NUMBER_XBOX, SetActive(), Unfocus(), and UpdateSelection().

Referenced by LayoutHolder::MoveGridCursor(), and LayoutHolder::Remove().

◆ ShowFalseCargoHeader()

void Container::ShowFalseCargoHeader ( bool show)
inlineprotected

Definition at line 913 of file CargoContainer.c.

914 {
915 m_CargoHeader.Show(show);
916 }

◆ SplitItem()

override bool Container::SplitItem ( )
inlineprotected

Definition at line 778 of file CargoContainer.c.

779 {
780 if (CanSplit())
781 {
782 if (GetFocusedIcon())
783 {
785 if (entity)
786 {
787 if (entity.HasQuantity() && entity.CanBeSplit())
788 {
789 entity.OnRightClick();
791
792 if (icon)
793 icon.SetQuantity();
794 }
795 }
796 }
797 }
798 return false;
799 }

References GetFocusedIcon(), and GetObject().

◆ TransferItem()

override bool Container::TransferItem ( )
inlineprotected

Definition at line 761 of file CargoContainer.c.

762 {
763 if (CanTakeToInventory())
764 {
765 if (GetFocusedIcon())
766 {
768 if (entity)
769 {
770 GetGame().GetPlayer().PredictiveTakeEntityToInventory(FindInventoryLocationType.CARGO, entity);
771 return true;
772 }
773 }
774 }
775 return false;
776 }

References GetFocusedIcon(), GetGame(), and GetObject().

◆ TransferItemToVicinity()

override bool Container::TransferItemToVicinity ( )
inlineprotected

Definition at line 568 of file CargoContainer.c.

569 {
570 if (CanDrop())
571 {
572 Man player = GetGame().GetPlayer();
573 if (GetFocusedIcon())
574 {
576 if (item && player.CanDropEntity(item))
577 {
578 if (item.GetTargetQuantityMax() < item.GetQuantity())
579 item.SplitIntoStackMaxClient(null, -1);
580 else
581 player.PhysicalPredictiveDropItem(item);
582 return true;
583 }
584 }
585 }
586 return false;
587 }

References GetFocusedIcon(), GetGame(), and GetObject().

◆ Unfocus()

override void Container::Unfocus ( )
inlineprotected

Definition at line 603 of file CargoContainer.c.

604 {
606 if (icon)
607 icon.SetActive(false);
608 }

References GetFocusedIcon().

Referenced by LayoutHolder::SetActive(), SetDefaultFocus(), SetNextActive(), SetNextLeftActive(), SetNextRightActive(), and SetPreviousActive().

◆ UnfocusAll()

override void Container::UnfocusAll ( )
inlineprotected

Definition at line 610 of file CargoContainer.c.

611 {
612 if (m_Icons)
613 {
614 foreach (Icon icon : m_Icons)
616 }
618 }

References m_Icons.

◆ UpdateHeaderText()

void Container::UpdateHeaderText ( )
inlineprotected

Definition at line 285 of file CargoContainer.c.

286 {
288 string name = m_Entity.GetDisplayName();
289 name.ToUpper();
290
291 if (m_Entity.CanDisplayCargo() && m_Entity.GetInventory().GetCargoFromIndex(m_CargoIndex))
292 {
293 name = name + " (" + GetCargoCapacity().ToString() + "/" + GetMaxCargoCapacity() + ")";
295 {
297 float x, y;
299 m_FalseHeaderTextWidget.GetScreenSize(x, y);
300 m_CargoHeader.FindAnyWidget("grid_container_header").SetSize(1, y + InventoryMenu.GetHeightMultiplied(10));
301 m_CargoHeader.Update();
302
305 return;
306 }
307 }
308
309 if (Container.Cast(GetParent()) && Container.Cast(GetParent()).GetHeader())
310 Container.Cast(GetParent()).GetHeader().SetName(name);
311 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
int GetMaxCargoCapacity()
int GetCargoCapacity()
override Header GetHeader()
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:389

References GetCargoCapacity(), GetHeader(), GetMaxCargoCapacity(), GetParent(), InventoryMenu(), m_Entity, name, x, and y.

Referenced by AddedToCargoEx(), RemovedFromCargo(), SetAlternateFalseTextHeaderWidget(), and SetEntity().

◆ UpdateInterval()

override void Container::UpdateInterval ( )
inlineprotected

Definition at line 522 of file CargoContainer.c.

523 {
525 {
526 if (data.param1)
527 data.param1.UpdateInterval();
528 }
529 }

References m_ShowedItemPositions.

◆ UpdateRadialIcon()

override void Container::UpdateRadialIcon ( )
inlineprotected

Definition at line 28 of file ClosableContainer.c.

29 {
30 if (m_SlotIcon)
31 {
34 show_radial_icon = show_radial_icon && ((m_Entity.GetInventory().GetCargo() && m_Entity.CanDisplayCargo()) || m_Entity.GetSlotsCountCorrect() > 0);
35 show_radial_icon = show_radial_icon && !m_Entity.GetInventory().IsInventoryLockedForLockType(HIDE_INV_FROM_SCRIPT);
36 if (IsDisplayable())
37 {
38 m_SlotIcon.GetRadialIconPanel().Show(true);
39 SetOpenForSlotIcon(show_radial_icon);
40 }
41 else
42 m_SlotIcon.GetRadialIconPanel().Show(false);
43 }
44 }

References ClosableContainer::IsDisplayable(), ClosableContainer::IsOpened(), and m_Entity.

Referenced by Attachments::UpdateInterval().

◆ UpdateRowVisibility()

void Container::UpdateRowVisibility ( int count)
inlineprotected

Definition at line 473 of file CargoContainer.c.

474 {
475 int i;
476 int rows = Math.Max(1, Math.Ceil((count + 1) / ROWS_NUMBER_XBOX));
477 int diff = rows - m_Rows.Count();
478
479 if (diff < 0)
480 {
481 for (i = m_Rows.Count() - 1; i >= rows; i--)
482 m_Rows.Remove(i);
483 }
484 else if (diff > 0)
485 {
486 m_MainWidget = m_CargoContainer;
487 for (i = m_Rows.Count(); i < rows; i++)
488 {
490
491 row.SetNumber(i);
492 row.SetEntity(m_Entity);
493 row.GetRootWidget().SetSort(i);
494 m_Rows.Insert(row);
495 }
496 m_MainWidget = m_ItemsContainer;
497 }
498
499 m_Resizer2.ResizeParentToChild();
500#ifndef PLATFORM_CONSOLE
501 m_Resizer1.ResizeParentToChild();
502#endif
503 }
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Ceil(float f)
Returns ceil of value.

References Math::Ceil(), m_CargoContainer, m_Entity, m_ItemsContainer, and Math::Max().

Referenced by RefreshImpl().

◆ UpdateSelection()

void Container::UpdateSelection ( )
inlineprotected

Definition at line 458 of file CargoContainer.c.

459 {
460 if (m_IsActive)
461 {
462 if (m_FocusedItemPosition >= m_Icons.Count())
463 m_FocusedItemPosition = m_Icons.Count() - 1;
465 if (icon && !icon.IsActive())
466 {
467 icon.SetActive(true);
468 Inventory.GetInstance().UpdateConsoleToolbar();
469 }
470 }
471 }
bool m_IsActive

References GetIcon(), Inventory(), and m_IsActive.

Referenced by MovedInCargo(), RefreshImpl(), SetActive(), SetDefaultFocus(), SetLastActive(), SetNextActive(), SetNextLeftActive(), SetNextRightActive(), and SetPreviousActive().

◆ UpdateSize()

void Container::UpdateSize ( )
inlineprotected

Definition at line 357 of file CargoContainer.c.

358 {
359#ifndef PLATFORM_CONSOLE
360 m_Resizer1.ResizeParentToChild();
361#else
362 m_Resizer2.ResizeParentToChild();
363#endif
364 }

Member Data Documentation

◆ m_AlternateFalseHeaderTextWidget

TextWidget Container::m_AlternateFalseHeaderTextWidget
protected

Definition at line 20 of file CargoContainer.c.

Referenced by SetAlternateFalseTextHeaderWidget().

◆ m_Cargo

CargoBase Container::m_Cargo
protected

Definition at line 6 of file CargoContainer.c.

◆ m_CargoContainer

Widget Container::m_CargoContainer
protected

Definition at line 22 of file CargoContainer.c.

Referenced by CargoContainer(), and UpdateRowVisibility().

◆ m_CargoHeader

Widget Container::m_CargoHeader
protected

Definition at line 21 of file CargoContainer.c.

◆ m_CargoIndex

int Container::m_CargoIndex = -1
protected

Definition at line 7 of file CargoContainer.c.

Referenced by GetCargoIndex().

◆ m_ClosableHeader

ref ClosableHeader Container::m_ClosableHeader
protected

Definition at line 3 of file ClosableContainer.c.

◆ m_FalseHeaderTextWidget

TextWidget Container::m_FalseHeaderTextWidget
protected

Definition at line 19 of file CargoContainer.c.

◆ m_FocusedItemPosition

int Container::m_FocusedItemPosition = -1
protected

Definition at line 9 of file CargoContainer.c.

◆ m_Icons

ref array<ref Icon> Container::m_Icons
protected

Definition at line 11 of file CargoContainer.c.

Referenced by UnfocusAll().

◆ m_IconSize

float Container::m_IconSize
protected

Definition at line 15 of file CargoContainer.c.

Referenced by GetIconSize().

◆ m_IsAttachment

bool Container::m_IsAttachment
protected

Definition at line 18 of file CargoContainer.c.

◆ m_ItemsContainer

Widget Container::m_ItemsContainer
protected

Definition at line 23 of file CargoContainer.c.

Referenced by SetEntity(), and UpdateRowVisibility().

◆ m_LockCargo

bool Container::m_LockCargo
protected

Definition at line 4 of file ClosableContainer.c.

◆ m_Resizer1

ref SizeToChild Container::m_Resizer1
protected

Definition at line 25 of file CargoContainer.c.

◆ m_Resizer2

ref SizeToChild Container::m_Resizer2
protected

Definition at line 27 of file CargoContainer.c.

◆ m_ResizeTimer

ref Timer Container::m_ResizeTimer
protected

Definition at line 28 of file CargoContainer.c.

◆ m_Rows

ref array<ref CargoContainerRow> Container::m_Rows
protected

Definition at line 10 of file CargoContainer.c.

◆ m_ShowedItemPositions

ref map<EntityAI, ref Param3<ref Icon, int, int> > Container::m_ShowedItemPositions
protected

Definition at line 12 of file CargoContainer.c.

Referenced by UpdateInterval().

◆ m_ShowedLockPositions

ref map<EntityAI, ref Param3<ref Icon, int, int> > Container::m_ShowedLockPositions
protected

Definition at line 13 of file CargoContainer.c.

◆ m_SpaceSize

float Container::m_SpaceSize
protected

Definition at line 16 of file CargoContainer.c.

Referenced by GetSpaceSize().

◆ ROWS_NUMBER_XBOX

const int Container::ROWS_NUMBER_XBOX = 5
protected

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