private void listView1_MouseDoubleClick(object sender, MouseEventArgs e) { if (listView1.SelectedItems.Count != 1) { return; } Result = items.Find(x => x.Name == listView1.SelectedItems[0].Text); Close(); }
public DecodedItem DecodeItem() { DecodedItem res = new DecodedItem(); short length = 0; byte[] buffer; res.ItemID = ReadInt32(); res.EditableType = ReadByte(); res.ItemCategory = ReadByte(); res.ActionType = ReadByte(); res.HitSoundType = ReadByte(); // Luckily, only item name is encrypted this way length = BitConverter.ToInt16(ReadBytes(2), 0); buffer = new byte[length]; for (int i = 0; i < length; i++) { buffer[i] = (byte)(stream.ReadByte() ^ (key[(i + res.ItemID) % key.Length])); } res.Name = Encoding.UTF8.GetString(buffer); res.Texture = ReadString(); res.TextureHash = ReadInt32(); res.ItemKind = ReadByte(); res.val1 = ReadInt32(); res.TextureX = ReadByte(); res.TextureY = ReadByte(); res.SpreadType = ReadByte(); res.IsStripeyWallpaper = ReadByte(); res.CollisionType = ReadByte(); res.BreakHits = ReadByte(); res.DropChance = ReadInt32(); res.ClothingType = ReadByte(); res.Rarity = ReadInt16(); res.MaxAmount = ReadByte(); res.ExtraFile = ReadString(); res.ExtraFileHash = ReadInt32(); res.AudioVolume = ReadInt32(); res.PetName = ReadString(); res.PetPrefix = ReadString(); res.PetSuffix = ReadString(); res.PetAbility = ReadString(); res.SeedBase = ReadByte(); res.SeedOverlay = ReadByte(); res.TreeBase = ReadByte(); res.TreeLeaves = ReadByte(); res.SeedColor = ReadInt32(); res.SeedOverlayColor = ReadInt32(); stream.Position += 4; // Alledgedly, removed recipe data res.GrowTime = ReadInt32(); res.val2 = ReadInt16(); res.IsRayman = ReadInt16(); res.ExtraOptions = ReadString(); res.Texture2 = ReadString(); res.ExtraOptions2 = ReadString(); stream.Position += 80; res.PunchOptions = ReadString(); stream.Position += 13; // ??? stream.Position += 4; // ??? return(res); }