public KhanArchive(string path, bool male) { string str = male ? "m" : "w"; this.AD = DATArchive.FromFile(path + "\\khan" + str + "ad.dat"); this.EH = DATArchive.FromFile(path + "\\khan" + str + "eh.dat"); this.IM = DATArchive.FromFile(path + "\\khan" + str + "im.dat"); this.NS = DATArchive.FromFile(path + "\\khan" + str + "ns.dat"); this.TZ = DATArchive.FromFile(path + "\\khan" + str + "tz.dat"); }
private void Form1_Shown(object sender, EventArgs e) { foreach (DATFileEntry file in DATArchive.FromFile(filename).Files) { Match match = new Regex("(item)(\\d+)(\\.epf)", RegexOptions.IgnoreCase | RegexOptions.Singleline).Match(file.Name); if (match.Success) { int num = int.Parse(match.Groups[2].ToString()); if (num < this.minimum) { this.minimum = num; } if (num > this.maximum) { this.maximum = num; } } } DisplayItems(this.minimum); }
private void DisplayItems(int number) { DATArchive archive = DATArchive.FromFile(filename); PaletteTable paletteTable = new PaletteTable("item", archive); foreach (DATFileEntry file in archive.Files) { Match match = new Regex("(item)(\\d+)(\\.epf)", RegexOptions.IgnoreCase | RegexOptions.Singleline).Match(file.Name); if (match.Success) { EPFImage epfImage = EPFImage.FromArchive(file.Name, archive); int num1 = int.Parse(match.Groups[2].ToString()); if (num1 == number) { panelItemFill.Controls.Clear(); for (int index = 0; index < epfImage.Frames.Length; ++index) { int num2 = (num1 - 1) * 266 + (index + 1); PictureBox pictureBox = new PictureBox(); pictureBox.Name = string.Format("Sprite ID: {0} ({1} for Npc)", (object)num2, (object)(num2 + 16384)); pictureBox.Image = (Image)DAGraphics.RenderImage(epfImage.Frames[index], paletteTable[num1 * 266]); pictureBox.Click += (EventHandler)((o, ea) => { txtSprite.Text = (o as PictureBox).Name; }); pictureBox.BorderStyle = BorderStyle.FixedSingle; if (pictureBox.Image.Width > 1 || pictureBox.Image.Height > 1) { panelItemFill.Controls.Add((Control)pictureBox); } } break; } } } current = number; buttonLeft.Enabled = this.current > this.minimum; buttonRight.Enabled = this.current < this.maximum; }
public void DisplayItem(int SpriteID) { DATArchive archive = DATArchive.FromFile(filename); PaletteTable paletteTable = new PaletteTable("item", archive); foreach (DATFileEntry file in archive.Files) { Match match = new Regex("(item)(\\d+)(\\.epf)", RegexOptions.IgnoreCase | RegexOptions.Singleline).Match(file.Name); if (match.Success) { EPFImage epfImage = EPFImage.FromArchive(file.Name, archive); int num1 = int.Parse(match.Groups[2].ToString()); for (int index = 0; index < epfImage.Frames.Length; ++index) { int num2 = (num1 - 1) * 266 + (index + 1); if (num2 == SpriteID) { Bitmap bmp = new Bitmap(DAGraphics.RenderImage(epfImage.Frames[index], paletteTable[num1 * 266])); picSelectedItem.Image = bmp; } } } } }