125 {
126 int slot = InventorySlots.GetSlotIdFromString( slot_name );
128
129 if( icon )
130 {
132 m_Player.GetOnAttachmentReleaseLock().Invoke(item, slot);
133
135
137 {
139 int sort_index =
Inventory.GetPlayerAttachmentIndex( slot );
140 int current_sort = 9999;
141 if( GetFocusedContainer() )
142 current_sort = GetFocusedContainer().GetRootWidget().GetSort();
143
144 if( item.GetSlotsCountCorrect() > 0 )
145 {
146 ContainerWithCargoAndAttachments iwca = new ContainerWithCargoAndAttachments( this, sort_index );
147 iwca.SetEntity( item );
148 iwca.SetSlotIcon( icon );
149 WidgetEventHandler.GetInstance().RegisterOnMouseButtonUp( icon.
GetPanelWidget(),
this,
"ToggleWidget" );
150
151 if( iwca.IsDisplayable() )
152 {
154 }
156 RecomputeOpenedContainers();
158 }
159 else if( item.GetInventory().GetCargo() )
160 {
161 ContainerWithCargo iwc = new ContainerWithCargo( this, sort_index );
162 iwc.SetEntity( item );
163 iwc.SetSlotIcon( icon );
164 iwc.UpdateInterval();
165 WidgetEventHandler.GetInstance().RegisterOnMouseButtonUp( icon.
GetPanelWidget(),
this,
"ToggleWidget" );
167 RecomputeOpenedContainers();
168 if( iwc.IsDisplayable() )
170
172 }
173 }
174
176 string config = "CfgVehicles " + item.GetType() + " GUIInventoryAttachmentsProps";
178 {
179 bool show_radial_icon = ( item.GetInventory().GetCargo() || item.GetSlotsCountCorrect() > 0 ) && !
GetGame().
ConfigIsExisting( config );
181
182 rip.Show( show_radial_icon );
183 SetOpenForSlotIcon(conta.
IsOpened(),icon);
184 }
185 }
186 UpdateSelectionIcons();
187 }
void Inventory(LayoutHolder parent)
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto native bool ConfigIsExisting(string path)
void ClosableContainer(LayoutHolder parent, int sort=-1)
ref map< int, SlotsIcon > m_InventorySlots
ref map< EntityAI, ref Container > m_ShowedItems
void Init(EntityAI obj, bool reservation=false)
Widget GetRadialIconPanel()
proto native CGame GetGame()