764 {
766 {
767 ItemPreviewWidget iw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
768 if (!iw)
769 {
770 string name = w.GetName();
771 name.Replace(
"PanelWidget",
"Render");
772 iw = ItemPreviewWidget.Cast(w.FindAnyWidget(
name));
773 }
774
775 if (!iw)
776 iw = ItemPreviewWidget.Cast(w);
777
778 SlotsIcon icon;
779 w.GetUserData(icon);
780
781 if (icon &&
m_Entity.GetInventory().GetSlotLock(iw.GetUserID()))
782 return;
783
785 return;
786
788 if (item)
789 {
790 if (!item.GetInventory().CanRemoveEntity())
791 return;
792
794 if (controlledPlayer.GetInventory().HasEntityInInventory(item) && controlledPlayer.GetHumanInventory().CanAddEntityInHands(item))
795 {
796 controlledPlayer.PredictiveTakeEntityToHands(item);
797 }
798 else
799 {
800 if (controlledPlayer.GetInventory().CanAddEntityToInventory(item) && item.GetInventory().CanRemoveEntity())
801 {
802 if (item.GetTargetQuantityMax() < item.GetQuantity())
803 item.SplitIntoStackMaxClient(controlledPlayer, -1);
804 else
806 }
807 else
808 {
809 if (controlledPlayer.GetHumanInventory().CanAddEntityInHands(item))
810 {
811 if (item.GetTargetQuantityMax() < item.GetQuantity())
812 item.SplitIntoStackMaxHandsClient(controlledPlayer);
813 else
814 controlledPlayer.PredictiveTakeEntityToHands(item);
815 }
816 }
817 }
818
819 HideOwnedTooltip();
820
822 name.Replace(
"PanelWidget",
"Temperature");
823 w.FindAnyWidget(
name).Show(
false);
824 }
825 }
826 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
proto native CGame GetGame()