コード例 #1
0
        public static MapPictureBox.StaticItem DrawBasePointAddr(uint addr)
        {
            MapPictureBox.StaticItem item = new MapPictureBox.StaticItem();

            uint icon = Program.ROM.u8(addr + 2);

            item.x           = (int)Program.ROM.u16(addr + 24);
            item.y           = (int)Program.ROM.u16(addr + 26);
            item.bitmap      = WorldMapImageForm.DrawWorldMapIcon(icon);
            item.draw_x_add -= item.bitmap.Width / 2;
            item.draw_y_add -= item.bitmap.Height / 2;

            return(item);
        }
コード例 #2
0
        public static void DrawBasePointAddr(Bitmap map, uint addr)
        {
            uint   icon           = Program.ROM.u8(addr + 2);
            uint   x              = Program.ROM.u16(addr + 24);
            uint   y              = Program.ROM.u16(addr + 26);
            Bitmap basepoint      = WorldMapImageForm.DrawWorldMapIcon(icon);
            int    paletteMapping = ImageUtil.FindPalette(map, basepoint);

            if (paletteMapping <= -1)
            {
                paletteMapping = ImageUtil.AppendPalette(map, basepoint);
            }
            ImageUtil.BitBlt(map
                             , (int)x - (basepoint.Width / 2), (int)y - (basepoint.Height / 2)
                             , basepoint.Width, basepoint.Height
                             , basepoint, 0, 0
                             , paletteMapping, 0);
        }
コード例 #3
0
        public static Point GetWorldMapPointPosstion(uint baseid, bool isCenter)
        {
            InputFormRef InputFormRef = Init(null);
            uint         addr         = InputFormRef.IDToAddr(baseid);

            if (!U.isSafetyOffset(addr))
            {
                return(new Point());
            }

            uint x = Program.ROM.u16(addr + 24);
            uint y = Program.ROM.u16(addr + 26);

            if (isCenter)
            {
                uint   icon      = Program.ROM.u8(addr + 2);
                Bitmap basepoint = WorldMapImageForm.DrawWorldMapIcon(icon);
                x = (uint)(x + basepoint.Width / 2);
                y = (uint)(y + basepoint.Height / 2);
            }
            return(new Point((int)x, (int)y));
        }
コード例 #4
0
        private void ChangeComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            uint mapid = (uint)MapSelector.SelectedIndex;

            if (IsWorldmap(mapid))
            {//ワールドマップ
                this.MapBitMap = WorldMapImageForm.DrawWorldMap();
                this.Map.Image = MapBitMap;
            }
            else
            {
                this.MapBitMap = MapSettingForm.DrawMap(mapid, this.MapAnime);
                int change = ChangeComboBox.SelectedIndex;
                if (change >= 1)
                {
                    change = change - 1;
                    List <MapChangeForm.ChangeSt> mapchange = MapChangeForm.MakeChangeList(mapid);
                    if (change < mapchange.Count)
                    {
                        Bitmap c = MapSettingForm.DrawMapChange((uint)mapid
                                                                , (int)mapchange[change].width
                                                                , (int)mapchange[change].height
                                                                , mapchange[change].addr
                                                                , this.MapAnime);
                        ImageUtil.BitBlt(this.MapBitMap
                                         , (int)(mapchange[change].x * 16)
                                         , (int)(mapchange[change].y * 16)
                                         , c.Width
                                         , c.Height
                                         , c, 0, 0);
                        c.Dispose();
                    }
                }

                this.Map.Image = MapBitMap;
            }

            ZoomComboBox_SelectedIndexChanged(null, null);
        }
コード例 #5
0
        void CheckXY()
        {
            if (this.InputFormRef != null && this.InputFormRef.IsUpdateLock)
            {
                this.L_24_MAPXY_26.ErrorMessage = "";
                this.J_26.ErrorMessage          = "";
                return;
            }
            Bitmap icon   = WorldMapImageForm.DrawWorldMapIcon((uint)B2.Value);
            int    width  = icon.Width;
            int    height = icon.Height;

            if (width <= 8)
            {
                int modx = ((int)W24.Value - (width / 2)) % 16;
                if (modx >= 1 && modx <= 8)
                {
                    this.L_24_MAPXY_26.ErrorMessage = "";
                }
                else
                {
                    this.L_24_MAPXY_26.ErrorMessage = R._("この座標はカーソルで選択しにくい可能性があります。\r\nカーソルは16ドット単位で移動します。\r\nそのため、16ドットより幅が小さいオブジェクトは、設置位地を調整する必要があります。");
                }
            }
            if (height <= 8)
            {
                int mody = ((int)W26.Value - (height / 2)) % 16;
                if (mody >= 1 && mody <= 8)
                {
                    this.J_26.ErrorMessage = "";
                }
                else
                {
                    this.J_26.ErrorMessage = R._("この座標はカーソルで選択しにくい可能性があります。\r\nカーソルは16ドット単位で移動します。\r\nそのため、16ドットより幅が小さいオブジェクトは、設置位地を調整する必要があります。");
                }
            }
            icon.Dispose();
        }
コード例 #6
0
ファイル: ListBoxEx.cs プロジェクト: MrMeow76/FEBuilderGBA
        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));
        }
コード例 #7
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));
            }
        }