public void LoadShop(string[] parse) { pnlShopList.Visible = false; pnlShopEditor.Visible = true; this.Size = new System.Drawing.Size(pnlShopEditor.Width, pnlShopEditor.Height); txtName.Text = parse[2]; txtJoinSay.Text = parse[3]; txtLeaveSay.Text = parse[4]; shopItemList = new ListPair <int, Client.Logic.Shops.ShopItem>(); for (int i = 0; i < MaxInfo.MAX_TRADES; i++) { Shops.ShopItem shopItem = new Shops.ShopItem(); shopItem.GiveItem = parse[5 + i * 3].ToInt(); shopItem.GiveValue = parse[6 + i * 3].ToInt(); shopItem.GetItem = parse[7 + i * 3].ToInt(); shopItemList.Add(i, shopItem); } //if (lbxShopItems.SelectedItems.Count > 0) { //lbxShopItems.SelectItem(lbxShopItems.SelectedItems[0].TextIdentifier); //} RefreshShopItemList(); lbxShopItems.SelectItem(0); btnEdit.Text = "Edit"; }
public void LoadShopItems(string[] parse) { ShopItems = new List <Shops.ShopItem>(); if (parse[3].ToInt() <= 0) { lblVisibleItems[0].Text = "Nothing"; return; } int amount = parse[3].ToInt(); int n = 4; for (int i = 0; i < amount; i++) { Shops.ShopItem shopItem = new Shops.ShopItem(); shopItem.GiveItem = parse[n].ToInt(); shopItem.GiveValue = parse[n + 1].ToInt(); shopItem.GetItem = parse[n + 2].ToInt(); ShopItems.Add(shopItem); n += 3; } //int length = parse.Length/3 - 3; //for (int i = 0; i <= length; i++) //{ // Shops.ShopItem shopItem = new Shops.ShopItem(); // shopItem.GiveItem = parse[i*3 + 3].ToInt(); // shopItem.GiveValue = parse[i*3 + 4].ToInt(); // shopItem.GetItem = parse[i*3 + 5].ToInt(); // ShopItems.Add(shopItem); //} DisplayItems(currentTen * 10); ChangeSelected(tempSelected); UpdateSelectedItemInfo(); loaded = true; }
public void LoadShop(string[] parse) { pnlShopList.Visible = false; pnlShopEditor.Visible = true; this.Size = new System.Drawing.Size(pnlShopEditor.Width, pnlShopEditor.Height); txtName.Text = parse[2]; txtJoinSay.Text = parse[3]; txtLeaveSay.Text = parse[4]; shopItemList = new ListPair<int, Client.Logic.Shops.ShopItem>(); for (int i = 0; i < MaxInfo.MAX_TRADES; i++) { Shops.ShopItem shopItem = new Shops.ShopItem(); shopItem.GiveItem = parse[5 + i * 3].ToInt(); shopItem.GiveValue = parse[6 + i * 3].ToInt(); shopItem.GetItem = parse[7 + i * 3].ToInt(); shopItemList.Add(i, shopItem); } //if (lbxShopItems.SelectedItems.Count > 0) { //lbxShopItems.SelectItem(lbxShopItems.SelectedItems[0].TextIdentifier); //} RefreshShopItemList(); lbxShopItems.SelectItem(0); btnEdit.Text = "Edit"; }
public void LoadShopItems(string[] parse) { ShopItems = new List<Shops.ShopItem>(); if (parse[3].ToInt() <= 0) { lblVisibleItems[0].Text = "Nothing"; return; } int amount = parse[3].ToInt(); int n = 4; for (int i = 0; i < amount; i++) { Shops.ShopItem shopItem = new Shops.ShopItem(); shopItem.GiveItem = parse[n].ToInt(); shopItem.GiveValue = parse[n + 1].ToInt(); shopItem.GetItem = parse[n + 2].ToInt(); ShopItems.Add(shopItem); n += 3; } //int length = parse.Length/3 - 3; //for (int i = 0; i <= length; i++) //{ // Shops.ShopItem shopItem = new Shops.ShopItem(); // shopItem.GiveItem = parse[i*3 + 3].ToInt(); // shopItem.GiveValue = parse[i*3 + 4].ToInt(); // shopItem.GetItem = parse[i*3 + 5].ToInt(); // ShopItems.Add(shopItem); //} DisplayItems(currentTen * 10); ChangeSelected(tempSelected); UpdateSelectedItemInfo(); loaded = true; }