378 {
380 {
382
383 if( w == null ||
m_Player.GetInventory().IsInventoryLocked() )
384 {
385 return;
386 }
387 ItemPreviewWidget iw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
388 if( !iw )
389 {
390 string name = w.GetName();
391 name.Replace(
"PanelWidget",
"Render" );
392 iw = ItemPreviewWidget.Cast( w.FindAnyWidget(
name ) );
393 }
394 if( !iw )
395 {
396 iw = ItemPreviewWidget.Cast( w );
397 }
398
400
401 if( !item )
402 {
403 return;
404 }
405
406 SlotsIcon icon;
407 iw.GetUserData(icon);
408
410 {
411 return;
412 }
413
414 if( !item.GetInventory().CanRemoveEntity() )
415 return;
416
417 if ( player.GetInventory().HasEntityInInventory( item ) && player.GetHumanInventory().CanAddEntityInHands( item ) )
418 {
419 player.PredictiveTakeEntityToHands( item );
420 }
421 else
422 {
423 if (player.GetInventory().CanAddEntityToInventory( item ) && item.GetInventory().CanRemoveEntity())
424 {
425 if( item.GetTargetQuantityMax() < item.GetQuantity() )
426 item.SplitIntoStackMaxClient( player, -1 );
427 else
429 }
430 else
431 {
432 if( item.GetTargetQuantityMax() < item.GetQuantity() )
433 item.SplitIntoStackMaxHandsClient( player );
434 else
435 player.PredictiveTakeEntityToHands( item );
436 }
437 }
439 HideOwnedTooltip();
440
442 if ( menu )
443 {
444 menu.RefreshQuickbar();
445 }
446 }
447 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
void ToggleWidget(Widget w)
proto native CGame GetGame()