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

Protected Member Functions

void LeftArea (LayoutHolder parent)
 
override void UnfocusGrid ()
 
override bool IsActive ()
 
override void SetActive (bool active)
 
override ScrollWidget GetScrollWidget ()
 
override void UpdateSelectionIcons ()
 
float GetCurrentContainerTopY ()
 
float GetCurrentContainerBottomY ()
 
override void SetSameLevelNextActive ()
 
override void SetSameLevelPreviousActive ()
 
override void ExpandCollapseContainer ()
 
void OnLeftPanelDropReceived (Widget w, int x, int y, Widget receiver)
 
override void DraggingOverHeader (Widget w, int x, int y, Widget receiver)
 
override void SetLayoutName ()
 
override EntityAI GetFocusedItem ()
 
VicinityContainer GetVicinityContainer ()
 
override void SetParentWidget ()
 
override void OnShow ()
 
override void Refresh ()
 
override void UpdateInterval ()
 
override bool OnChildRemove (Widget w, Widget child)
 
override bool OnChildAdd (Widget w, Widget child)
 

Protected Attributes

Widget m_UpIcon
 
Widget m_DownIcon
 
Widget m_ContentParent
 
ref VicinityContainer m_VicinityContainer
 
ScrollWidget m_ScrollWidget
 
ref SizeToChild m_ContentResize
 
bool m_ShouldChangeSize = true
 
bool m_IsProcessing = false
 

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 LeftArea.c.

Constructor & Destructor Documentation

◆ LeftArea()

void LeftArea::LeftArea ( LayoutHolder parent)
inlineprotected

Definition at line 12 of file LeftArea.c.

13 {
14 m_MainWidget.Show(true, false);
15
16 m_ContentParent = m_MainWidget.FindAnyWidget("ContentParent");
18
19 m_ScrollWidget = ScrollWidget.Cast(m_MainWidget.FindAnyWidget("Scroller"));
20 m_MainWidget = m_MainWidget.FindAnyWidget("Content");
21
22 m_UpIcon = m_RootWidget.FindAnyWidget("Up");
23 m_DownIcon = m_RootWidget.FindAnyWidget("Down");
24
25 m_VicinityContainer = new VicinityContainer(this, false);
26 m_Body.Insert(m_VicinityContainer);
27 m_ActiveIndex = 0;
28
29 WidgetEventHandler.GetInstance().RegisterOnChildAdd(m_MainWidget, this, "OnChildAdd");
30 WidgetEventHandler.GetInstance().RegisterOnChildRemove(m_MainWidget, this, "OnChildRemove");
31 RecomputeOpenedContainers();
32 }
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
Widget m_ContentParent
Definition LeftArea.c:5
ScrollWidget m_ScrollWidget
Definition LeftArea.c:7
Widget m_UpIcon
Definition LeftArea.c:3
ref VicinityContainer m_VicinityContainer
Definition LeftArea.c:6
ref SizeToChild m_ContentResize
Definition LeftArea.c:8
Widget m_DownIcon
Definition LeftArea.c:4
static WidgetEventHandler GetInstance()

References WidgetEventHandler::GetInstance(), m_ContentParent, m_ContentResize, m_DownIcon, m_RootWidget, m_ScrollWidget, m_UpIcon, and m_VicinityContainer.

Member Function Documentation

◆ DraggingOverHeader()

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

Definition at line 144 of file LeftArea.c.

145 {
146 m_VicinityContainer.DraggingOverHeader(w, x, y, receiver);
147 }
Icon x
Icon y

References m_VicinityContainer, x, and y.

◆ ExpandCollapseContainer()

override void LeftArea::ExpandCollapseContainer ( )
inlineprotected

Definition at line 130 of file LeftArea.c.

131 {
132 Container c = GetFocusedContainer();
133 if (c)
134 c.ExpandCollapseContainer();
135
136 Refresh();
137 }
override void Refresh()
Definition LeftArea.c:198

References Refresh().

◆ GetCurrentContainerBottomY()

float LeftArea::GetCurrentContainerBottomY ( )
inlineprotected

Definition at line 105 of file LeftArea.c.

106 {
108 m_MainWidget.GetScreenPos(x, y);
109
110 if (m_OpenedContainers.IsValidIndex(m_ActiveIndex))
111 {
112 cont_screen_pos = Container.Cast(m_OpenedContainers.Get(m_ActiveIndex)).GetFocusedContainerYScreenPos();
113 cont_screen_height = Container.Cast(m_OpenedContainers.Get(m_ActiveIndex)).GetFocusedContainerHeight();
114 }
115
117 }
override float GetFocusedContainerHeight(bool contents=false)
override float GetFocusedContainerYScreenPos(bool contents=false)

References Container::GetFocusedContainerHeight(), Container::GetFocusedContainerYScreenPos(), x, and y.

Referenced by UpdateSelectionIcons().

◆ GetCurrentContainerTopY()

float LeftArea::GetCurrentContainerTopY ( )
inlineprotected

Definition at line 95 of file LeftArea.c.

