コード例 #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
ファイル: InventoryIcon.cs プロジェクト: van800/SkyOfSteel
 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);
     }
 }