public static Bitmap getSPTypeIcon(uint b0, uint b1)
        {
            Bitmap bitmap;

            if (b1 == 0)
            {//アイテム指定 b0はアイテム名
                bitmap = ItemForm.DrawIcon(b0);
            }
            else if (b1 == 1)
            {//種類指定
                if (b0 >= 8)
                {
                    bitmap = ImageSystemIconForm.WeaponIcon(8);
                }
                else
                {
                    bitmap = ImageSystemIconForm.WeaponIcon(b0);
                }
            }
            else
            {
                bitmap = ImageSystemIconForm.WeaponIcon(8);
            }
            return(bitmap);
        }
Esempio n. 2
0
        void DrawIcon()
        {
            if (Program.ROM == null)
            {
                return;
            }
            Bitmap b;

            if (IconTypeEnum.Weapon == iconType)
            {
                b = ImageSystemIconForm.WeaponIcon(iconNumber);
            }
            else if (IconTypeEnum.Attribute == iconType)
            {
                b = ImageSystemIconForm.Attribute(iconNumber);
            }
            else if (IconTypeEnum.Cursol == iconType)
            {
                b = ImageSystemIconForm.Cursol();
            }
            else if (IconTypeEnum.Yubi == iconType)
            {
                if (iconNumber == 0)
                {
                    b = ImageSystemIconForm.YubiYoko();
                }
                else
                {
                    b = ImageSystemIconForm.YubiTate();
                }
            }
            else if (IconTypeEnum.Exit == iconType)
            {
                b = ImageSystemIconForm.ExitPoint();
            }
            else if (IconTypeEnum.Allow == iconType)
            {
                b = ImageSystemIconForm.Allows((int)iconNumber);
            }
            else if (IconTypeEnum.Music == iconType)
            {
                b = ImageSystemIconForm.MusicIcon(iconNumber);
            }
            else
            {
                b = ImageSystemIconForm.Blank16();
            }
            U.MakeTransparent(b);
            base.Image = b;
        }
Esempio n. 3
0
        //WeaponTypeIcon + テキスト + (PARSER) + WeaponTypeIcon + テキスト  を書く
        public static Size DrawWeaponTypeIcon2AndText(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 = (OWNER_DRAW_ICON_SIZE - (int)lb.Font.Height) / 2;

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

            U.MakeTransparent(bitmap);

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

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

            string[] parsers = new string[] { " -> ", " <- ", " ?? ", " & " };
            bool     found   = false;

            foreach (string parser in parsers)
            {
                int p = text.IndexOf(parser);
                if (p < 0)
                {
                    continue;
                }

                p += parser.Length;

                //前半
                string a1 = text.Substring(0, p);
                b         = bounds;
                b.Y      += textmargineY;
                bounds.X += U.DrawText(a1, g, normalFont, brush, isWithDraw, b);

                //後半
                string a2 = text.Substring(p);

                //後半のアイコンを描く
                icon   = U.atoh(a2);
                bitmap = ImageSystemIconForm.WeaponIcon(icon);
                U.MakeTransparent(bitmap);

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

                //後半の文字列
                b         = bounds;
                b.Y      += textmargineY;
                bounds.X += U.DrawText(a2, g, normalFont, brush, isWithDraw, b);

                found = true;
                break;
            }

            if (found == false)
            {
                //見つからなかったので、普通にテキストを描く.
                bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, bounds);
            }

            brush.Dispose();

            bounds.Y += OWNER_DRAW_ICON_SIZE;
            return(new Size(bounds.X, bounds.Y));
        }
Esempio n. 4
0
        public static Size DrawEventCategory(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 lineHeight = (int)lb.Font.Height;

            string[] sp = text.Split(new string[] { "[", "//" }, StringSplitOptions.None);
            bounds.X += U.DrawText(sp[0], g, normalFont, brush, isWithDraw, bounds);
            for (int i = 1; i < sp.Length - 1; i++)
            {
                bounds.X += U.DrawText("[", g, normalFont, brush, isWithDraw, bounds);

                string nn = sp[i];
                int    p  = nn.IndexOf(':');
                if (p < 0)
                {
                    bounds.X += U.DrawText(nn, g, normalFont, brush, isWithDraw, bounds);
                    continue;
                }

                string item = nn.Substring(0, p);

                Bitmap bitmap = null;
                if (item == "UNIT")
                {
                    bitmap = UnitForm.DrawUnitMapFacePicture(1);
                }
                else if (item == "CLASS")
                {
                    bitmap = ClassForm.DrawWaitIcon(3);
                }
                else if (item == "POINTER_PROCS")
                {
                    bitmap = ImageSystemIconForm.WeaponIcon(4);
                }
                else if (item == "POINTER_ASM")
                {
                    bitmap = ImageSystemIconForm.WeaponIcon(8);
                }
                else if (item == "POINTER_UNIT")
                {
                    bitmap = ClassForm.DrawWaitIcon(7);
                }
                else if (item == "POINTER_EVENT")
                {//サブルーチンは目立つ緑のアイコン
                    bitmap = ImageSystemIconForm.MusicIcon(3);
                }
                else if (item == "MUSIC")
                {
                    bitmap = ImageSystemIconForm.MusicIcon(6);
                }
                else if (item == "SOUND")
                {
                    bitmap = ImageSystemIconForm.MusicIcon(7);
                }
                else if (item == "ITEM")
                {//アイテムアイコン
                    bitmap = ImageSystemIconForm.WeaponIcon(8);
                }
                else if (item == "FLAG")
                {
                    bitmap = ImageSystemIconForm.FlagIcon();
                }
                else if (item == "WMLOCATION")
                {//拠点
                    bitmap = WorldMapImageForm.DrawWorldMapIcon(0xB);
                }
                else if (item == "WMPATH")
                {//道
                    bitmap = WorldMapImageForm.DrawWorldMapIcon(0xB);
                }
                if (bitmap != null)
                {
                    U.MakeTransparent(bitmap);

                    Rectangle b = bounds;
                    b.Width  = lineHeight;
                    b.Height = lineHeight;

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

                    bounds.X += U.DrawText(nn.Substring(p), g, normalFont, brush, isWithDraw, bounds);
                }
                else
                {
                    bounds.X += U.DrawText(nn.Substring(p + 1), g, normalFont, brush, isWithDraw, bounds);
                }
            }

            //コードをコメント形式で描画
            if (sp.Length > 0)
            {
                int        i            = sp.Length - 1;
                SolidBrush commentBrush = new SolidBrush(OptionForm.Color_Comment_ForeColor());
                if (bounds.X < 700)
                {
                    bounds.X = 700;
                }
                bounds.X += U.DrawText("//" + sp[i], g, normalFont, commentBrush, isWithDraw, bounds);
                commentBrush.Dispose();
            }
            brush.Dispose();
            bounds.Y += lineHeight;
            return(new Size(bounds.X, bounds.Y));
        }
Esempio n. 5
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));
            }
        }