96 {
97 float x, y, cont_screen_pos;
98 m_MainWidget.GetScreenPos(x, y);
99 if (m_OpenedContainers.IsValidIndex(m_ActiveIndex))
100 cont_screen_pos = Container.Cast(m_OpenedContainers.Get(m_ActiveIndex)).GetFocusedContainerYScreenPos();
101
102 return cont_screen_pos - y;
103 }

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

Referenced by UpdateSelectionIcons().

◆ GetFocusedItem()

override EntityAI LeftArea::GetFocusedItem ( )
inlineprotected

Definition at line 176 of file LeftArea.c.

177 {
178 EntityAI item = GetFocusedContainer().GetFocusedItem();
179 return item;
180 }

◆ GetScrollWidget()

override ScrollWidget LeftArea::GetScrollWidget ( )
inlineprotected

Definition at line 59 of file LeftArea.c.

60 {
61 return m_ScrollWidget;
62 }

References m_ScrollWidget.

◆ GetVicinityContainer()

VicinityContainer LeftArea::GetVicinityContainer ( )
inlineprotected

Definition at line 182 of file LeftArea.c.

183 {
184 return m_VicinityContainer;
185 }

References m_VicinityContainer.

◆ IsActive()

override bool LeftArea::IsActive ( )
inlineprotected

Definition at line 44 of file LeftArea.c.

45 {
46 if (m_OpenedContainers.Count() <= m_ActiveIndex)
47 m_ActiveIndex = 0;
48 Container active_container = Container.Cast(m_OpenedContainers.Get(m_ActiveIndex));
49 return active_container.IsActive();
50 }

◆ OnChildAdd()

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

Definition at line 242 of file LeftArea.c.

243 {
244 if (!m_IsProcessing)
245 Refresh();
246 return true;
247 }
bool m_IsProcessing
Definition LeftArea.c:10

References m_IsProcessing, and Refresh().

◆ OnChildRemove()

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

Definition at line 235 of file LeftArea.c.

236 {
237 if (!m_IsProcessing)
238 Refresh();
239 return true;
240 }

References m_IsProcessing, and Refresh().

◆ OnLeftPanelDropReceived()

void LeftArea::OnLeftPanelDropReceived ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected

Definition at line 139 of file LeftArea.c.

140 {
141 m_VicinityContainer.OnLeftPanelDropReceived(w, x, y, receiver);
142 }

References m_VicinityContainer, x, and y.

◆ OnShow()

override void LeftArea::OnShow ( )
inlineprotected

Definition at line 192 of file LeftArea.c.

193 {
194 super.OnShow();
195 Refresh();
196 }

References Refresh().

◆ Refresh()

override void LeftArea::Refresh ( )
inlineprotected

Definition at line 198 of file LeftArea.c.

199 {
200 super.Refresh();
201
202 m_MainWidget.Update();
203 m_RootWidget.Update();
204 m_ScrollWidget.Update();
205
207 m_ShouldChangeSize = true;
208 }
override void UpdateSelectionIcons()
Definition LeftArea.c:64
bool m_ShouldChangeSize
Definition LeftArea.c:9

References m_RootWidget, m_ScrollWidget, m_ShouldChangeSize, and UpdateSelectionIcons().

Referenced by ExpandCollapseContainer(), OnChildAdd(), OnChildRemove(), OnShow(), SetSameLevelNextActive(), and SetSameLevelPreviousActive().

◆ SetActive()

override void LeftArea::SetActive ( bool active)
inlineprotected

Definition at line 52 of file LeftArea.c.

53 {
54 super.SetActive(active);
55
57 }

References UpdateSelectionIcons().

◆ SetLayoutName()

override void LeftArea::SetLayoutName ( )
inlineprotected

Definition at line 149 of file LeftArea.c.

150 {
151#ifdef PLATFORM_CONSOLE
152 m_LayoutName = WidgetLayoutName.LeftAreaXbox;
153#else
154 switch (InventoryMenu.GetWidthType())
155 {
156 case ScreenWidthType.NARROW:
157 {
158 m_LayoutName = WidgetLayoutName.LeftAreaNarrow;
159 break;
160 }
161 case ScreenWidthType.MEDIUM:
162 {
163 m_LayoutName = WidgetLayoutName.LeftAreaMedium;
164 break;
165 }
166 case ScreenWidthType.WIDE:
167 {
168 m_LayoutName = WidgetLayoutName.LeftAreaWide;
169 break;
170 }
171 }
172#endif
173
174 }
ScreenWidthType
void InventoryMenu()
const string LeftAreaWide
const string LeftAreaNarrow
const string LeftAreaXbox
const string LeftAreaMedium

References InventoryMenu(), WidgetLayoutName::LeftAreaMedium, WidgetLayoutName::LeftAreaNarrow, WidgetLayoutName::LeftAreaWide, and WidgetLayoutName::LeftAreaXbox.

◆ SetParentWidget()

override void LeftArea::SetParentWidget ( )
inlineprotected

Definition at line 187 of file LeftArea.c.

