35 {
38
39 #ifndef PLATFORM_CONSOLE
40 RightArea rightArea = RightArea.Cast(
GetParent());
41 if (rightArea)
42 {
45 }
46 #endif
47
54 WidgetEventHandler.GetInstance().RegisterOnChildAdd( m_MainWidget, this, "OnChildAdd" );
55 WidgetEventHandler.GetInstance().RegisterOnChildRemove( m_MainWidget, this, "OnChildRemove" );
56
57
58 string config_path_ghosts_slots = "CfgVehicles SurvivorBase InventoryEquipment playerSlots";
59 ref array<string> player_ghosts_slots = new array<string>;
61
62 for ( int i = 0; i < player_ghosts_slots.Count(); i++ )
63 {
64 string slot_name = player_ghosts_slots.Get ( i );
65 string path =
"CfgSlots" +
" " + slot_name;
66
68 {
69 string icon_name;
71 int slot_number = i;
73
74
77 {
78 if( row < ( player_ghosts_slots.Count() /
ITEMS_IN_ROW ) )
80 else
82 }
83
85
86 icon.GetMainWidget().Show( true );
88
89 WidgetEventHandler.GetInstance().RegisterOnDoubleClick( icon.
GetPanelWidget(),
this,
"DoubleClick" );
90
91
92 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.
GetPanelWidget(),
this,
"OnDropReceivedFromGhostArea" );
93 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.
GetGhostSlot(),
this,
"OnDropReceivedFromGhostArea" );
94 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.
GetGhostSlot(),
this,
"DraggingOver" );
95 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.
GetPanelWidget(),
this,
"DraggingOver" );
96 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( icon.
GetPanelWidget(),
this,
"MouseClick" );
97
98 icon.
GetGhostSlot().LoadImageFile( 0, StaticGUIUtils.VerifyIconImageString(StaticGUIUtils.IMAGESETGROUP_INVENTORY,icon_name) );
99
100
102 int slot_id = InventorySlots.GetSlotIdFromString( slot_name );
106 }
107 }
109
110 RecomputeOpenedContainers();
111 }
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
ref CollapsibleHeader m_CollapsibleHeader
override Header GetHeader()
override void SetHeader(Header header)
SlotsIcon GetSlotsIcon(int row, int column)
ref AttachmentsGroupContainer m_PlayerAttachmentsContainer
void AddSlotsContainer(int row_count)
ref map< int, SlotsIcon > m_InventorySlots
void SetSlotID(int slot_ID)
void SetSlotDisplayName(string text)
ImageWidget GetGhostSlot()
proto native CGame GetGame()