DayZ 1.24
Loading...
Searching...
No Matches
IconsContainer.c
Go to the documentation of this file.
2{
4
6 {
7 }
8
9 override void UnfocusAll()
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 }
21
23 {
24 return m_EntitiesMap.Count();
25 }
26
28 {
29 if (!m_EntitiesMap.Contains(icon.GetObject().GetID()))
30 m_EntitiesMap.Insert(icon.GetObject().GetID(), icon);
31 }
32
34 {
35 return m_EntitiesMap.Get(entity_id);
36 }
37
39 {
40 if (index < m_EntitiesMap.Count() && index > -1)
41 return m_EntitiesMap.GetElement(index);
42 return null;
43 }
44
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 }
62
64 {
65 m_EntitiesMap.Remove(entity);
66 }
67
69 {
70 return m_EntitiesMap.Contains(entity.GetID());
71 }
72
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 }
84
85 override void Refresh()
86 {
87 super.Refresh();
88
89 for (int i = 0; i < m_EntitiesMap.Count(); i++)
90 m_EntitiesMap.GetElement(i).Refresh();
91 }
92}
const int ITEMS_IN_ROW
Definition Attachments.c:1
array< ref PlayerStatBase > Get()
Definition Icon.c:2
override void UnfocusAll()
void IconsContainer(LayoutHolder parent)
void RemoveItem(int entity)
ref map< int, ref Icon > m_EntitiesMap
override void Refresh()
Icon GetIcon(int entity_id)
void UpdateItemsTemperature()
void AddItem(Icon icon)
bool ContainsEntity(EntityAI entity)
Icon GetIconByIndex(int index)
void RemoveItem(Icon icon)
static ItemManager GetInstance()