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

Protected Member Functions

void HandsArea (LayoutHolder parent)
 
bool IsSwapActive ()
 
bool IsCombineActive ()
 
override ScrollWidget GetScrollWidget ()
 
override void UpdateSelectionIcons ()
 
override void UpdateInterval ()
 
override void SetLayoutName ()
 
override void SetParentWidget ()
 
override void OnShow ()
 
override void Refresh ()
 
override void SetSameLevelNextActive ()
 
override void SetSameLevelPreviousActive ()
 
void DraggingOverHandsPanel (Widget w, int x, int y, Widget receiver)
 
void OnHandsPanelDropReceived (Widget w, int x, int y, Widget receiver)
 

Protected Attributes

ScrollWidget m_Scroller
 
ref HandsContainer m_HandsContainer
 
ref SizeToChild m_HandsResizer
 
bool m_ShouldChangeSize = true
 

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

Constructor & Destructor Documentation

◆ HandsArea()

void HandsArea::HandsArea ( LayoutHolder parent)
inlineprotected

Definition at line 9 of file HandsArea.c.

10 {
12 m_Body.Insert(m_HandsContainer);
13
14 if (m_ImmedUpdate)
15 m_MainWidget.Update();
16
19 RecomputeOpenedContainers();
20 }
Widget m_ParentWidget
ScrollWidget m_Scroller
Definition HandsArea.c:3
ref SizeToChild m_HandsResizer
Definition HandsArea.c:5
ref HandsContainer m_HandsContainer
Definition HandsArea.c:4

References m_HandsContainer, m_HandsResizer, m_ParentWidget, and m_Scroller.

Member Function Documentation

◆ DraggingOverHandsPanel()

void HandsArea::DraggingOverHandsPanel ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected

Definition at line 114 of file HandsArea.c.

