File tree Expand file tree Collapse file tree 3 files changed +75
-0
lines changed Expand file tree Collapse file tree 3 files changed +75
-0
lines changed Original file line number Diff line number Diff line change 2
2
#define CF_MODULE_CONFIG
3
3
//#define CF_MODULE_PERMISSIONS
4
4
5
+ #define CF_GHOSTICONS_V2
6
+
5
7
#ifdef CF_MODULE_LAYOUT_BINDING
6
8
#define CF_MODEL_VIEW_BINDING
7
9
#endif
Original file line number Diff line number Diff line change
1
+ modded class AttachmentCategoriesContainer
2
+ {
3
+ override void LoadAttachmentCategoriesIcon (SlotsContainer items_cont , string icon_name , int slot_number )
4
+ {
5
+ SlotsIcon icon = items_cont .GetSlotIcon (slot_number );
6
+ ImageWidget image_widget = icon .GetGhostSlot ();
7
+ image_widget .Show (true);
8
+
9
+ string path = "CfgSlots" + " Slot_" + InventorySlots .GetSlotName (icon .GetSlotID ());
10
+
11
+ if ( GetGame ().ConfigIsExisting ( path + " modGhostIcon" ) && GetGame ().ConfigGetText ( path + " modGhostIcon" , icon_name ) && icon_name != "" )
12
+ {
13
+ image_widget .LoadImageFile (0 , icon_name );
14
+
15
+ if (m_Body .Count () > (slot_number + 2 ))
16
+ {
17
+ ClosableContainer c = ClosableContainer .Cast (m_Body .Get (slot_number + 2 ));
18
+ icon .GetRadialIconPanel ().Show (true);
19
+ if (c && c .IsOpened ())
20
+ {
21
+ icon .GetRadialIconClosed ().Show (false);
22
+ icon .GetRadialIcon ().Show (true);
23
+ }
24
+ else
25
+ {
26
+ icon .GetRadialIcon ().Show (false);
27
+ icon .GetRadialIconClosed ().Show (true);
28
+ }
29
+ }
30
+ } else
31
+ {
32
+ super .LoadAttachmentCategoriesIcon (items_cont , icon_name , slot_number );
33
+ }
34
+ }
35
+ };
Original file line number Diff line number Diff line change
1
+ modded class Attachments
2
+ {
3
+ override void InitAttachmentGrid (int att_row_index )
4
+ {
5
+ super .InitAttachmentGrid (att_row_index );
6
+
7
+ for (int i = 0 ; i < m_AttachmentSlotNames .Count (); i ++ )
8
+ {
9
+ SlotsIcon icon2 = SlotsContainer .Cast (m_AttachmentsContainer .Get ((i / ITEMS_IN_ROW ))).GetSlotIcon (i % ITEMS_IN_ROW );
10
+ WidgetEventHandler .GetInstance ().RegisterOnDoubleClick (icon2 .GetPanelWidget (), m_Parent , "DoubleClick" );
11
+
12
+ string path = "CfgSlots" + " Slot_" + m_AttachmentSlotNames [i ];
13
+
14
+ //Show different magazine icon for firearms and pistols
15
+ if (m_AttachmentSlotNames [i ] == "magazine" )
16
+ {
17
+ if (!m_Entity .IsInherited (Pistol_Base ))
18
+ path = "CfgSlots" + " Slot_" + "magazine2" ;
19
+ }
20
+
21
+ string icon_name = "" ;
22
+ if (GetGame ().ConfigIsExisting (path + " modGhostIcon" ) && GetGame ().ConfigGetText (path + " modGhostIcon" , icon_name ) && icon_name != "" )
23
+ {
24
+ icon2 .GetGhostSlot ().LoadImageFile (0 , icon_name );
25
+
26
+ int slot_id = InventorySlots .GetSlotIdFromString (m_AttachmentSlotNames [i ]);
27
+ m_AttachmentSlots .Insert (slot_id , icon2 );
28
+ icon2 .SetSlotID (slot_id );
29
+
30
+ EntityAI item = m_Entity .GetInventory ().FindAttachment (slot_id );
31
+ if (item )
32
+ AttachmentAdded (item , m_AttachmentSlotNames [i ], m_Entity );
33
+ else
34
+ icon2 .Clear ();
35
+ }
36
+ }
37
+ }
38
+ };
You can’t perform that action at this time.
0 commit comments