예제 #1
0
        private void SelectItem(int selectedItem)
        {
            switch (selectedItem)
            {
            case 0:
            {         // deposit/withdraw item
                if (itemNum > 0)
                {
                    if (transaction == Enums.InvMenuType.Store)
                    {
                        if (Items.ItemHelper.Items[itemNum].StackCap > 0 || Items.ItemHelper.Items[itemNum].Type == Enums.ItemType.Currency)
                        {
                            if (nudAmount.Value > 0)
                            {
                                Messenger.BankDeposit(itemSlot, nudAmount.Value);
                            }
                            else
                            {
                                //say you must store a number of items greater than 0.
                                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
                            }
                        }
                        else
                        {
                            Messenger.BankDeposit(itemSlot, 0);
                        }
                    }
                    else if (transaction == Enums.InvMenuType.Take)
                    {
                        if (Items.ItemHelper.Items[itemNum].StackCap > 0 || Items.ItemHelper.Items[itemNum].Type == Enums.ItemType.Currency)
                        {
                            if (nudAmount.Value > 0)
                            {
                                Messenger.BankWithdraw(itemSlot + 1, nudAmount.Value);
                            }
                            else
                            {
                                //say you must take a number of items greater than 0.
                                Music.Music.AudioPlayer.PlaySoundEffect("beep3.wav");
                            }
                        }
                        else
                        {
                            Messenger.BankWithdraw(itemSlot + 1, 0);
                        }
                    }
                }
                CloseMenu();
            }
            break;

            case 1:
            {         // View item summary
                MenuSwitcher.ShowItemSummary(itemNum, itemSlot, transaction);
                Music.Music.AudioPlayer.PlaySoundEffect("beep2.wav");
            }
            break;
            }
        }