115 {
116 if (w == NULL)
117 return;
118
119 ItemPreviewWidget ipw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
120
121 if (!ipw)
122 {
123 string name = w.GetName();
124 name.Replace("PanelWidget", "Render");
125 ipw = ItemPreviewWidget.Cast(w.FindAnyWidget(name));
126 }
127
128 if (!ipw)
129 ipw = ItemPreviewWidget.Cast(w);
130
131 if (!ipw || !ipw.IsInherited(ItemPreviewWidget))
132 return;
133
134 if (ipw.GetItem() && GetGame().GetPlayer().GetHumanInventory().CanAddEntityIntoHands(ipw.GetItem()))
135 {
137 ItemManager.GetInstance().HideDropzones();
138 ItemManager.GetInstance().GetCenterDropzone().SetAlpha(1);
139 }
140 else
141 {
143 ItemManager.GetInstance().HideDropzones();
144 ItemManager.GetInstance().GetCenterDropzone().SetAlpha(1);
145 }
146 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerBase GetPlayer()
static int GREEN_COLOR
static int RED_COLOR
static ColorManager GetInstance()
static ItemManager GetInstance()
proto native CGame GetGame()

References GetGame(), ColorManager::GetInstance(), ItemManager::GetInstance(), GetPlayer(), ColorManager::GREEN_COLOR, name, and ColorManager::RED_COLOR.

◆ GetScrollWidget()

override ScrollWidget HandsArea::GetScrollWidget ( )
inlineprotected

Definition at line 42 of file HandsArea.c.

43 {
44 return m_Scroller;
45 }

References m_Scroller.

◆ IsCombineActive()

bool HandsArea::IsCombineActive ( )
inlineprotected

Definition at line 32 of file HandsArea.c.

33 {
34 Widget combine_cursor = m_MainWidget.FindAnyWidget("CombineCursor");
35
37 return combine_cursor.IsVisible();
38 else
39 return false;
40 }

◆ IsSwapActive()

bool HandsArea::IsSwapActive ( )
inlineprotected

Definition at line 22 of file HandsArea.c.

23 {
24 Widget swap_cursor = m_MainWidget.FindAnyWidget("SwapCursor");
25
26 if (swap_cursor)
27 return swap_cursor.IsVisible();
28 else
29 return false;
30 }

◆ OnHandsPanelDropReceived()

void HandsArea::OnHandsPanelDropReceived ( Widget w,
int x,
int y,
Widget receiver )
inlineprotected

Definition at line 148 of file HandsArea.c.

149 {
150 ItemPreviewWidget ipw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
151 if (!ipw)
152 {
153 string name = w.GetName();
154 name.Replace("PanelWidget", "Render");
155 ipw = ItemPreviewWidget.Cast(w.FindAnyWidget(name));
156 }
157
158 if (!ipw)
159 ipw = ItemPreviewWidget.Cast(w);
160
161 if (!ipw || !ipw.GetItem() || !ipw.IsInherited(ItemPreviewWidget))
162 return;
163
164 if (!ipw.GetItem().GetInventory().CanRemoveEntity())
165 return;
166
167 if (GetGame().GetPlayer().GetHumanInventory().CanAddEntityIntoHands(ipw.GetItem()))
168 {
169 ItemBase item_base = ItemBase.Cast(ipw.GetItem());
170 float stackable = item_base.GetTargetQuantityMax(-1);
171
172 if (stackable == 0 || item_base.GetQuantity() <= stackable)
173 GetGame().GetPlayer().PredictiveTakeEntityToHands(item_base);
174 else if (stackable != 0 && stackable <= item_base.GetQuantity())
175 item_base.SplitIntoStackMaxHandsClient(PlayerBase.Cast(GetGame().GetPlayer()));
176 }
177 }

References GetGame(), GetPlayer(), and name.

◆ OnShow()

override void HandsArea::OnShow ( )
inlineprotected

Definition at line 89 of file HandsArea.c.

90 {
91 super.OnShow();
92 m_HandsContainer.OnShow();
93 }

References m_HandsContainer.

◆ Refresh()

override void HandsArea::Refresh ( )
inlineprotected

Definition at line 95 of file HandsArea.c.

96 {
98 m_ShouldChangeSize = true;
99 }
bool m_ShouldChangeSize
Definition HandsArea.c:7
override void UpdateSelectionIcons()
Definition HandsArea.c:47

References m_ShouldChangeSize, and UpdateSelectionIcons().

Referenced by SetSameLevelNextActive(), and SetSameLevelPreviousActive().

◆ SetLayoutName()

override void HandsArea::SetLayoutName ( )
inlineprotected

Definition at line 79 of file HandsArea.c.

80 {
81 m_LayoutName = WidgetLayoutName.HandsArea;
82 }
const string HandsArea

References WidgetLayoutName::HandsArea.

◆ SetParentWidget()

override void HandsArea::SetParentWidget ( )
inlineprotected

Definition at line 84 of file HandsArea.c.

85 {
86 m_ParentWidget = m_Parent.GetMainWidget().FindAnyWidget("HandsPanel");
87 }
Widget m_Parent
Definition SizeToChild.c:86

References m_Parent, and m_ParentWidget.

◆ SetSameLevelNextActive()

override void HandsArea::SetSameLevelNextActive ( )
inlineprotected

Definition at line 101 of file HandsArea.c.

102 {
103 super.SetSameLevelNextActive();
104
105 Refresh();
106 }
override void Refresh()
Definition HandsArea.c:95

References Refresh().

◆ SetSameLevelPreviousActive()

override void HandsArea::SetSameLevelPreviousActive ( )
inlineprotected

Definition at line 107 of file HandsArea.c.

108 {
109 super.SetSameLevelPreviousActive();
110
111 Refresh();
112 }

References Refresh().

◆ UpdateInterval()

override void HandsArea::UpdateInterval ( )
inlineprotected

Definition at line 54 of file HandsArea.c.

55 {
56 if (!m_Scroller.IsScrollbarVisible())
57 m_Scroller.VScrollToPos01(0.0);
58 else if (m_Scroller.GetVScrollPos01() > 1.0)
59 m_Scroller.VScrollToPos01(1.0);
60 m_HandsContainer.UpdateInterval();
61
62 float x, y;
63 float x2, y2;
64 m_Scroller.GetScreenSize(x, y);
65 m_MainWidget.GetScreenSize(x2, y2);
66 if (y2 != y)
67 m_ShouldChangeSize = true;
68
69 bool changed_size;
70 if (m_ShouldChangeSize && m_HandsResizer.ResizeParentToChild(changed_size, InventoryMenu.GetHeight() * 0.5))
71 m_Scroller.SetAlpha(0.3921);
72 else
73 m_Scroller.SetAlpha(0);
74
75 if (changed_size)
76 m_ShouldChangeSize = false;
77 }
Icon x
Icon y
void InventoryMenu()

References InventoryMenu(), m_HandsContainer, m_HandsResizer, m_Scroller, m_ShouldChangeSize, x, and y.

◆ UpdateSelectionIcons()

override void HandsArea::UpdateSelectionIcons ( )
inlineprotected

Definition at line 47 of file HandsArea.c.

48 {
49#ifdef PLATFORM_CONSOLE
50 ScrollToActiveContainer();
51#endif
52 }

Referenced by Refresh().

Member Data Documentation

◆ m_HandsContainer

ref HandsContainer HandsArea::m_HandsContainer
protected

Definition at line 4 of file HandsArea.c.

Referenced by HandsArea(), OnShow(), and UpdateInterval().

◆ m_HandsResizer

ref SizeToChild HandsArea::m_HandsResizer
protected

Definition at line 5 of file HandsArea.c.

Referenced by HandsArea(), and UpdateInterval().

◆ m_Scroller

ScrollWidget HandsArea::m_Scroller
protected

Definition at line 3 of file HandsArea.c.

Referenced by GetScrollWidget(), HandsArea(), and UpdateInterval().

◆ m_ShouldChangeSize

bool HandsArea::m_ShouldChangeSize = true
protected

Definition at line 7 of file HandsArea.c.

Referenced by Refresh(), and UpdateInterval().


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