Dayz Explorer 1.29.162510
Loading...
Searching...
No Matches
attachmentcategoriesslotscontainer.c
Go to the documentation of this file.
1class AttachmentCategoriesSlotsContainer: Container
2{
3 ref SlotsContainer m_ItemsCont;
4
5 void AttachmentCategoriesSlotsContainer( LayoutHolder parent, int index )
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" );
17 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( m_ItemsCont.GetSlotIcon( k ).GetPanelWidget(), m_Parent, "DraggingOverHeader" );
18
19 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( m_ItemsCont.GetSlotIcon( k ).GetMainWidget(), m_Parent, "MouseClick" );
20 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( m_ItemsCont.GetSlotIcon( k ).GetPanelWidget(), m_Parent, "MouseClick" );
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
46 SlotsContainer GetSlotsContainer()
47 {
48 return m_ItemsCont;
49 }
50
51 override EntityAI GetFocusedItem()
52 {
53 return m_ItemsCont.GetFocusedSlotsIcon().GetRender().GetItem();
54 }
55
56 int GetParentID()
57 {
58 return m_ItemsCont.GetMainWidget().GetUserID();
59 }
60
61 int GetFocusedID()
62 {
63 return m_ItemsCont.GetFocusedSlotsIcon().GetMainWidget().GetUserID();
64 }
65
66 void ExpandCollapseContainer( bool expand )
67 {
68 m_ItemsCont.GetFocusedSlotsIcon().GetRadialIcon().Show( expand );
69 m_ItemsCont.GetFocusedSlotsIcon().GetRadialIconClosed().Show( !expand );
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
127 override bool IsItemWithQuantityActive()
128 {
129 return false;
130 }
131
132 string GetAttachmentCategory( string config_path_attachment_categories, int i )
133 {
134 string attachment_category;
135 g_Game.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 g_Game.ConfigGetText(icon_path, icon_name);
144 return icon_name;
145 }
146}
const int ITEMS_IN_ROW
Definition attachments.c:1
Entity m_Parent
override bool Combine()
override void SetLayoutName()
override EntityAI GetFocusedItem()
override bool Select()
override bool IsItemActive()
override bool IsDisplayable()
override bool SelectItem()
override bool TransferItemToVicinity()
override bool TransferItem()
override bool IsItemWithQuantityActive()
override bool CanCombineAmmo()
override bool IsEmpty()
void RegisterOnMouseLeave(Widget w, Managed eventHandler, string functionName)
void RegisterOnDraggingOver(Widget w, Managed eventHandler, string functionName)
static WidgetEventHandler GetInstance()
void RegisterOnMouseEnter(Widget w, Managed eventHandler, string functionName)
void RegisterOnMouseButtonDown(Widget w, Managed eventHandler, string functionName)
DayZGame g_Game
Definition dayzgame.c:3942