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

Protected Member Functions

void IconsContainer (LayoutHolder parent)
 
override void UnfocusAll ()
 
int GetItemCount ()
 
void AddItem (Icon icon)
 
Icon GetIcon (int entity_id)
 
Icon GetIconByIndex (int index)
 
void RemoveItem (Icon icon)
 
void RemoveItem (int entity)
 
bool ContainsEntity (EntityAI entity)
 
void UpdateItemsTemperature ()
 
override void Refresh ()
 

Protected Attributes

ref map< int, ref Iconm_EntitiesMap = new map<int, ref Icon>
 

Additional Inherited Members

- Private Member Functions inherited from Container
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 ()
 
- Private Attributes inherited from Container
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 1 of file IconsContainer.c.

Constructor & Destructor Documentation

◆ IconsContainer()

void IconsContainer::IconsContainer ( LayoutHolder parent)
inlineprotected

Definition at line 5 of file IconsContainer.c.

6 {
7 }

Member Function Documentation

◆ AddItem()

void IconsContainer::AddItem ( Icon icon)
inlineprotected

Definition at line 27 of file IconsContainer.c.

28 {
29 if (!m_EntitiesMap.Contains(icon.GetObject().GetID()))
30 m_EntitiesMap.Insert(icon.GetObject().GetID(), icon);
31 }
ref map< int, ref Icon > m_EntitiesMap

References m_EntitiesMap.

◆ ContainsEntity()

bool IconsContainer::ContainsEntity ( EntityAI entity)
inlineprotected

Definition at line 68 of file IconsContainer.c.

69 {
70 return m_EntitiesMap.Contains(entity.GetID());
71 }

References m_EntitiesMap.

◆ GetIcon()

Icon IconsContainer::GetIcon ( int entity_id)
inlineprotected

Definition at line 33 of file IconsContainer.c.

34 {
35 return m_EntitiesMap.Get(entity_id);
36 }

References m_EntitiesMap.

◆ GetIconByIndex()

Icon IconsContainer::GetIconByIndex ( int index)
inlineprotected

Definition at line 38 of file IconsContainer.c.

39 {
40 if (index < m_EntitiesMap.Count() && index > -1)
41 return m_EntitiesMap.GetElement(index);
42 return null;
43 }

References m_EntitiesMap.

◆ GetItemCount()

int IconsContainer::GetItemCount ( )
inlineprotected

Definition at line 22 of file IconsContainer.c.

23 {
24 return m_EntitiesMap.Count();
25 }

References m_EntitiesMap.

◆ Refresh()

override void IconsContainer::Refresh ( )
inlineprotected

Definition at line 85 of file IconsContainer.c.

86 {
87 super.Refresh();
88
89 for (int i = 0; i < m_EntitiesMap.Count(); i++)
90 m_EntitiesMap.GetElement(i).Refresh();
91 }

References m_EntitiesMap.

◆ RemoveItem() [1/2]

void IconsContainer::RemoveItem ( Icon icon)
inlineprotected

Definition at line 45 of file IconsContainer.c.

46 {
47 if (icon)
48 {
49 Icon icon_copy = icon; // for some reason garbage collector collects icon too soon, so copy has to be made
50 if (icon.GetObject())
51 m_EntitiesMap.Remove(icon.GetObject().GetID());
52 else
53 {
54 int ix = m_EntitiesMap.GetKeyByValue(icon);
55 if (m_EntitiesMap.Contains(ix))
56 m_EntitiesMap.Remove(ix);
57 else
58 delete icon;
59 }
60 }
61 }
Definition Icon.c:2

References m_EntitiesMap.

◆ RemoveItem() [2/2]

void IconsContainer::RemoveItem ( int entity)
inlineprotected

Definition at line 63 of file IconsContainer.c.

64 {
65 m_EntitiesMap.Remove(entity);
66 }

References m_EntitiesMap.

◆ UnfocusAll()

override void IconsContainer::UnfocusAll ( )
inlineprotected

Definition at line 9 of file IconsContainer.c.

10 {
11 for (int i = 0; i < Count(); i++)
12 {
13 for (int j = 0; j < ITEMS_IN_ROW; j++)
14 Get(i).GetMainWidget().FindAnyWidget("Cursor" + j).Show(false);
15 }
16
17
18 for (i = 0; i < m_EntitiesMap.Count(); ++i)
19 m_EntitiesMap.GetElement(i).SetActive(false);
20 }
const int ITEMS_IN_ROW
Definition Attachments.c:1
array< ref PlayerStatBase > Get()

References Count, Get(), ITEMS_IN_ROW, and m_EntitiesMap.

◆ UpdateItemsTemperature()

void IconsContainer::UpdateItemsTemperature ( )
inlineprotected

Definition at line 73 of file IconsContainer.c.

74 {
75 if (!ItemManager.GetInstance().IsDragging())
76 {
77 for (int i = 0; i < m_EntitiesMap.Count(); i++)
78 {
79 Icon icon = m_EntitiesMap.GetElement(i);
80 icon.SetTemperature();
81 }
82 }
83 }
static ItemManager GetInstance()

References ItemManager::GetInstance(), and m_EntitiesMap.

Member Data Documentation

◆ m_EntitiesMap

ref map<int, ref Icon> IconsContainer::m_EntitiesMap = new map<int, ref Icon>
protected

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