예제 #1
0
        static void DoDeposit(Item item)
        {
            TEStorageHeart heart = StoragePlayer.GetStorageHeart();

            if (Main.netMode == 0)
            {
                heart.DepositItem(item);
            }
            else
            {
                NetHelper.SendDeposit(heart.ID, item);
                item.SetDefaults(0, true);
            }
        }
예제 #2
0
        public override bool ShiftClickSlot(Item[] inventory, int context, int slot)
        {
            if (context != ItemSlot.Context.InventoryItem && context != ItemSlot.Context.InventoryCoin && context != ItemSlot.Context.InventoryAmmo)
            {
                return(false);
            }

            if (StorageAccess.X < 0 || StorageAccess.Y < 0)
            {
                return(false);
            }

            Item item = inventory[slot];

            if (item.favorited || item.IsAir)
            {
                return(false);
            }

            int oldType  = item.type;
            int oldStack = item.stack;

            if (Main.netMode == 0)
            {
                GetStorageHeart().DepositItem(item);
            }
            else
            {
                NetHelper.SendDeposit(GetStorageHeart().ID, item);
                item.SetDefaults(0, true);
            }
            if (item.type != oldType || item.stack != oldStack)
            {
                Main.PlaySound(7, -1, -1, 1, 1f, 0f);
                MagicStoragePlus.Instance.StorageUI.RefreshItems();
            }
            return(true);
        }