556 {
558 if (!item)
559 {
560 return;
561 }
562
563 int idx = 0;
564 int c_x, c_y;
565
567 CargoBase target_cargo;
568
569 target_entity = cargo.GetEntity();
570 if (target_entity)
571 {
572 target_cargo = target_entity.GetInventory().GetCargo();
573 }
574 else
575 return;
576
577 if (target_cargo && target_entity)
578 {
581 }
582 else
583 return;
584
585 InventoryLocation dst = new InventoryLocation;
586 dst.
SetCargoAuto(target_cargo, item,
x,
y, item.GetInventory().GetFlipCargo());
587
588 if (c_x >
x && c_y >
y && target_entity.GetInventory().LocationCanAddEntity(dst))
589 {
590 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer() );
591
592 SplitItemUtils.TakeOrSplitToInventoryLocation(player, dst);
593
594 Icon icon = cargo.GetIcon(item);
595
596 if (icon)
597 {
602 }
603 }
604 }
EntityAI GetItemPreviewItem(Widget w)
proto native int GetWidth()
proto native int GetHeight()
void RefreshPos(int row, int column)
proto native void SetCargoAuto(notnull CargoBase cargo, EntityAI e, int row, int col, bool flip)
based on Cargo.IsProxyCargo uses SetProxyCargo or SetCargo respectively