コード例 #1
0
 static Bitmap DrawSkillIcon(PatchUtil.skill_system_enum skill, uint icon)
 {
     if (skill == PatchUtil.skill_system_enum.FE8N_ver2)
     {
         return(ImageItemIconForm.DrawIconWhereID_UsingWeaponPalette_SKILLFE8NVer2(icon));
     }
     else
     {
         return(ImageItemIconForm.DrawIconWhereID_UsingWeaponPalette(icon));
     }
 }
コード例 #2
0
 public static Bitmap PromotionItem(uint num)
 {
     if (Program.ROM.RomInfo.version() == 6)
     {
         return(ImageItemIconForm.DrawIconWhereID(0x5d + num));
     }
     else if (Program.ROM.RomInfo.version() == 7)
     {
         return(ImageItemIconForm.DrawIconWhereID(0x62 + num));
     }
     else
     {
         return(ImageItemIconForm.DrawIconWhereID(0x62 + num));
     }
 }
コード例 #3
0
 public static Bitmap StatBooster(uint num)
 {
     if (Program.ROM.RomInfo.version() == 6)
     {
         return(ImageItemIconForm.DrawIconWhereID(0x56 + num));
     }
     else if (Program.ROM.RomInfo.version() == 7)
     {
         return(ImageItemIconForm.DrawIconWhereID(0x59 + num));
     }
     else
     {
         return(ImageItemIconForm.DrawIconWhereID(0x59 + num));
     }
 }
コード例 #4
0
 public static Bitmap SecretShop()
 {
     if (Program.ROM.RomInfo.version() == 6)
     {
         return(ImageItemIconForm.DrawIconWhereID(0x6b));
     }
     else if (Program.ROM.RomInfo.version() == 7)
     {
         return(ImageItemIconForm.DrawIconWhereID(0x84));
     }
     else
     {
         return(ImageItemIconForm.DrawIconWhereID(0x84));
     }
 }
コード例 #5
0
 //属性アイコン
 public static Bitmap Attribute(uint type)
 {//属性アイコンはアイテムアイコンと共有しているらしい。
  //7A=炎	        1
  //7B=稲妻	        2
  //7C=風	        3
  //7D=氷	        4
  //7E=闇	        5
  //7F=光	        6
  //80=理	        7
  //ただし、パレットは武器アイコンを参照していると思われる.
     if (type <= 0)
     {
         return(ImageUtil.BlankDummy());
     }
     return(ImageItemIconForm.DrawIconWhereID_UsingWeaponPalette(type + 0x7A - 1));
 }
コード例 #6
0
        //Skill + テキストを書くルーチン
        public static Size DrawSkillAndText(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw)
        {
            if (index < 0 || index >= lb.Items.Count)
            {
                return(new Size(listbounds.X, listbounds.Y));
            }
            string text = lb.Items[index].ToString();

            SolidBrush brush      = new SolidBrush(lb.ForeColor);
            Font       normalFont = lb.Font;
            Rectangle  bounds     = listbounds;

            int  textmargineY = (ListBoxEx.OWNER_DRAW_ICON_SIZE - (int)lb.Font.Height) / 2;
            uint addr         = InputFormRef.SelectToAddr(lb, (int)index);

            Bitmap bitmap = null;

            if (addr != U.NOT_FOUND)
            {
                uint icon = Program.ROM.u16(addr + 0);
                bitmap = ImageItemIconForm.DrawIconWhereID_UsingWeaponPalette_SKILLFE8NVer2(icon);
            }
            else
            {
                bitmap = ImageUtil.BlankDummy();
            }
            U.MakeTransparent(bitmap);

            //アイコンを描く.
            Rectangle b = bounds;

            b.Width   = ListBoxEx.OWNER_DRAW_ICON_SIZE;
            b.Height  = ListBoxEx.OWNER_DRAW_ICON_SIZE;
            bounds.X += U.DrawPicture(bitmap, g, isWithDraw, b);
            bitmap.Dispose();

            //テキストを描く.
            b         = bounds;
            b.Y      += textmargineY;
            bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, b);
            bounds.Y += ListBoxEx.OWNER_DRAW_ICON_SIZE;

            brush.Dispose();
            return(new Size(bounds.X, bounds.Y));
        }
