DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
AttachmentCategoriesSlotsContainer.c
Go to the documentation of this file.
2{
4
6 {
7 m_ItemsCont = new SlotsContainer(this, null);
8 m_Body.Insert( m_ItemsCont );
9 m_ItemsCont.GetMainWidget().SetUserID( index );
10
11 for ( int k = 0; k < ITEMS_IN_ROW; k++ )
12 {
13 //WidgetEventHandler.GetInstance().RegisterOnDropReceived( m_ItemsCont.GetSlotIcon( k ).GetMainWidget(), m_Parent, "OnDropReceivedFromHeader" );
14 //WidgetEventHandler.GetInstance().RegisterOnDropReceived( m_ItemsCont.GetSlotIcon( k ).GetPanelWidget(), m_Parent, "OnDropReceivedFromHeader" );
15
16 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( m_ItemsCont.GetSlotIcon( k ).GetMainWidget(), m_Parent, "DraggingOverHeader" );
18
21
22 WidgetEventHandler.GetInstance().RegisterOnMouseEnter( m_ItemsCont.GetSlotIcon( k ).GetMainWidget(), m_ItemsCont.GetSlotIcon( k ), "MouseEnterGhostSlot" );
23 WidgetEventHandler.GetInstance().RegisterOnMouseLeave( m_ItemsCont.GetSlotIcon( k ).GetMainWidget(), m_ItemsCont.GetSlotIcon( k ), "MouseLeaveGhostSlot" );
24
25 m_ItemsCont.GetSlotIcon( k ).GetMainWidget().SetUserID( k );
26 m_ItemsCont.GetSlotIcon( k ).GetPanelWidget().SetUserID( k );
27 }
28 }
29
30 override bool IsDisplayable()
31 {
32 for(int i = 0; i < m_Body.Count(); i++)
33 {
34 LayoutHolder c = m_Body[i];
35 if( c && c.IsDisplayable())
36 return true;
37 }
38 return false;
39 }
40
41 override void SetLayoutName()
42 {
43 m_LayoutName = WidgetLayoutName.Container;
44 }
45
47 {
48 return m_ItemsCont;
49 }
50
52 {
54 }
55
57 {
58 return m_ItemsCont.GetMainWidget().GetUserID();
59 }
60
62 {
63 return m_ItemsCont.GetFocusedSlotsIcon().GetMainWidget().GetUserID();
64 }
65
66 void ExpandCollapseContainer( bool expand )
67 {
70 }
71
72 override bool SelectItem()
73 {
74 return false;
75 }
76
77 override bool Select()
78 {
79 return false;
80 }
81
82 override bool Combine()
83 {
84 return false;
85 }
86
87 override bool TransferItemToVicinity()
88 {
89 return false;
90 }
91
92 override bool TransferItem()
93 {
94 return false;
95 }
96
97 override bool SplitItem()
98 {
99 return false;
100 }
101
102 override bool EquipItem()
103 {
104 return false;
105 }
106
107 override bool CanCombine()
108 {
109 return false;
110 }
111
112 override bool CanCombineAmmo()
113 {
114 return false;
115 }
116
117 override bool IsEmpty()
118 {
119 return false;
120 }
121
122 override bool IsItemActive()
123 {
124 return false;
125 }
126
128 {
129 return false;
130 }
131
132 string GetAttachmentCategory( string config_path_attachment_categories, int i )
133 {
134 string attachment_category;
135 GetGame().ConfigGetChildName(config_path_attachment_categories, i, attachment_category);
136 return attachment_category;
137 }
138
139 string GetIconName( string config_path_attachment_categories, string attachment_category )
140 {
141 string icon_path = config_path_attachment_categories+ " " + attachment_category + " icon";
142 string icon_name;
143 GetGame().ConfigGetText(icon_path, icon_name);
144 return icon_name;
145 }
146
147 /*override void Refresh()
148 {
149 super.Refresh();
150 Print("DbgTest | Refresh");
151
152 CollapsibleContainer cont = CollapsibleContainer.Cast(m_Parent);
153 if (cont)
154 {
155 bool b1 = m_ItemsCont.VerifySlotsIconVisibility();
156 Print("DbgTest | Refresh | b1: " + b1);
157 cont.SetCollapsibleHeaderArrowState(!b1);
158 }
159 }*/
160}
const int ITEMS_IN_ROW
Definition Attachments.c:1
protected Widget m_Parent
Definition SizeToChild.c:92
string GetIconName(string config_path_attachment_categories, string attachment_category)
void AttachmentCategoriesSlotsContainer(LayoutHolder parent, int index)
string GetAttachmentCategory(string config_path_attachment_categories, int i)
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native EntityAI GetItem()
override SlotsIcon GetFocusedSlotsIcon()
SlotsIcon GetSlotIcon(int index)
Widget GetRadialIconClosed()
Definition SlotsIcon.c:300
Widget GetRadialIcon()
Definition SlotsIcon.c:305
ItemPreviewWidget GetRender()
Definition SlotsIcon.c:230
Widget GetPanelWidget()
Definition SlotsIcon.c:205
void RegisterOnMouseButtonDown(Widget w, Managed eventHandler, string functionName)
static WidgetEventHandler GetInstance()
void RegisterOnMouseEnter(Widget w, Managed eventHandler, string functionName)
void RegisterOnDraggingOver(Widget w, Managed eventHandler, string functionName)
void RegisterOnMouseLeave(Widget w, Managed eventHandler, string functionName)
const string Container
proto native CGame GetGame()