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

Protected Member Functions

void RightArea (LayoutHolder parent)
 
PlayerContainer GetPlayerContainer ()
 
override void DraggingOverHeader (Widget w, int x, int y, Widget receiver)
 
override bool Select ()
 
override bool SelectItem ()
 
override bool Combine ()
 
override bool SplitItem ()
 
override bool EquipItem ()
 
override bool TransferItem ()
 
override bool InspectItem ()
 
override bool TransferItemToVicinity ()
 
override void UnfocusGrid ()
 
override bool CanTakeToInventory ()
 
override bool CanTakeToInventoryEx (EntityAI focusedEntity)
 
bool HasEntityContainerVisible (EntityAI entity)
 
void SwapItemsInOrder (int slot1, int slot2)
 
bool IsPlayerEquipmentActive ()
 
override void SetSameLevelNextActive ()
 
override void SetSameLevelPreviousActive ()
 
override void ExpandCollapseContainer ()
 
override void Refresh ()
 
override void SetLayoutName ()
 
override void SetParentWidget ()
 
override void OnShow ()
 
override void UpdateInterval ()
 
void MoveUpDownIcons ()
 
override ScrollWidget GetScrollWidget ()
 
override void UpdateSelectionIcons ()
 
float GetCurrentContainerTopY ()
 
float GetCurrentContainerBottomY ()
 

Protected Attributes

Widget m_ContentParent
 
ScrollWidget m_ScrollWidget
 
Widget m_UpIcon
 
Widget m_DownIcon
 
ref SizeToChild m_ContentResize
 
bool m_ShouldChangeSize = true
 
bool m_ProcessGridMovement
 

Private Attributes

ref PlayerContainer m_PlayerContainer
 
- 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
 

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 ()
 

Detailed Description

Definition at line 1 of file RightArea.c.

Constructor & Destructor Documentation

◆ RightArea()

void RightArea::RightArea ( LayoutHolder parent)
inlineprotected

Definition at line 14 of file RightArea.c.

15 {
16 m_MainWidget.Show(true);
17 m_ScrollWidget = ScrollWidget.Cast(m_MainWidget.FindAnyWidget("Scroller"));
18 m_MainWidget = m_MainWidget.FindAnyWidget("Content");
19 //m_ContentParent = m_RootWidget.FindAnyWidget("ContentParent");
20 m_PlayerContainer = new PlayerContainer(this, false);
21 m_PlayerContainer.SetPlayer(PlayerBase.Cast(GetGame().GetPlayer()));
22 m_Body.Insert(m_PlayerContainer);
23 m_ActiveIndex = 0;
25
26 m_UpIcon = m_RootWidget.FindAnyWidget("Up");
27 m_DownIcon = m_RootWidget.FindAnyWidget("Down");
28
29 //m_ContentParent.GetScript( m_ContentResize );
30
31 RecomputeOpenedContainers();
32 }
PlayerBase GetPlayer()
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
bool m_ProcessGridMovement
Definition RightArea.c:12
Widget m_DownIcon
Definition RightArea.c:8
Widget m_UpIcon
Definition RightArea.c:7
ScrollWidget m_ScrollWidget
Definition RightArea.c:6
ref PlayerContainer m_PlayerContainer
Definition RightArea.c:3
proto native CGame GetGame()

References GetGame(), GetPlayer(), m_DownIcon, m_PlayerContainer, m_ProcessGridMovement, m_RootWidget, m_ScrollWidget, and m_UpIcon.

Member Function Documentation

◆ CanTakeToInventory()

override bool RightArea::CanTakeToInventory ( )
inlineprotected

Definition at line 89 of file RightArea.c.

90 {
91 return false;
92 }

◆ CanTakeToInventoryEx()

override bool RightArea::CanTakeToInventoryEx ( EntityAI focusedEntity)
inlineprotected

Definition at line 94 of file RightArea.c.

95 {
96 return false;
97 }

◆ Combine()

override bool RightArea::Combine ( )
inlineprotected

Definition at line 54 of file RightArea.c.

55 {
56 return m_PlayerContainer.Combine();
57 }

References m_PlayerContainer.

◆ DraggingOverHeader()

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

Definition at line 39 of file RightArea.c.

40 {
41 m_PlayerContainer.DraggingOverHeader(w, x, y, receiver);
42 }
Icon x
Icon y

References m_PlayerContainer, x, and y.

◆ EquipItem()

override bool RightArea::EquipItem ( )
inlineprotected

Definition at line 64 of file RightArea.c.

65 {
66 return m_PlayerContainer.EquipItem();
67 }

References m_PlayerContainer.

◆ ExpandCollapseContainer()

override void RightArea::ExpandCollapseContainer ( )
inlineprotected

Definition at line 125 of file RightArea.c.

126 {
127 m_PlayerContainer.ExpandCollapseContainer();
128 }

References m_PlayerContainer.

◆ GetCurrentContainerBottomY()

float RightArea::GetCurrentContainerBottomY ( )
inlineprotected

