private void button2_Click(object sender, EventArgs e) { flowLayoutPanel1.Controls.Clear(); SearchedSkin = ParseSkinInfo(textBox1.Text); if (SearchedSkin != null) { string currentBackendType = currentBackEndType.ToString(); SortItemList(out SkinSearch.Datum[] itemlist); GridItem[] skinlist = null; switch (searchingBy) { case SearchingBy.OwnedItem: skinlist = itemlist.Where(x => x.type.backendValue == currentBackendType && x.id.Length <= SearchedSkin.id.Length).Select(x => new GridItem(x)).ToArray(); label1.Text = $"Found {skinlist.Length} cosmetics that can be swapped for {SearchedSkin.name}"; break; case SearchingBy.WantItem: skinlist = itemlist.Where(x => x.type.backendValue == currentBackendType && x.type.backendValue == currentBackendType && SearchedSkin.id.Length <= x.id.Length).Select(x => new GridItem(x)).ToArray(); label1.Text = $"Found {skinlist.Length} cosmetics that can be swapped to {SearchedSkin.name}"; break; } flowLayoutPanel1.Controls.AddRange(skinlist); } else { label1.Text = $"That cosmetic cannot be found ({textBox1.Text})"; } }
public void SetSkinCID(SkinSearch.Datum skin) { switch (searchingBy) { case SearchingBy.OwnedItem: lobbyform.Controls["textBox2"].Text = skin.id; lobbyform.Controls["textBox1"].Text = SearchedSkin.id; Lobby.CurrentCID = new Item(); Lobby.CurrentCID.SwapsFrom = SearchedSkin.name; Lobby.CurrentCID.SwapsTo = skin.name; Lobby.CurrentCID.FromImage = SearchedSkin.images.icon; Lobby.CurrentCID.ToImage = skin.images.icon; Lobby.CurrentCID.Zlib = true; var asset = new Asset(); asset.AssetPath = "FortniteGame/AssetRegistry.bin"; asset.UcasFile = "pakchunk0-WindowsClient.pak"; //Asset registry is always in pakchunk0 coz ue4 moment asset.Search = new string[1] { $"{SearchedSkin.id}.{SearchedSkin.id}" }; asset.Replace = new string[1] { $"{skin.id}.{skin.id}" }; Lobby.CurrentCID.Asset = new Asset[1] { asset }; Lobby.cidform.Close(); break; case SearchingBy.WantItem: lobbyform.Controls["textBox2"].Text = SearchedSkin.id; lobbyform.Controls["textBox1"].Text = skin.id; Lobby.CurrentCID = new Item(); Lobby.CurrentCID.SwapsFrom = skin.name; Lobby.CurrentCID.SwapsTo = SearchedSkin.name; Lobby.CurrentCID.FromImage = skin.images.icon; Lobby.CurrentCID.ToImage = SearchedSkin.images.icon; Lobby.CurrentCID.Zlib = true; var asset2 = new Asset(); asset2.AssetPath = "FortniteGame/AssetRegistry.bin"; asset2.UcasFile = "pakchunk0-WindowsClient.pak"; //Asset registry is always in pakchunk0 coz ue4 moment asset2.Search = new string[1] { $"{skin.id}.{skin.id}" }; asset2.Replace = new string[1] { $"{SearchedSkin.id}.{SearchedSkin.id}" }; Lobby.CurrentCID.Asset = new Asset[1] { asset2 }; Lobby.cidform.Close(); break; } }