Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
attachmentsgroupcontainer.c
Go to the documentation of this file.
2 {
3  ref Header m_Header;
4 
5  override void SetLayoutName()
6  {
7  m_LayoutName = WidgetLayoutName.AttachmentsGroupContainer;
8  }
9 
10  override void SetHeader(Header header)
11  {
12  m_Header = header;
13  m_Header.GetMainWidget().SetFlags( WidgetFlags.IGNOREPOINTER );
14  }
15 
16  override Header GetHeader()
17  {
18  return m_Header;
19  }
20 
22  {
23  m_FocusedColumn = 0;
24  }
25 
26  override void SetActive(bool active)
27  {
28  super.SetActive(active);
29  if (!active)
30  {
31  m_FocusedColumn = 0;
32  }
33  }
34 
35  override void SetDefaultFocus(bool while_micromanagment_mode = false)
36  {
37  super.SetDefaultFocus();
38  m_FocusedColumn = 0;
39  }
40 
41  SlotsIcon GetSlotsIcon(int row, int column, bool include_invisible = true )
42  {
44  if (include_invisible)
45  {
46  c = SlotsContainer.Cast(m_Body[row]);
47  }
48  else
49  {
50  c = SlotsContainer.Cast(m_OpenedContainers[row]);
51  }
52  return c.GetSlotIcon(column);
53  }
54 
55  int GetRowCount(bool include_invisible = true)
56  {
57  if (include_invisible)
58  {
59  return m_Body.Count();
60  }
61  else
62  {
63  return m_OpenedContainers.Count();
64  }
65  }
66 
67  int GetColumnCountForRow(int row, bool include_invisible = true)
68  {
69  Container c;
70  if (include_invisible)
71  {
72  c = Container.Cast(m_Body[row]);
73  }
74  else
75  {
76  c = Container.Cast(m_OpenedContainers[row]);
77  }
78  return c.GetColumnCount();
79  }
80 
81  override void SetNextActive()
82  {
83  HideOwnedTooltip();
84  int visible_focus = 0;
85 
86  SlotsContainer active;
87  if (m_OpenedContainers.Count())
88  {
89  active = SlotsContainer.Cast(m_OpenedContainers[m_ActiveIndex]);
90  }
91 
92  if (active && active.IsActive())
93  {
94  visible_focus = active.GetVisibleFocus();
95  active.SetNextActive();
96  }
97  if (!active || !active.IsActive())
98  {
99  SlotsContainer next;
100  if (!IsLastContainerFocused())
101  {
102  m_ActiveIndex++;
103 
104  //int visible_focus = active.GetVisibleFocus();
105 
106  next = SlotsContainer.Cast(m_OpenedContainers[m_ActiveIndex]);
107  next.SetActive(true);
108  next.SetVisibleFocus(visible_focus);
109  }
110  else if (Container.Cast( GetParent() ))
111  {
112  SetActive(false);
113  }
114  else
115  {
116  SetActive(false);
117  SetFirstActive();
118  }
119  }
120  }
121 
122  override void SetPreviousActive(bool force = false)
123  {
124  HideOwnedTooltip();
125  int visible_focus = 0;
126 
127  SlotsContainer active;
128  if (m_OpenedContainers.Count())
129  {
130  active = SlotsContainer.Cast(m_OpenedContainers[m_ActiveIndex]);
131  }
132 
133  if (active && active.IsActive())
134  {
135  visible_focus = active.GetVisibleFocus();
136  active.SetPreviousActive();
137  }
138 
139  if (!active || !active.IsActive())
140  {
141  SlotsContainer prev;
142  if (!IsFirstContainerFocused())
143  {
144  m_ActiveIndex--;
145 
146  prev = SlotsContainer.Cast(m_OpenedContainers[m_ActiveIndex]);
147  prev.SetActive(true);
148  prev.SetVisibleFocus(visible_focus);
149  }
150  else if (Container.Cast( GetParent() ))
151  {
152  SetActive(false);
153  }
154  else
155  {
156  SetActive(false);
157  SetLastActive();
158  }
159  }
160  }
161 }
SlotsContainer
Definition: slotscontainer.c:1
LayoutHolder
Definition: container.c:1
WidgetLayoutName
Definition: widgetlayoutname.c:1
Header
Definition: header.c:1
Container
Definition: cargocontainer.c:2
SlotsIcon
Definition: slotsicon.c:1
AttachmentsGroupContainer
Definition: attachmentsgroupcontainer.c:1
m_Header
class ErrorHandlerModule m_Header
This is where to input logic and extend functionality of ErrorHandlerModule.
WidgetFlags
WidgetFlags
Definition: enwidgets.c:57
GetParent
proto native Widget GetParent()
Get parent of the Effect.
Definition: effect.c:405