Пример #1
0
        //リストが拡張されたとき
        void AddressListExpandsEvent(object sender, EventArgs arg)
        {
            InputFormRef.ExpandsEventArgs eearg = (InputFormRef.ExpandsEventArgs)arg;
            uint addr  = eearg.NewBaseAddress;
            int  count = (int)eearg.NewDataCount;

            //戦闘アニメーションを0クリアしておきます。トラブルを避けるため
            //クラスIDもちゃんと割り振ろう
            Undo.UndoData undodata = Program.Undo.NewUndoData(this, "ClearBattleAnimationPointer");
            addr = addr + (eearg.OldDataCount * eearg.BlockSize);
            for (int i = (int)eearg.OldDataCount; i < count; i++)
            {
                //クラスID
                Program.ROM.write_u8(addr + 4, (uint)i, undodata);

                //戦闘アニメクリア
                Program.ROM.write_u32(addr + 52, 0, undodata);

                addr += eearg.BlockSize;
            }

            if (Program.ROM.RomInfo.version() == 8)
            {
                CCBranchForm.ExpandsArea(this, eearg.OldDataCount, (uint)count, undodata);
            }
            if (Program.ROM.RomInfo.is_multibyte())
            {
                OPClassAlphaNameForm.ExpandsArea(this, eearg.OldDataCount, (uint)count, undodata);
            }
            //移動アイコンはクラスIDと連動しているので増設しないといけない.
            ImageUnitMoveIconFrom.ExpandsArea(this, eearg.OldDataCount, (uint)count, undodata);

            Program.Undo.Push(undodata);
        }
Пример #2
0
        //リストが拡張されたとき
        void AddressListExpandsEvent(object sender, EventArgs arg)
        {
            InputFormRef.ExpandsEventArgs eearg = (InputFormRef.ExpandsEventArgs)arg;
            uint addr  = eearg.NewBaseAddress;
            int  count = (int)eearg.NewDataCount;

            //戦闘アニメーションを0クリアしておきます。トラブルを避けるため
            Undo.UndoData undodata = Program.Undo.NewUndoData(this, "ClearBattleAnimationPointer");
            addr = addr + ((eearg.OldDataCount - 1) * eearg.BlockSize);            //-1は class は 0x00から始まるため
            for (int i = (int)eearg.OldDataCount - 1; i < count; i++)
            {
                //クラスID
                Program.ROM.write_u8(addr + 4, (uint)i, undodata);

                //戦闘アニメクリア
                Program.ROM.write_u32(addr + 48, 0, undodata);
                addr += eearg.BlockSize;
            }
            //移動アイコンはクラスIDと連動しているので増設しないといけない.
            ImageUnitMoveIconFrom.ExpandsArea(this, eearg.OldDataCount, (uint)count, undodata);

            Program.Undo.Push(undodata);
        }
Пример #3
0
        //待機アイコン + テキストを書くルーチン
        public static Size DrawImageUnitMoveIconAndText(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 = ImageUnitMoveIconFrom.DrawMoveUnitIconBitmap(icon, 0, 0);

            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));
        }
Пример #4
0
        static void ScanSystem(List <FELint.ErrorSt> errors, List <DisassemblerTrumb.LDRPointer> ldrmap)
        {
            ROMCheck(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageBattleAnimeForm"))
            {
                return;
            }
            ImageBattleAnimeForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageBGForm"))
            {
                return;
            }
            ImageBGForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem UnitForm"))
            {
                return;
            }
            UnitForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ClassForm"))
            {
                return;
            }
            ClassForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ItemForm"))
            {
                return;
            }
            ItemForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem MoveCostForm"))
            {
                return;
            }
            MoveCostForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem PatchForm"))
            {
                return;
            }
            PatchForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitMoveIconFrom"))
            {
                return;
            }
            ImageUnitMoveIconFrom.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitWaitIconFrom"))
            {
                return;
            }
            ImageUnitWaitIconFrom.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ItemEffectPointerForm"))
            {
                return;
            }
            ItemEffectPointerForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitPaletteForm"))
            {
                return;
            }
            ImageUnitPaletteForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageBattleScreen"))
            {
                return;
            }
            ImageBattleScreenForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ImageMagic"))
            {
                return;
            }
            ImageMagicFEditorForm.MakeCheckError(errors);
            ImageMagicCSACreatorForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem Procs"))
            {
                return;
            }
            ProcsScriptForm.MakeCheckError(errors, ldrmap);

            if (InputFormRef.DoEvents(null, "ScanSystem MenuDefinition"))
            {
                return;
            }
            MenuDefinitionForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem EventUnit"))
            {
                return;
            }
            EventUnitForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem AIScript"))
            {
                return;
            }
            AIScriptForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem SongTable"))
            {
                return;
            }
            SongTableForm.MakeCheckError(errors);

            if (InputFormRef.DoEvents(null, "ScanSystem ItemWeaponEffect"))
            {
                return;
            }
            ItemWeaponEffectForm.MakeCheckError(errors);

            if (Program.ROM.RomInfo.version() == 8)
            {
                if (InputFormRef.DoEvents(null, "ScanSystem SoundFootStepsForm"))
                {
                    return;
                }
                SoundFootStepsForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitForm"))
                {
                    return;
                }
                ImagePortraitForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuForm"))
                {
                    return;
                }
                EventHaikuForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkForm"))
                {
                    return;
                }
                EventBattleTalkForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkForm"))
                {
                    return;
                }
                SupportTalkForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportUnitForm"))
                {
                    return;
                }
                SupportUnitForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SoundRoomForm"))
                {
                    return;
                }
                SoundRoomForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EDForm"))
                {
                    return;
                }
                EDForm.MakeCheckError(errors);
            }
            else if (Program.ROM.RomInfo.version() == 7)
            {
                if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitForm"))
                {
                    return;
                }
                ImagePortraitForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuFE7Form"))
                {
                    return;
                }
                EventHaikuFE7Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkFE7Form"))
                {
                    return;
                }
                EventBattleTalkFE7Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkFE7Form"))
                {
                    return;
                }
                SupportTalkFE7Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportUnitForm"))
                {
                    return;
                }
                SupportUnitForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SoundRoomForm"))
                {
                    return;
                }
                SoundRoomForm.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EDForm"))
                {
                    return;
                }
                EDFE7Form.MakeCheckError(errors);
            }
            else
            {
                if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitFE6Form"))
                {
                    return;
                }
                ImagePortraitFE6Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuFE6Form"))
                {
                    return;
                }
                EventHaikuFE6Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkFE6Form"))
                {
                    return;
                }
                EventBattleTalkFE6Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkFE6Form"))
                {
                    return;
                }
                SupportTalkFE6Form.MakeCheckError(errors);

                if (InputFormRef.DoEvents(null, "ScanSystem EDForm"))
                {
                    return;
                }
                EDFE6Form.MakeCheckError(errors);
            }
        }
Пример #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));
            }
        }