Example #1
0
        static SignForm()
        {
            var epf = EPFImage.FromArchive("woodbk.epf", DATArchive.Legend);
            var pal = Palette256.FromArchive("legend.pal", DATArchive.Legend);

            woodbk = DAGraphics.RenderImage(epf[0], pal);
        }
Example #2
0
        public SkillIconForm(int icon, string type)
        {
            InitializeComponent();

            Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(type) + " Icon";

            _icon     = icon;
            _epfImage = EPFImage.FromArchive(type + "001.epf", DATArchive.Setoa);
            _palette  = Palette256.FromArchive("gui06.pal", DATArchive.Setoa);
        }
Example #3
0
        public ItemSpriteForm(int sprite, IWindowsFormsEditorService editorService)
        {
            InitializeComponent();

            this.sprite    = sprite;
            this.palTable  = PaletteTable.FromArchive("item", DATArchive.Legend);
            this.epfImages = new List <Tuple <int, EPFImage> >();
            foreach (var file in DATArchive.Legend.Files)
            {
                var match = Regex.Match(file.Name, @"^item(\d+)\.epf$");
                if (match.Success)
                {
                    var epf        = EPFImage.FromArchive(file.Name, DATArchive.Legend);
                    int fileNumber = int.Parse(match.Groups[1].Value);
                    epfImages.Add(new Tuple <int, EPFImage>(fileNumber, epf));
                    pageComboBox.Items.Add(epfImages.Count);
                }
            }
            this.spriteCache = new Dictionary <int, Bitmap>();
        }
Example #4
0
        private void UpdateIcon()
        {
            string epfFilename;

            switch (cmbBook.SelectedIndex)
            {
            case 0:
            case 2:
            case 4:
                epfFilename = "skill001.epf";
                break;

            default:
                epfFilename = "spell001.epf";
                break;
            }
            var _epfImage = EPFImage.FromArchive(epfFilename, DATArchive.Setoa);
            var _palette  = Palette256.FromArchive("gui06.pal", DATArchive.Setoa);
            var bitmap    = DAGraphics.RenderImage(_epfImage[_skill.Icon], _palette);

            imgIcon.Image = bitmap;
        }
Example #5
0
        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;
        }
Example #6
0
        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;
                        }
                    }
                }
            }
        }