NOTE Used for mouse only.
526 {
528 if (!item)
529 return;
530
531 #ifndef PLATFORM_CONSOLE
532 int c_x, c_y;
533 #endif
534
536 CargoBase targetCargo;
537
539 {
541 }
542
543 if (targetEntity)
544 {
545 targetCargo = targetEntity.GetInventory().GetCargo();
546 #ifdef PLATFORM_CONSOLE
548 return;
549 #endif
550 }
551
552 if (!targetCargo || !targetEntity)
553 return;
554
555 InventoryLocation dst = new InventoryLocation();
556 #ifdef PLATFORM_CONSOLE
560 #else
563
564 dst.
SetCargoAuto(targetCargo, item,
x,
y, item.GetInventory().GetFlipCargo());
565 #endif
566
567 InventoryLocation src = new InventoryLocation();
568 item.GetInventory().GetCurrentInventoryLocation(src);
570 return;
571
572 #ifdef PLATFORM_CONSOLE
573 if (dst.
IsValid() && targetEntity.GetInventory().LocationCanAddEntity(dst))
574 #else
575 if (c_x >
x && c_y >
y && targetEntity.GetInventory().LocationCanAddEntity(dst))
576 #endif
577 {
579
580 SplitItemUtils.TakeOrSplitToInventoryLocation(player, dst);
581
582 Icon icon = cargo.GetIcon(item);
583 if (icon)
584 {
585 if (w && w.FindAnyWidget("Cursor"))
586 w.FindAnyWidget("Cursor").SetColor(ColorManager.BASE_COLOR);
587
590 }
591 }
592
593 ItemManager.GetInstance().HideDropzones();
594 ItemManager.GetInstance().SetIsDragging(false);
595 }
FindInventoryLocationType
flags for searching locations in inventory
proto native int GetItemCount()
proto native int GetWidth()
proto native int GetHeight()
ref map< EntityAI, ref CargoContainer > m_AttachmentCargos
ref CargoContainer m_CargoGrid
EntityAI GetItemPreviewItem(Widget w)
proto native bool IsValid()
verify current set inventory location
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 bool CompareLocationOnly(notnull InventoryLocation other)
proto native bool GetFlip()
returns flip status of cargo
proto native CGame GetGame()