private void Buy(object?sender, EventArgs e) { if (!((sender as Control)?.Tag is Item item)) { return; } using var buyItem = new BuyItem(item, saveFile.Character, saveFile.Inventory); buyItem.ShowDialog(); }
private void ShopButtonClicked(int index) { buyItem = new BuyItem(ItemsArray[index], character); buyItem.ShowDialog(); }