/// <summary> /// Add new items to the GameShop /// </summary> /// <param name="info">A list of Items to add to the Game Shop</param> public void AddGameShopItem(List <ItemInfo> info) { if (info == null || info.Count == 0) { return; } List <GameShopItem> list = new List <GameShopItem>(); for (int i = 0; i < info.Count; i++) { GameShopPanel.GameShopInfoList.Add(new GameShopItem { GIndex = ++GameShopIndex, ItemIndex = info[i].Index, Info = GetItemInfo(info[i].Index) }); list.Add(GameShopPanel.GameShopInfoList[i]); } GameShopPanel._SelectedItems.Clear(); GameShopPanel._SelectedItems = list; GameShopPanel.UpdateGameShop(list); DialogResult result = MessageBox.Show("Would you like to edit the Item in the GameShop now?", "Switch to GameShop Tool?", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { tabControl1.SelectedTab = tabGameShopTool; } }
/// <summary> /// Add a new Item to the GameShop /// </summary> /// <param name="info">The Item to add to the Game Shop</param> public void AddGameShopItem(ItemInfo info) { GameShopPanel.GameShopInfoList.Add(new GameShopItem { GIndex = ++GameShopIndex, ItemIndex = info.Index, Info = info }); GameShopItem item = GameShopPanel.GameShopInfoList[GameShopPanel.GameShopInfoList.Count - 1]; DialogResult result = MessageBox.Show("Would you like to edit the Item in the GameShop now?", "Switch to GameShop Tool?", MessageBoxButtons.YesNo); GameShopPanel._SelectedItems.Clear(); GameShopPanel._SelectedItems.Add(item); GameShopPanel.UpdateGameShop(item); if (result == DialogResult.Yes) { tabControl1.SelectedTab = tabGameShopTool; } }