188 {
189 m_ParentWidget = m_Parent.GetMainWidget().FindAnyWidget("LeftPanel");
190 }
Widget m_Parent
Definition SizeToChild.c:86
Widget m_ParentWidget

References m_Parent, and m_ParentWidget.

◆ SetSameLevelNextActive()

override void LeftArea::SetSameLevelNextActive ( )
inlineprotected

Definition at line 119 of file LeftArea.c.

120 {
121 m_VicinityContainer.SetSameLevelNextActive();
122 Refresh();
123 }

References m_VicinityContainer, and Refresh().

◆ SetSameLevelPreviousActive()

override void LeftArea::SetSameLevelPreviousActive ( )
inlineprotected

Definition at line 124 of file LeftArea.c.

125 {
126 m_VicinityContainer.SetSameLevelPreviousActive();
127 Refresh();
128 }

References m_VicinityContainer, and Refresh().

◆ UnfocusGrid()

override void LeftArea::UnfocusGrid ( )
inlineprotected

Definition at line 34 of file LeftArea.c.

35 {
37 for (int i = 0; i < m_OpenedContainers.Count(); i++)
38 {
39 active_container = Container.Cast(m_OpenedContainers.Get(i));
40 active_container.UnfocusGrid();
41 }
42 }

◆ UpdateInterval()

override void LeftArea::UpdateInterval ( )
inlineprotected

Definition at line 210 of file LeftArea.c.

211 {
212 m_IsProcessing = true;
213 super.UpdateInterval();
214 m_IsProcessing = false;
215
216 float x, y;
217 float x2, y2;
218 m_ContentParent.GetScreenSize(x, y);
219 m_MainWidget.GetScreenSize(x2, y2);
220 if (y2 != y)
221 m_ShouldChangeSize = true;
222 bool changed_size;
223 //if ( m_ShouldChangeSize )
224 m_ContentResize.ResizeParentToChild(changed_size);
226 {
227 m_MainWidget.Update();
228 m_RootWidget.Update();
229 m_ScrollWidget.Update();
230 m_ShouldChangeSize = false;
231 }
232 CheckScrollbarVisibility();
233 }

References m_ContentParent, m_ContentResize, m_IsProcessing, m_RootWidget, m_ScrollWidget, m_ShouldChangeSize, x, and y.

◆ UpdateSelectionIcons()

override void LeftArea::UpdateSelectionIcons ( )
inlineprotected

Definition at line 64 of file LeftArea.c.

65 {
66#ifdef PLATFORM_CONSOLE
67 ScrollToActiveContainer();
68#endif
69 m_UpIcon.Show(m_IsActive);
71 if (m_IsActive)
72 {
73 float x, y;
74 m_UpIcon.GetScreenSize(x, y);
75
77 m_UpIcon.SetPos(0, Math.Clamp(top_y, 0, 99999));
78
79#ifndef PLATFORM_CONSOLE
80 float x2, y2;
81 m_DownIcon.GetScreenSize(x2, y2);
83
84 float diff = bottom_y - (top_y + y);
85 if (diff < 0)
86 {
87 top_y += diff / 2;
88 bottom_y -= diff / 2;
89 }
90 m_DownIcon.SetPos(0, bottom_y);
91#endif
92 }
93 }
bool m_IsActive
float GetCurrentContainerTopY()
Definition LeftArea.c:95
float GetCurrentContainerBottomY()
Definition LeftArea.c:105
Definition EnMath.c:7
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

References Math::Clamp(), GetCurrentContainerBottomY(), GetCurrentContainerTopY(), m_DownIcon, m_IsActive, m_UpIcon, x, and y.

Referenced by Refresh(), and SetActive().

Member Data Documentation

◆ m_ContentParent

Widget LeftArea::m_ContentParent
protected

Definition at line 5 of file LeftArea.c.

Referenced by LeftArea(), and UpdateInterval().

◆ m_ContentResize

ref SizeToChild LeftArea::m_ContentResize
protected

Definition at line 8 of file LeftArea.c.

Referenced by LeftArea(), and UpdateInterval().

◆ m_DownIcon

Widget LeftArea::m_DownIcon
protected

Definition at line 4 of file LeftArea.c.

Referenced by LeftArea(), and UpdateSelectionIcons().

◆ m_IsProcessing

bool LeftArea::m_IsProcessing = false
protected

Definition at line 10 of file LeftArea.c.

Referenced by OnChildAdd(), OnChildRemove(), and UpdateInterval().

◆ m_ScrollWidget

ScrollWidget LeftArea::m_ScrollWidget
protected

Definition at line 7 of file LeftArea.c.

Referenced by GetScrollWidget(), LeftArea(), Refresh(), and UpdateInterval().

◆ m_ShouldChangeSize

bool LeftArea::m_ShouldChangeSize = true
protected

Definition at line 9 of file LeftArea.c.

Referenced by Refresh(), and UpdateInterval().

◆ m_UpIcon

Widget LeftArea::m_UpIcon
protected

Definition at line 3 of file LeftArea.c.

Referenced by LeftArea(), and UpdateSelectionIcons().

◆ m_VicinityContainer


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