332 {
334 {
335 if( w == null )
336 {
337 return;
338 }
339 ItemPreviewWidget iw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
340 if( !iw )
341 {
342 string name = w.GetName();
343 name.Replace(
"PanelWidget",
"Render" );
344 iw = ItemPreviewWidget.Cast( w.FindAnyWidget(
name ) );
345 }
346
347 if( !iw )
348 {
349 iw = ItemPreviewWidget.Cast( w );
350 }
351
353 if( !item )
354 {
355 return;
356 }
357
359 {
360 return;
361 }
362
363 if(
g_Game.GetPlayer().GetInventory().HasInventoryReservation( item, null ) )
364 {
365 return;
366 }
367
368 if( !item.GetInventory().CanRemoveEntity() )
369 return;
370
371 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer() );
372
373 if ( player.GetInventory().HasEntityInInventory( item ) &&
g_Game.GetPlayer().GetHumanInventory().CanAddEntityInHands( item ) )
374 {
375 player.PredictiveTakeEntityToHands( item );
376 }
377 else
378 {
379 InventoryLocation dst = new InventoryLocation;
381 if( dst.
IsValid() && player.GetInventory().LocationCanAddEntity( dst ) )
382 {
383 SplitItemUtils.TakeOrSplitToInventoryLocation( player, dst );
384 }
385 }
386
387 HideOwnedTooltip();
389
391 if( menu )
392 {
393 menu.RefreshQuickbar();
394 }
395 }
396 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
proto native bool IsValid()
verify current set inventory location
override bool IsTakeable()
void PrepareOwnedTooltipAfterItemTransferClick()