private void InitializeVariables()
 {
     this.overlay = new Overlay();
     textPreview  = new BattleDialoguePreview();
     parser       = ParserReduced.Instance;
     byteView     = true;
 }
Exemple #2
0
 private void InitializeVariables()
 {
     DrawName        = new BattleDialoguePreview();
     FontPalettes    = new PaletteSet[3];
     FontPalettes[0] = new PaletteSet(Model.ROM, 0, 0x3DFEE0, 2, 16, 32);
     FontPalettes[1] = new PaletteSet(Model.ROM, 0, 0x3E2D55, 2, 16, 32);
     FontPalettes[2] = new PaletteSet(Model.ROM, 0, 0x01EF40, 2, 16, 32);
     FontDialogue    = new Fonts.Glyph[128];
     for (int i = 0; i < FontDialogue.Length; i++)
     {
         FontDialogue[i] = new Fonts.Glyph(i, FontType.Dialogue);
     }
 }
Exemple #3
0
        private void name_DrawItem(object sender, DrawItemEventArgs e)
        {
            var bgimage = Menus.Model.MenuBG_256x255;

            if (e.Index < 0 || e.Index >= this.name.Items.Count)
            {
                return;
            }
            int[] temp;
            if (this.CurrentSet == Set.AllySpell ||
                this.CurrentSet == Set.Item ||
                this.CurrentSet == Set.MonsterAttack ||
                this.CurrentSet == Set.MonsterSpell ||
                this.CurrentSet == Set.Weapon)
            {
                char[] name;
                switch (CurrentSet)
                {
                case Set.AllySpell:     // Ally spells
                    name = Magic.Model.Names.GetUnsortedName(e.Index).ToCharArray();
                    temp = new MenuTextPreview().GetPreview(Fonts.Model.Menu, Fonts.Model.Palette_Battle.Palette, name, true);
                    break;

                case Set.Item:     // Items
                    name = Items.Model.Names.GetUnsortedName(e.Index + 0x60).ToCharArray();
                    temp = new MenuTextPreview().GetPreview(Fonts.Model.Menu, Fonts.Model.Palette_Battle.Palette, name, true);
                    break;

                case Set.MonsterAttack:     // Monster attacks
                    name = Attacks.Model.Names.Names[e.Index].ToCharArray();
                    temp = new BattleDialoguePreview().GetPreview(Fonts.Model.Dialogue, Fonts.Model.Palette_Battle.Palette, name, false);
                    break;

                case Set.MonsterSpell:     // Monster spells
                    name = Magic.Model.Names.GetUnsortedName(e.Index + 0x40).ToCharArray();
                    temp = new BattleDialoguePreview().GetPreview(Fonts.Model.Dialogue, Fonts.Model.Palette_Battle.Palette, name, false);
                    break;

                case Set.Weapon:     // Weapons
                    name = Items.Model.Names.GetUnsortedName(e.Index).ToCharArray();
                    temp = new MenuTextPreview().GetPreview(Fonts.Model.Menu, Fonts.Model.Palette_Battle.Palette, name, true);
                    break;

                default:     // Battle events, Monster behaviors
                    name = new char[1];
                    temp = new MenuTextPreview().GetPreview(Fonts.Model.Menu, Fonts.Model.Palette_Battle.Palette, name, true); break;
                }

                //
                var background = new Rectangle(0, e.Index * 15 % bgimage.Height, bgimage.Width, 15);
                e.Graphics.DrawImage(bgimage, e.Bounds.X, e.Bounds.Y, background, GraphicsUnit.Pixel);

                // set the pixels
                if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
                {
                    e.DrawBackground();
                }
                int[]  pixels;
                Bitmap icon;
                if (this.CurrentSet == Set.MonsterAttack ||
                    this.CurrentSet == Set.MonsterSpell)
                {
                    pixels = new int[256 * 32];
                    for (int y = 2, c = 10; c < 32; y++, c++)
                    {
                        for (int x = 2, a = 8; a < 256; x++, a++)
                        {
                            pixels[y * 256 + x] = temp[c * 256 + a];
                        }
                    }
                    icon = Do.PixelsToImage(pixels, 256, 32);
                }
                else
                {
                    pixels = new int[256 * 14];
                    for (int y = 2, c = 0; y < 14; y++, c++)
                    {
                        for (int x = 2, a = 0; x < 256; x++, a++)
                        {
                            pixels[y * 256 + x] = temp[c * 256 + a];
                        }
                    }
                    icon = Do.PixelsToImage(pixels, 256, 14);
                }
                e.Graphics.DrawImage(new Bitmap(icon), new Point(e.Bounds.X, e.Bounds.Y));
            }
            else
            {
                e.DrawBackground();
                e.Graphics.DrawString(name.Items[e.Index].ToString(), e.Font, new SolidBrush(name.ForeColor), e.Bounds);
            }
        }