694 {
696 {
698 if( w == NULL || player.GetInventory().IsInventoryLocked() )
699 {
700 return;
701 }
702 ItemPreviewWidget iw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
703 if( !iw )
704 {
705 string name = w.GetName();
706 name.Replace(
"PanelWidget",
"Render" );
707 iw = ItemPreviewWidget.Cast( w.FindAnyWidget(
name ) );
708 }
709
710 if( !iw )
711 {
712 iw = ItemPreviewWidget.Cast( w );
713 }
714
716
717 if( !item )
718 {
719 return;
720 }
721
722 SlotsIcon icon;
723 iw.GetUserData(icon);
724
726 {
727 return;
728 }
729
730 if( !item.GetInventory().CanRemoveEntity() || !player.CanManipulateInventory() )
731 return;
732
733 if( player.GetInventory().HasEntityInInventory( item ) && player.GetHumanInventory().CanAddEntityInHands( item ) )
734 {
735 player.PredictiveTakeEntityToHands( item );
736 }
737 else
738 {
739 if(player.GetInventory().CanAddEntityToInventory( item ) && item.GetInventory().CanRemoveEntity())
740 {
742 }
743 else
744 {
745 if( player.GetHumanInventory().CanAddEntityInHands( item ) )
746 {
747 player.PredictiveTakeEntityToHands( item );
748 }
749 }
750 }
751
752 HideOwnedTooltip();
753
755 name.Replace(
"PanelWidget",
"Temperature" );
756 w.FindAnyWidget(
name ).Show(
false );
757 }
758 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
FindInventoryLocationType
flags for searching locations in inventory
proto native CGame GetGame()