void CheckNPCButtons() { if (Trading) { foreach (ShopButton button in ShopInventory) { // Mouse if (MouseOver(button, new Vector2(32, 32))) { if (RightClick()) { button.WasRightClicked = true; } else if (RightReleased()) { if (button.WasRightClicked) { if (button.Item != null) { Description newdescription = new Description(button); if (DescriptionList.Contains(newdescription)) { DescriptionList.Remove(newdescription); } else { DescriptionList.Add(new Description(button)); } } } button.WasRightClicked = false; } } } } else if (Alcheming) { if (MouseOver(ScrambleButton)) { if (Click()) { ScrambleButton.WasClicked = true; } else if (Released()) { if (ScrambleButton.WasClicked) { if (Save.Kevin.Wealth >= 10) { Save.Kevin.Wealth -= 10; Scramble(ItemHolder); } } ScrambleButton.WasClicked = false; } } } else if (Enchanting) { foreach (EnchantmentButton button in EnchanterButtons) { if (MouseOver(button)) { if (Click()) { button.WasClicked = true; } else if (Released()) { if (button.WasClicked && ItemHolder.Item != null) { if (Save.Kevin.Wealth >= button.Cost) { Save.Kevin.Wealth -= button.Cost; button.WasPressed = true; Enchant(button); } } button.WasClicked = false; } } } EnchanterButtons.RemoveAll(button => button.WasPressed); } }