コード例 #7
0
        //アイコンを画く.
        public static Bitmap DrawIcon(uint item_id)
        {
            if (item_id <= 0)
            {
                return(ImageUtil.BlankDummy(16));
            }

            InputFormRef InputFormRef = Init(null);
            uint         addr         = InputFormRef.IDToAddr(item_id);

            if (!U.isSafetyOffset(addr))
            {
                return(ImageUtil.BlankDummy(16));
            }
            uint iconid = Program.ROM.u8(addr + 29);

            return(ImageItemIconForm.DrawIconWhereID(iconid));
        }
コード例 #8
0
        static Bitmap DrawSkillIconLow(uint id)
        {
            InputFormRef ifr  = Init(null);
            uint         addr = ifr.IDToAddr(id);

            if (addr == U.NOT_FOUND)
            {
                return(ImageUtil.BlankDummy());
            }
            uint pal = Program.ROM.u16(addr + 2);
            uint skillPaletteAddress = GetSkillPaletteAddress(pal);

            uint iconbaseaddr  = Program.ROM.p32(Program.ROM.RomInfo.icon_pointer());
            uint icondatacount = (2 * 8 * 2 * 8) / 2; // /2しているのは16色のため
            uint iconaddr      = iconbaseaddr + (icondatacount * (0x100 + id));

            return(ImageItemIconForm.DrawIcon(iconaddr, skillPaletteAddress));
        }
コード例 #9
0
        Bitmap DrawItemIcons()
        {
            Bitmap bitmap = null;

            for (int i = 0; i < ICON_COUNT; i++)
            {
                Bitmap a = ImageItemIconForm.DrawIconWhereID((uint)(i + 1) * 10);
                if (bitmap == null)
                {
                    bitmap = ImageUtil.Blank(16 * ICON_COUNT, 16, a);
                }
                if (ImageUtil.IsBlankBitmap(a))
                {
                    a = ImageItemIconForm.DrawIconWhereID((uint)(i + 1) * 10 + 1);
                }
                ImageUtil.BitBlt(bitmap, i * 16, 0, 16, 16, a, 0, 0);
            }
            return(bitmap);
        }
コード例 #10
0
ファイル: ListBoxEx.cs プロジェクト: MrMeow76/FEBuilderGBA
        //アイテムアイコン + テキストを書くルーチン
        public static Size DrawImageItemIconAndText(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw)
        {
            if (index < 0 || index >= lb.Items.Count)
            {
                return(new Size(listbounds.X, listbounds.Y));
            }
            string text = lb.Items[index].ToString();

            SolidBrush brush      = new SolidBrush(lb.ForeColor);
            Font       normalFont = lb.Font;
            Rectangle  bounds     = listbounds;

            int textmargineY = (ListBoxEx.OWNER_DRAW_ICON_SIZE - (int)lb.Font.Height) / 2;

            //テキストの先頭にアイコン番号(キャラ番号が入っている. 無駄だが汎用性を考えるとほかに方法がない)
            uint   icon   = U.atoh(text);
            Bitmap bitmap = ImageItemIconForm.DrawIconWhereID(icon);

            U.MakeTransparent(bitmap);

            //アイコンを描く. 処理速度を稼ぐためにマップアイコンの方を描画
            Rectangle b = bounds;

            b.Width   = ListBoxEx.OWNER_DRAW_ICON_SIZE;
            b.Height  = ListBoxEx.OWNER_DRAW_ICON_SIZE;
            bounds.X += U.DrawPicture(bitmap, g, isWithDraw, b);
            bitmap.Dispose();

            //テキストを描く.
            b         = bounds;
            b.Y      += textmargineY;
            bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, b);
            bounds.Y += ListBoxEx.OWNER_DRAW_ICON_SIZE;

            brush.Dispose();
            return(new Size(bounds.X, bounds.Y));
        }
