Пример #1
0
 public static void TransferFromTo(IHasInventory From, int FromSlot, IHasInventory ToPath, int ToSlot, Items.IntentCount CountMode)
 {
     if (Net.Work.IsNetworkServer())
     {
         Self.ReceiveTransferFromTo(From.GetPath(), FromSlot, ToPath.GetPath(), ToSlot, CountMode);
     }
     else
     {
         Self.RpcId(Net.ServerId, nameof(ReceiveTransferFromTo), From.GetPath(), FromSlot, ToPath.GetPath(), ToSlot, CountMode);
     }
 }
Пример #2
0
 public override void DropData(Vector2 Pos, object Data)
 {
     if (Data is int FromSlot && ParentMenu.From != null)
     {
         if (Source == ParentMenu.From.Source && Slot == FromSlot)
         {
             return;                 //Same source and slot, we dropped on ourself
         }
         ParentMenu.From.Source.TransferTo(Source.GetPath(), FromSlot, Slot, ParentMenu.From.CountMode);
     }
 }