789 {
791 {
792 ItemPreviewWidget iw = ItemPreviewWidget.Cast(w.FindAnyWidget("Render"));
793 if (!iw)
794 {
795 string name = w.GetName();
796 name.Replace(
"PanelWidget",
"Render");
797 iw = ItemPreviewWidget.Cast(w.FindAnyWidget(
name));
798 }
799
800 if (!iw)
801 iw = ItemPreviewWidget.Cast(w);
802
803 SlotsIcon icon;
804 w.GetUserData(icon);
805
807 return;
808
810 return;
811
813 if (item)
814 {
815 if (!item.GetInventory().CanRemoveEntity())
816 return;
817
818 PlayerBase controlledPlayer = PlayerBase.Cast(
g_Game.GetPlayer());
819 if (controlledPlayer.GetInventory().HasEntityInInventory(item) && controlledPlayer.GetHumanInventory().CanAddEntityInHands(item))
820 {
821 controlledPlayer.PredictiveTakeEntityToHands(item);
822 }
823 else
824 {
825 if (controlledPlayer.GetInventory().CanAddEntityToInventory(item) && item.GetInventory().CanRemoveEntity())
826 {
827 if (item.GetTargetQuantityMax() < item.GetQuantity())
828 item.SplitIntoStackMaxClient(controlledPlayer, -1);
829 else
831 }
832 else
833 {
834 if (controlledPlayer.GetHumanInventory().CanAddEntityInHands(item))
835 {
836 if (item.GetTargetQuantityMax() < item.GetQuantity())
837 item.SplitIntoStackMaxHandsClient(controlledPlayer);
838 else
839 controlledPlayer.PredictiveTakeEntityToHands(item);
840 }
841 }
842 }
843
844 HideOwnedTooltip();
845
847 name.Replace(
"PanelWidget",
"Temperature");
848 w.FindAnyWidget(
name).Show(
false);
849 }
850 }
851 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
proto native GameInventory GetInventory()
proto native bool GetSlotLock(int slot)