コード例 #11
0
        public MainSimpleMenuImageSubForm()
        {
            InitializeComponent();

            ImageBGButton.BackgroundImage = MakeTransparent(Trim(ImageBGForm.DrawBG(0)));

            if (Program.ROM.RomInfo.version() >= 7)
            {
                BigCGButton.BackgroundImage = MakeTransparent(Trim(ImageCGForm.DrawImageByID(0)));
            }
            else
            {
                BigCGButton.Hide();
            }

            ImagePortraitButton.BackgroundImage     = MakeTransparent(ImagePortraitForm.DrawPortraitUnit(2));
            ImageBattleAnimeButton.BackgroundImage  = MakeTransparent(BattleZoom(ImageBattleAnimeForm.DrawBattleAnime(1, ImageBattleAnimeForm.ScaleTrim.SCALE_90)));
            ImageUnitWaitIconButton.BackgroundImage = MakeTransparent(ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(1, 0, false));
            ImageUnitMoveIconButton.BackgroundImage = MakeTransparent(ImageUnitMoveIconFrom.DrawMoveUnitIconBitmap(3, 0, 0));
            ImageIconButton.BackgroundImage         = MakeTransparent(ImageItemIconForm.DrawIconWhereID(0xB));
            SystemIconButton.BackgroundImage        = MakeTransparent(ImageSystemIconForm.YubiYoko());
            //BattleScreenButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.Allows(8));
            BattleScreenButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.WeaponIcon(0));

            ImageBattleFieldButton.BackgroundImage   = MakeTransparent(ImageBattleBGForm.DrawBG(2));
            ImageBattleTerrainButton.BackgroundImage = MakeTransparent((ImageBattleTerrainForm.Draw(2)));

            if (Program.ROM.RomInfo.version() == 8)
            {
                ImageUnitPaletteButton.BackgroundImage = MakeTransparent(BattleZoom(UnitPaletteForm.DrawSample(2, 3)));
            }
            else
            {//for FE6 , FE7
                ImageUnitPaletteButton.BackgroundImage = MakeTransparent(BattleZoom(ImageBattleAnimeForm.DrawBattleAnime(ImageBattleAnimeForm.GetAnimeIDByClassID(UnitForm.GetClassID(2))
                                                                                                                         , ImageBattleAnimeForm.ScaleTrim.SCALE_90, UnitForm.GetPaletteLowClass(2))));
            }

            WorldMapImageButton.BackgroundImage = MakeTransparent(WorldMapImageForm.DrawWorldMap());

            if (Program.ROM.RomInfo.version() == 7 && Program.ROM.RomInfo.is_multibyte() == false)
            {//英語版FE7は、章タイトルをテキストで保持していて、40260c nazo fontで、描画している.
                ImageChapterTitleButton.Hide();
            }
            else
            {
                ImageChapterTitleButton.BackgroundImage = MakeTransparent(ImageChapterTitleForm.DrawSample(0));
            }


            if (ImageUtilMagic.SearchMagicSystem() != ImageUtilMagic.magic_system_enum.NO)
            {
                ImageMagicButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.WeaponIcon(8 - 3));
            }
            else
            {
                ImageMagicButton.Hide();
            }

            if (Program.ROM.RomInfo.is_multibyte())
            {
                OptionForm.textencoding_enum textencoding = OptionForm.textencoding();
                if (textencoding == OptionForm.textencoding_enum.ZH_TBL)
                {
//                    FontButton.BackgroundImage = MakeTransparent(FontZHForm.DrawFontString("字形", true));
                }
                else
                {
                    FontButton.BackgroundImage = MakeTransparent(FontForm.DrawFontString("フォント", true));
                }
            }
            else
            {
                FontButton.BackgroundImage = MakeTransparent(FontForm.DrawFontString("Font", true));
            }
        }