Definition at line 239 of file RightArea.c.

240 {
241 float x, y;
242 GetMainWidget().Update();
243 GetMainWidget().GetScreenPos(x, y);
244
248 }
override float GetFocusedContainerHeight(bool contents=false)
override float GetFocusedContainerYScreenPos(bool contents=false)

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

Referenced by MoveUpDownIcons().

◆ GetCurrentContainerTopY()

float RightArea::GetCurrentContainerTopY ( )
inlineprotected

Definition at line 229 of file RightArea.c.

230 {
231 float x, y;
232 GetMainWidget().Update();
233 GetMainWidget().GetScreenPos(x, y);
235
236 return cont_screen_pos - y;
237 }

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

Referenced by MoveUpDownIcons().

◆ GetPlayerContainer()

PlayerContainer RightArea::GetPlayerContainer ( )
inlineprotected

Definition at line 34 of file RightArea.c.

35 {
36 return m_PlayerContainer;
37 }

References m_PlayerContainer.

◆ GetScrollWidget()

override ScrollWidget RightArea::GetScrollWidget ( )
inlineprotected

Definition at line 216 of file RightArea.c.

217 {
218 return m_ScrollWidget;
219 }

References m_ScrollWidget.

◆ HasEntityContainerVisible()

bool RightArea::HasEntityContainerVisible ( EntityAI entity)
inlineprotected

Definition at line 99 of file RightArea.c.

100 {
101 return m_PlayerContainer.HasEntityContainerVisible(entity);
102 }

References m_PlayerContainer.

◆ InspectItem()

override bool RightArea::InspectItem ( )
inlineprotected

Definition at line 74 of file RightArea.c.

75 {
76 return m_PlayerContainer.InspectItem();
77 }

References m_PlayerContainer.

◆ IsPlayerEquipmentActive()

bool RightArea::IsPlayerEquipmentActive ( )
inlineprotected

Definition at line 109 of file RightArea.c.

110 {
111 return m_PlayerContainer.IsPlayerEquipmentActive();
112 }

References m_PlayerContainer.

◆ MoveUpDownIcons()

void RightArea::MoveUpDownIcons ( )
inlineprotected

Definition at line 177 of file RightArea.c.

178 {
179 if (m_UpIcon && m_DownIcon)
180 {
181 m_UpIcon.Show(m_IsActive);
183 if (m_IsActive)
184 {
185 float x, y;
186 m_UpIcon.GetScreenSize(x, y);
187
189 m_UpIcon.SetPos(0, Math.Clamp(top_y, 0, 99999));
190
191#ifndef PLATFORM_CONSOLE
192 float x2, y2;
193 m_DownIcon.GetScreenSize(x2, y2);
195
196 float diff = bottom_y - (top_y + y);
197 if (diff < 0)
198 {
199 top_y += diff / 2;
200 bottom_y -= diff / 2;
201 }
202 m_DownIcon.SetPos(0, bottom_y);
203#endif
204 }
205 }
206 /*else
207 {
208 ErrorEx("up/down icons not present!");
209 }
210 #else
211 m_ScrollWidget.Update();
212 #endif*/
213
214 }
bool m_IsActive
Definition EnMath.c:7
float GetCurrentContainerBottomY()
Definition RightArea.c:239
float GetCurrentContainerTopY()
Definition RightArea.c:229
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 UpdateSelectionIcons().

◆ OnShow()

override void RightArea::OnShow ( )
inlineprotected

Definition at line 163 of file RightArea.c.

164 {
165 super.OnShow();
166 Refresh();
167 }
override void Refresh()
Definition RightArea.c:130

References Refresh().

◆ Refresh()

override void RightArea::Refresh ( )
inlineprotected

Definition at line 130 of file RightArea.c.

131 {
132 m_ScrollWidget.Update();
133 m_PlayerContainer.Refresh();
134 m_ShouldChangeSize = true;
135 }
bool m_ShouldChangeSize
Definition RightArea.c:11

References m_PlayerContainer, m_ScrollWidget, and m_ShouldChangeSize.

Referenced by OnShow(), SetSameLevelNextActive(), and SetSameLevelPreviousActive().

◆ Select()

override bool RightArea::Select ( )
inlineprotected

Definition at line 44 of file RightArea.c.

45 {
46 return m_PlayerContainer.Select();
47 }

References m_PlayerContainer.

◆ SelectItem()

override bool RightArea::SelectItem ( )
inlineprotected

Definition at line 49 of file RightArea.c.

50 {
51 return m_PlayerContainer.SelectItem();
52 }

References m_PlayerContainer.

◆ SetLayoutName()

override void RightArea::SetLayoutName ( )
inlineprotected

Definition at line 137 of file RightArea.c.

