555 {
557 if( !item )
558 {
559 return;
560 }
561
562 int idx = 0;
563 int c_x, c_y;
564
566 CargoBase target_cargo;
567
568 target_entity = cargo.GetEntity();
569 if( target_entity )
570 {
571 target_cargo = target_entity.GetInventory().GetCargo();
572 }
573 else
574 return;
575
576 if( target_cargo && target_entity )
577 {
580 }
581 else
582 return;
583
584 InventoryLocation dst = new InventoryLocation;
585 dst.
SetCargoAuto(target_cargo, item,
x,
y, item.GetInventory().GetFlipCargo());
586
587 if( c_x >
x && c_y >
y && target_entity.GetInventory().LocationCanAddEntity(dst))
588 {
590
591 SplitItemUtils.TakeOrSplitToInventoryLocation( player, dst);
592
593 Icon icon = cargo.GetIcon( item );
594
595 if( icon )
596 {
601 }
602 }
603 }
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
proto native CGame GetGame()