138 {
139#ifdef PLATFORM_CONSOLE
140 m_LayoutName = WidgetLayoutName.RightAreaXbox;
141#else
142 switch (InventoryMenu.GetWidthType())
143 {
144 case ScreenWidthType.NARROW:
145 m_LayoutName = WidgetLayoutName.RightAreaNarrow;
146 break;
147 case ScreenWidthType.MEDIUM:
148 m_LayoutName = WidgetLayoutName.RightAreaMedium;
149 break;
150 case ScreenWidthType.WIDE:
151 m_LayoutName = WidgetLayoutName.RightAreaWide;
152 break;
153 }
154#endif
155
156 }
ScreenWidthType
void InventoryMenu()
const string RightAreaWide
const string RightAreaNarrow
const string RightAreaMedium
const string RightAreaXbox

References InventoryMenu(), WidgetLayoutName::RightAreaMedium, WidgetLayoutName::RightAreaNarrow, WidgetLayoutName::RightAreaWide, and WidgetLayoutName::RightAreaXbox.

◆ SetParentWidget()

override void RightArea::SetParentWidget ( )
inlineprotected

Definition at line 158 of file RightArea.c.

159 {
160 m_ParentWidget = m_Parent.GetMainWidget().FindAnyWidget("RightPanel");
161 }
Widget m_Parent
Definition SizeToChild.c:86
Widget m_ParentWidget

References m_Parent, and m_ParentWidget.

◆ SetSameLevelNextActive()

override void RightArea::SetSameLevelNextActive ( )
inlineprotected

Definition at line 114 of file RightArea.c.

115 {
116 m_PlayerContainer.SetSameLevelNextActive();
117 Refresh();
118 }

References m_PlayerContainer, and Refresh().

◆ SetSameLevelPreviousActive()

override void RightArea::SetSameLevelPreviousActive ( )
inlineprotected

Definition at line 119 of file RightArea.c.

120 {
121 m_PlayerContainer.SetSameLevelPreviousActive();
122 Refresh();
123 }

References m_PlayerContainer, and Refresh().

◆ SplitItem()

override bool RightArea::SplitItem ( )
inlineprotected

Definition at line 59 of file RightArea.c.

60 {
61 return m_PlayerContainer.SplitItem();
62 }

References m_PlayerContainer.

◆ SwapItemsInOrder()

void RightArea::SwapItemsInOrder ( int slot1,
int slot2 )
inlineprotected

Definition at line 104 of file RightArea.c.

105 {
106 m_PlayerContainer.SwapItemsInOrder(slot1, slot2);
107 }

References m_PlayerContainer.

◆ TransferItem()

override bool RightArea::TransferItem ( )
inlineprotected

Definition at line 69 of file RightArea.c.

70 {
71 return m_PlayerContainer.TransferItem();
72 }

References m_PlayerContainer.

◆ TransferItemToVicinity()

override bool RightArea::TransferItemToVicinity ( )
inlineprotected

Definition at line 79 of file RightArea.c.

80 {
81 return m_PlayerContainer.TransferItemToVicinity();
82 }

References m_PlayerContainer.

◆ UnfocusGrid()

override void RightArea::UnfocusGrid ( )
inlineprotected

Definition at line 84 of file RightArea.c.

85 {
86 m_PlayerContainer.UnfocusGrid();
87 }

References m_PlayerContainer.

◆ UpdateInterval()

override void RightArea::UpdateInterval ( )
inlineprotected

Definition at line 169 of file RightArea.c.

170 {
171 super.UpdateInterval();
172 m_PlayerContainer.UpdateInterval();
173
174 CheckScrollbarVisibility();
175 }

References m_PlayerContainer.

◆ UpdateSelectionIcons()

override void RightArea::UpdateSelectionIcons ( )
inlineprotected

Definition at line 221 of file RightArea.c.

222 {
223#ifdef PLATFORM_CONSOLE
224 ScrollToActiveContainer();
225#endif
227 }
void MoveUpDownIcons()
Definition RightArea.c:177

References MoveUpDownIcons().

Member Data Documentation

◆ m_ContentParent

Widget RightArea::m_ContentParent
protected

Definition at line 4 of file RightArea.c.

◆ m_ContentResize

ref SizeToChild RightArea::m_ContentResize
protected

Definition at line 10 of file RightArea.c.

◆ m_DownIcon

Widget RightArea::m_DownIcon
protected

Definition at line 8 of file RightArea.c.

Referenced by MoveUpDownIcons(), and RightArea().

◆ m_PlayerContainer

◆ m_ProcessGridMovement

bool RightArea::m_ProcessGridMovement
protected

Definition at line 12 of file RightArea.c.

Referenced by RightArea().

◆ m_ScrollWidget

ScrollWidget RightArea::m_ScrollWidget
protected

Definition at line 6 of file RightArea.c.

Referenced by GetScrollWidget(), Refresh(), and RightArea().

◆ m_ShouldChangeSize

bool RightArea::m_ShouldChangeSize = true
protected

Definition at line 11 of file RightArea.c.

Referenced by Refresh().

◆ m_UpIcon

Widget RightArea::m_UpIcon
protected

Definition at line 7 of file RightArea.c.

Referenced by MoveUpDownIcons(), and RightArea().


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