コード例 #1
0
        private void X_JUMP_SHINAN_Click(object sender, EventArgs e)
        {
            uint shinan = PatchUtil.SearchShinanTablePatch();

            if (shinan == U.NOT_FOUND)
            {
                return;
            }
            if (this.AddressList.SelectedIndex < 0)
            {
                return;
            }
            uint selected = (uint)this.AddressList.SelectedIndex;
            uint addr     = shinan + (selected * 4);

            if (!U.isSafetyOffset(addr))
            {
                return;
            }
            uint eventAddr = Program.ROM.p32(addr);

            if (!U.isSafetyOffset(eventAddr))
            {
                return;
            }

            EventScriptForm f = (EventScriptForm)InputFormRef.JumpForm <EventScriptForm>(U.NOT_FOUND);

            f.JumpTo(eventAddr);
        }
コード例 #2
0
        //全データの取得
        public static void MakeAllDataLength(List <Address> list)
        {
            List <uint> tracelist = new List <uint>();
            {
                InputFormRef InputFormRef = N_Init(null);
                FEBuilderGBA.Address.AddAddress(list, InputFormRef, "WorldMapEvent ", new uint[] { 0 });

                uint p = InputFormRef.BaseAddress;
                for (int i = 0; i < InputFormRef.DataCount; i++, p += InputFormRef.BlockSize)
                {
                    string name = "WorldMapEvent " + U.To0xHexString(i) + " ";
                    EventScriptForm.ScanScript(list, p, true, true, name, tracelist);
                }
            }
            {
                uint   p    = Program.ROM.RomInfo.ending1_event_pointer();
                string name = R._("エリウッドエンディング");
                EventScriptForm.ScanScript(list, p, true, true, name, tracelist);
            }
            {
                uint   p    = Program.ROM.RomInfo.ending2_event_pointer();
                string name = R._("ヘクトルエンディング");
                EventScriptForm.ScanScript(list, p, true, true, name, tracelist);
            }
        }
コード例 #3
0
        //全データの取得
        public static void MakeAllDataLength(List <Address> list)
        {
            {
                InputFormRef InputFormRef = Init(null);
                FEBuilderGBA.Address.AddAddress(list, InputFormRef, "EventBattleTalk1", new uint[] { 8 });

                List <uint> tracelist = new List <uint>();
                uint        addr      = InputFormRef.BaseAddress;
                for (int i = 0; i < InputFormRef.DataCount; i++, addr += InputFormRef.BlockSize)
                {
                    uint textid = Program.ROM.u16(addr + 4);
                    if (textid <= 0)
                    {
                        continue;
                    }

                    uint spEventP = Program.ROM.u32(addr + 8);
                    if (!U.isSafetyPointer(spEventP))
                    {
                        continue;
                    }
                    uint   unitid     = Program.ROM.u8(addr + 0);
                    string event_name = "EventBattleTalk1" + " " + U.ToHexString(unitid) + " " + UnitForm.GetUnitName(unitid);

                    EventScriptForm.ScanScript(list, addr + 8, true, false, event_name, tracelist);
                }
            }
            {
                InputFormRef InputFormRef = N1_Init(null);
                FEBuilderGBA.Address.AddAddress(list, InputFormRef, "EventBattleTalk2", new uint[] { });
            }
        }
コード例 #4
0
        public static void CheckEvent(uint event_addr, List <ErrorSt> errors, Type cond, uint addr, bool isFixedEvent, List <uint> tracelist)
        {
            if (isFixedEvent == false)
            {
                if (event_addr <= 1)
                {//1は無効イベント
                    return;
                }
            }
            if (!U.isSafetyOffset(event_addr))
            {//無効なアドレス
                errors.Add(new FELint.ErrorSt(cond, U.toOffset(addr)
                                              , R._("イベント「{0}」が無効です。", U.To0xHexString(event_addr))));
                return;
            }

            if (tracelist.IndexOf(event_addr) > 0)
            {//既に探索済み
                return;
            }

            CheckAlien4(event_addr, errors, cond, addr);

            bool isWorldMapEvent = (cond == Type.WORLDMAP_EVENT);

            //有効なイベントなのでチェックする.
            EventScriptForm.CheckEnableEvenet(event_addr, isWorldMapEvent, errors, tracelist);
        }
コード例 #5
0
 private Size Draw(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw)
 {
     if (index < 0 || index >= this.ProcsScript.Count)
     {
         return(new Size(listbounds.X, listbounds.Y));
     }
     EventScript.OneCode code = this.ProcsScript[index];
     return(EventScriptForm.DrawCode(lb, g, listbounds, isWithDraw, code));
 }
コード例 #6
0
        private void OneLineDisassembler()
        {
            int i;

            if (this.ASMTextBox.Text.Length < 8)
            {//命令は最低でも8バイトでないとダメ.
                for (i = this.ASMTextBox.Text.Length; i < 8; i++)
                {
                    this.ASMTextBox.Text += "0";
                }
            }

            //文字列からバイト列に
            byte[] selectedByteData = U.convertStringDumpToByte(this.ASMTextBox.Text);
            if (selectedByteData.Length < 4)
            {
                return;
            }
            string hint = this.ScriptCodeName.Text;

            //バイト列をイベント命令としてDisassembler.
            EventScript.OneCode code = Program.ProcsScript.DisAseemble(selectedByteData, 0, hint);

            //命令を選択.
            this.ScriptCodeName.Text = EventScript.makeCommandComboText(code.Script, false);

            //引数
            int n = 0;

            for (i = 0; i < 2; i++, n++)
            {
                if (n >= code.Script.Args.Length)
                {
                    break;
                }
                EventScript.Arg arg = code.Script.Args[n];
                uint            v   = EventScript.GetArgValue(code, arg);

                if (EventScript.IsFixedArg(arg))
                {//固定長になっているところは入力できないようにする.
                    i--;
                    continue;
                }

                EventScriptForm.SetOneScriptEditSetTables(ScriptEditSetTables[i], arg, v);
            }

            for (; i < 2; i++)
            {
                //使わないパラメータはあっかりーんする
                EventScriptForm.HideOneScriptEditSetTables(ScriptEditSetTables[i]);
            }
            int y = ShowFloatingControlpanelInner(code, this.Script.SelectedIndex);

            ControlPanel.Location = new Point(ControlPanel.Location.X, y);
        }
コード例 #7
0
        private Size DrawEvent(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw)
        {
            if (index < 0 || index >= this.Codes.Count)
            {
                return(new Size(listbounds.X, listbounds.Y));
            }

            //アドレスにあるイベントを表示.
            //EventScript.OneCode code = Program.EventScript.DisAseemble(Program.ROM.Data, U.toOffset(history.EventPackedAddr));
            return(EventScriptForm.DrawCode(lb, g, listbounds, isWithDraw, this.Codes[index]));
        }
コード例 #8
0
        //全データの取得
        public static void MakeAllDataLength(List <Address> list)
        {
            InputFormRef InputFormRef = Init(null);

            FEBuilderGBA.Address.AddAddress(list, InputFormRef, "Haiku", new uint[] { 8 });

            List <uint> tracelist = new List <uint>();
            uint        addr      = InputFormRef.BaseAddress;

            for (int i = 0; i < InputFormRef.DataCount; i++, addr += InputFormRef.BlockSize)
            {
//                uint textid = Program.ROM.u16(addr + 6);
//                if (textid <= 0)
//                {
//                    continue;
//                }

                uint spEventP = Program.ROM.u32(addr + 8);
                if (!U.isSafetyPointer(spEventP))
                {
                    continue;
                }
                uint   unitid     = Program.ROM.u8(addr + 0);
                string event_name = "Haiku" + " " + U.ToHexString(unitid) + " " + UnitForm.GetUnitName(unitid);

                EventScriptForm.ScanScript(list, addr + 8, true, false, event_name, tracelist);
            }

            InputFormRef N1_InputFormRef = N1_Init(null);

            uint[] pointers = new uint[] { Program.ROM.RomInfo.event_haiku_tutorial_1_pointer(), Program.ROM.RomInfo.event_haiku_tutorial_2_pointer() };
            for (int n = 0; n < pointers.Length; n++)
            {
                N1_InputFormRef.ReInitPointer(pointers[n]);
                string name = "Haiku tutorial_" + n;
                FEBuilderGBA.Address.AddAddress(list, InputFormRef, name, new uint[] { 4 });
                addr = N1_InputFormRef.BaseAddress;
                for (int i = 0; i < N1_InputFormRef.DataCount; i++, addr += N1_InputFormRef.BlockSize)
                {
                    uint spEventP = Program.ROM.u32(addr + 4);
                    if (!U.isSafetyPointer(spEventP))
                    {
                        continue;
                    }
                    uint   unitid     = Program.ROM.u8(addr + 0);
                    string event_name = name + " " + U.ToHexString(unitid) + " " + UnitForm.GetUnitName(unitid);

                    EventScriptForm.ScanScript(list, addr + 4, true, false, event_name, tracelist);
                }
            }
        }
コード例 #9
0
        void ParamSrc_Focused(object sender, EventArgs e)
        {
            EventScript.OneCode code;
            int selectID;
            int argindex;

            if (!Get_Select_ParamSrc_Object(sender, out code, out selectID, out argindex))
            {
                return;
            }

            EventScript.Arg arg   = code.Script.Args[argindex];
            uint            value = EventScriptForm.GetValueOneScriptEditSetTables(ScriptEditSetTables[selectID], arg);

            if (arg.Type == EventScript.ArgType.MAPX || arg.Type == EventScript.ArgType.MAPY)
            {
                NumericUpDown xObj;
                NumericUpDown yObj;
                if (arg.Type == EventScript.ArgType.MAPX)
                {
                    xObj = (NumericUpDown)sender;
                    yObj = ScriptEditSetTables[selectID + 1].ParamSrc;
                }
                else
                {
                    xObj = ScriptEditSetTables[selectID - 1].ParamSrc;
                    yObj = (NumericUpDown)sender;
                }
                bool updateLock = false;

                Func <int, int, int> movecallback = (int x, int y) =>
                {
                    if (updateLock)
                    {
                        return(0);
                    }
                    updateLock = true;

                    U.ForceUpdate(xObj, x);
                    U.ForceUpdate(yObj, y);

                    updateLock = false;
                    return(0);
                };
            }
        }
コード例 #10
0
        private void ParamLabel_Clicked(object sender, EventArgs e)
        {
            EventScript.OneCode code;
            int selectID;
            int argindex;

            if (!Get_Select_ParamSrc_Object(sender, out code, out selectID, out argindex))
            {
                return;
            }

            NumericUpDown src_object = ScriptEditSetTables[selectID].ParamSrc;

            EventScript.Arg arg   = code.Script.Args[argindex];
            uint            value = EventScriptForm.GetValueOneScriptEditSetTables(ScriptEditSetTables[selectID], arg);

            if (arg.Type == EventScript.ArgType.POINTER_TEXT)
            {
                CStringForm f = (CStringForm)InputFormRef.JumpForm <CStringForm>();
                f.Init(src_object);
            }
            else if (arg.Type == EventScript.ArgType.POINTER_PROCS)
            {
                ProcsScriptForm f = (ProcsScriptForm)InputFormRef.JumpForm <ProcsScriptForm>(U.NOT_FOUND);
                f.JumpTo(value);
            }
            else if (arg.Type == EventScript.ArgType.POINTER_ASM)
            {
                DisASMForm f = (DisASMForm)InputFormRef.JumpForm <DisASMForm>(U.NOT_FOUND);
                f.JumpTo(DisassemblerTrumb.ProgramAddrToPlain(value));
            }
            else if (arg.Type == EventScript.ArgType.POINTER_AIUNIT)
            {
                AIUnitsForm f = (AIUnitsForm)InputFormRef.JumpFormLow <AIUnitsForm>();
                f.JumpTo(value);
                f.ShowDialog();
                U.SetActiveControl(src_object);
                U.ForceUpdate(src_object, f.GetBaseAddress());
            }
        }
コード例 #11
0
        //全データの取得
        public static void MakeAllDataLength(List <Address> list)
        {
            List <uint> tracelist = new List <uint>();
            uint        mapmax    = MapSettingForm.GetDataCount();

            for (uint mapid = 0; mapid < mapmax; mapid++)
            {
                uint wmapid = MapSettingForm.GetWorldMapEventIDWhereMapID(mapid);
                if (wmapid == 0)
                {//存在しない
                    continue;
                }
                //FE6はPLISTが格納されている.
                uint p;
                uint event_addr = MapPointerForm.PlistToOffsetAddrFast(MapPointerForm.PLIST_TYPE.WORLDMAP_FE6ONLY, wmapid, out p);
                if (event_addr == U.NOT_FOUND)
                {
                    continue;
                }

                string name = "WorldMapEvent " + U.To0xHexString(mapid) + " ";
                EventScriptForm.ScanScript(list, p, true, true, name, tracelist);
            }
        }
コード例 #12
0
        public Size Draw(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw)
        {
            if (index < 0 || index >= lb.Items.Count)
            {
                return(new Size(listbounds.X, listbounds.Y));
            }
            SolidBrush brush            = new SolidBrush(lb.ForeColor);
            SolidBrush foreKeywordBrush = new SolidBrush(OptionForm.Color_Keyword_ForeColor());
            Font       normalFont       = lb.Font;
            Font       boldFont         = new Font(lb.Font, FontStyle.Bold);
            Rectangle  bounds           = listbounds;
            int        lineHeight       = normalFont.Height;

            UseFlagID current = this.FlagList[index];
            string    text;
            int       maxWidth = 0;

            if (index == 0 || current.ID != this.FlagList[index - 1].ID)
            {     //フラグ名を描画
                if (index != 0)
                { //空行を入れる
                    bounds.Y += lineHeight;
                }

                //フラグのアイコンを描画
                Bitmap bitmap = ImageSystemIconForm.FlagIcon();
                U.MakeTransparent(bitmap);

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

                //フラグ名を書く
                string dummy;
                text      = ":";
                bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, bounds);

                text      = U.ToHexString(current.ID);
                bounds.X += U.DrawText(text, g, boldFont, brush, isWithDraw, bounds);

                text      = "  " + InputFormRef.GetFlagName(current.ID, out dummy);
                bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, bounds);

                //次の行へ
                maxWidth  = bounds.X;
                bounds.Y += lineHeight;
                bounds.X  = listbounds.X;
            }

            //名称の表示
            bounds.X += 10;
            text      = MainSimpleMenuEventErrorForm.TypeToString(current.DataType, current.Addr, current.Tag);
            bounds.X += U.DrawText(text, g, boldFont, foreKeywordBrush, isWithDraw, bounds);

            //次の行へ
            maxWidth  = Math.Max(bounds.X, maxWidth);
            bounds.Y += lineHeight;
            bounds.X  = listbounds.X;

            //情報を書く.
            bounds.X += 6;
            text      = current.Info;

            Size ss;

            if (current.DataType == FELint.Type.BATTTLE_TALK || current.DataType == FELint.Type.HAIKU)
            {
                ss = DrawUnitAllowToAllow(text, lb, g, bounds, isWithDraw);
            }
            else if (current.DataType == FELint.Type.EVENT_COND_ALWAYS)
            {
                ss = EventCondForm.DrawEventListAlwaysOneLiner(current.Addr, lb, g, bounds, isWithDraw);
            }
            else if (current.DataType == FELint.Type.EVENT_COND_OBJECT)
            {
                ss = EventCondForm.DrawEventListObjectOneLiner(current.Addr, lb, g, bounds, isWithDraw);
            }
            else if (current.DataType == FELint.Type.EVENT_COND_TALK)
            {
                ss = EventCondForm.DrawEventListTalkOneLiner(current.Addr, lb, g, bounds, isWithDraw);
            }
            else if (current.DataType == FELint.Type.EVENT_COND_TURN)
            {
                ss = EventCondForm.DrawEventListTurnOneLiner(current.Addr, lb, g, bounds, isWithDraw);
            }
            else if (current.DataType == FELint.Type.EVENTSCRIPT)
            {
                EventScript.OneCode code = Program.EventScript.DisAseemble(Program.ROM.Data, current.Tag);
                ss = EventScriptForm.DrawCode(lb, g, bounds, isWithDraw, code);
            }
            else
            {
                bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, bounds);
                bounds.Y += lineHeight;
                ss        = new Size(bounds.X, bounds.Y);
            }
            bounds.X = ss.Width;
            bounds.Y = ss.Height;

            brush.Dispose();
            foreKeywordBrush.Dispose();

            //最後の改行
            maxWidth = Math.Max(bounds.X, maxWidth);
            return(new Size(maxWidth, bounds.Y));
        }
コード例 #13
0
ファイル: MainFE6Form.cs プロジェクト: MrMeow76/FEBuilderGBA
        private void EventScriptButton_Click(object sender, EventArgs e)
        {
            EventScriptForm f = (EventScriptForm)InputFormRef.JumpForm <EventScriptForm>();

            f.JumpTo(0x0);
        }
コード例 #14
0
        public static void GotoEvent(FELint.Type dataType, uint addr, uint tag, uint mapid)
        {
            if (dataType == FELint.Type.EVENTSCRIPT ||
                dataType == FELint.Type.WORLDMAP_EVENT)
            {//イベント内で発生したエラー
                EventScriptForm f = (EventScriptForm)InputFormRef.JumpForm <EventScriptForm>(U.NOT_FOUND);
                f.JumpTo(addr, tag);
                return;
            }
            else if (dataType == FELint.Type.PROCS)
            {
                ProcsScriptForm f = (ProcsScriptForm)InputFormRef.JumpForm <ProcsScriptForm>(U.NOT_FOUND);
                f.JumpTo(addr, tag);
                return;
            }
            else if (dataType == FELint.Type.AISCRIPT)
            {
                AIScriptForm f = (AIScriptForm)InputFormRef.JumpForm <AIScriptForm>(tag);
                return;
            }
            else if (dataType == FELint.Type.MAPSETTING_PLIST_OBJECT ||
                     dataType == FELint.Type.MAPSETTING_PLIST_CONFIG ||
                     dataType == FELint.Type.MAPSETTING_PLIST_MAP ||
                     dataType == FELint.Type.MAPSETTING_PLIST_PALETTE ||
                     dataType == FELint.Type.MAPSETTING_PLIST_MAPCHANGE ||
                     dataType == FELint.Type.MAPSETTING_PLIST_ANIMETION1 ||
                     dataType == FELint.Type.MAPSETTING_PLIST_ANIMETION2 ||
                     dataType == FELint.Type.MAPSETTING_WORLDMAP ||
                     dataType == FELint.Type.MAPSETTING
                     )
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    InputFormRef.JumpForm <MapSettingFE6Form>(mapid);
                }
                else if (Program.ROM.RomInfo.version() == 7)
                {
                    if (!Program.ROM.RomInfo.is_multibyte())
                    {
                        InputFormRef.JumpForm <MapSettingFE7UForm>(mapid);
                    }
                    else
                    {
                        InputFormRef.JumpForm <MapSettingFE7Form>(mapid);
                    }
                }
                else
                {
                    InputFormRef.JumpForm <MapSettingForm>(mapid);
                }
                return;
            }
            else if (dataType == FELint.Type.BATTLE_ANIME)
            {
                ImageBattleAnimeForm f = (ImageBattleAnimeForm)InputFormRef.JumpForm <ImageBattleAnimeForm>(U.NOT_FOUND);
                f.JumpToAnimeID(tag);
                return;
            }
            else if (dataType == FELint.Type.BATTLE_ANIME_CLASS)
            {
                ImageBattleAnimeForm f = (ImageBattleAnimeForm)InputFormRef.JumpForm <ImageBattleAnimeForm>(U.NOT_FOUND);
                f.JumpToClassID(tag);
                return;
            }
            else if (dataType == FELint.Type.BG)
            {
                InputFormRef.JumpForm <ImageBGForm>(tag);
                return;
            }
            else if (dataType == FELint.Type.PORTRAIT)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    InputFormRef.JumpForm <ImagePortraitFE6Form>(tag);
                }
                else
                {
                    InputFormRef.JumpForm <ImagePortraitForm>(tag);
                }
                return;
            }
            else if (dataType == FELint.Type.HAIKU)
            {
                if (Program.ROM.RomInfo.version() == 8)
                {
                    InputFormRef.JumpForm <EventHaikuForm>(tag);
                }
                else if (Program.ROM.RomInfo.version() == 7)
                {
                    InputFormRef.JumpForm <EventHaikuFE7Form>(tag);
                }
                else
                {
                    InputFormRef.JumpForm <EventHaikuFE6Form>(tag);
                }
                return;
            }
            else if (dataType == FELint.Type.BATTTLE_TALK)
            {
                if (Program.ROM.RomInfo.version() == 8)
                {
                    InputFormRef.JumpForm <EventBattleTalkForm>(tag);
                }
                else if (Program.ROM.RomInfo.version() == 7)
                {
                    InputFormRef.JumpForm <EventBattleTalkFE7Form>(tag);
                }
                else
                {
                    InputFormRef.JumpForm <EventBattleTalkFE6Form>(tag);
                }
                return;
            }
            else if (dataType == FELint.Type.SUPPORT_TALK)
            {
                if (Program.ROM.RomInfo.version() == 8)
                {
                    InputFormRef.JumpForm <SupportTalkForm>(tag);
                }
                else if (Program.ROM.RomInfo.version() == 7)
                {
                    InputFormRef.JumpForm <SupportTalkFE7Form>(tag);
                }
                else
                {
                    InputFormRef.JumpForm <SupportTalkFE6Form>(tag);
                }
                return;
            }
            else if (dataType == FELint.Type.SUPPORT_UNIT)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    SupportUnitFE6Form f = (SupportUnitFE6Form)InputFormRef.JumpForm <SupportUnitFE6Form>();
                    f.JumpToAddr(addr);
                }
                else
                {
                    SupportUnitForm f = (SupportUnitForm)InputFormRef.JumpForm <SupportUnitForm>();
                    f.JumpToAddr(addr);
                }
                return;
            }
            else if (dataType == FELint.Type.CLASS)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    InputFormRef.JumpForm <ClassFE6Form>(tag);
                }
                else
                {
                    InputFormRef.JumpForm <ClassForm>(tag);
                }
                return;
            }
            else if (dataType == FELint.Type.ITEM)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    InputFormRef.JumpForm <ItemFE6Form>(tag);
                }
                else
                {
                    InputFormRef.JumpForm <ItemForm>(tag);
                }
                return;
            }
            else if (dataType == FELint.Type.ITEM_WEAPON_EFFECT)
            {
                ItemWeaponEffectForm f = (ItemWeaponEffectForm)InputFormRef.JumpForm <ItemWeaponEffectForm>(U.NOT_FOUND);
                f.JumpTo(tag);
                return;
            }
            else if (dataType == FELint.Type.UNIT)
            {
                if (Program.ROM.RomInfo.version() == 8)
                {
                    InputFormRef.JumpForm <UnitForm>(tag);
                }
                else if (Program.ROM.RomInfo.version() == 7)
                {
                    InputFormRef.JumpForm <UnitFE7Form>(tag);
                }
                else
                {
                    InputFormRef.JumpForm <UnitFE6Form>(tag);
                }
                return;
            }
            else if (dataType == FELint.Type.MAPCHANGE)
            {
                MapChangeForm f = (MapChangeForm)InputFormRef.JumpForm <MapChangeForm>(tag);
                f.JumpToMAPIDAndAddr(mapid, tag);
                return;
            }
            else if (dataType == FELint.Type.SOUND_FOOT_STEPS)
            {
                SoundFootStepsForm f = (SoundFootStepsForm)InputFormRef.JumpForm <SoundFootStepsForm>(tag);
                return;
            }
            else if (dataType == FELint.Type.MOVECOST_NORMAL)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    MoveCostFE6Form f = (MoveCostFE6Form)InputFormRef.JumpForm <MoveCostFE6Form>();
                    f.JumpToClassID(tag, 0 + 1);
                }
                else
                {
                    MoveCostForm f = (MoveCostForm)InputFormRef.JumpForm <MoveCostForm>();
                    f.JumpToClassID(tag, 0 + 1);
                }
                return;
            }
            else if (dataType == FELint.Type.MOVECOST_RAIN)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    MoveCostFE6Form f = (MoveCostFE6Form)InputFormRef.JumpForm <MoveCostFE6Form>();
                    f.JumpToClassID(tag, 1 + 1);
                }
                else
                {
                    MoveCostForm f = (MoveCostForm)InputFormRef.JumpForm <MoveCostForm>();
                    f.JumpToClassID(tag, 1 + 1);
                }
                return;
            }
            else if (dataType == FELint.Type.MOVECOST_SHOW)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    MoveCostFE6Form f = (MoveCostFE6Form)InputFormRef.JumpForm <MoveCostFE6Form>();
                    f.JumpToClassID(tag, 2 + 1);
                }
                else
                {
                    MoveCostForm f = (MoveCostForm)InputFormRef.JumpForm <MoveCostForm>();
                    f.JumpToClassID(tag, 2 + 1);
                }
                return;
            }
            else if (dataType == FELint.Type.MOVECOST_AVOID)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    MoveCostFE6Form f = (MoveCostFE6Form)InputFormRef.JumpForm <MoveCostFE6Form>();
                    f.JumpToClassID(tag, 3 + 1);
                }
                else
                {
                    MoveCostForm f = (MoveCostForm)InputFormRef.JumpForm <MoveCostForm>();
                    f.JumpToClassID(tag, 3 + 1);
                }
                return;
            }
            else if (dataType == FELint.Type.MOVECOST_DEF)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    MoveCostFE6Form f = (MoveCostFE6Form)InputFormRef.JumpForm <MoveCostFE6Form>();
                    f.JumpToClassID(tag, 4 + 1);
                }
                else
                {
                    MoveCostForm f = (MoveCostForm)InputFormRef.JumpForm <MoveCostForm>();
                    f.JumpToClassID(tag, 4 + 1);
                }
                return;
            }
            else if (dataType == FELint.Type.MOVECOST_RES)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    MoveCostFE6Form f = (MoveCostFE6Form)InputFormRef.JumpForm <MoveCostFE6Form>();
                    f.JumpToClassID(tag, 5 + 1);
                }
                else
                {
                    MoveCostForm f = (MoveCostForm)InputFormRef.JumpForm <MoveCostForm>();
                    f.JumpToClassID(tag, 5 + 1);
                }
                return;
            }
            else if (dataType == FELint.Type.OP_CLASS_DEMO)
            {
                if (Program.ROM.RomInfo.version() == 7 && Program.ROM.RomInfo.is_multibyte())
                {
                    InputFormRef.JumpForm <OPClassDemoFE7Form>(tag);
                }
                else if (Program.ROM.RomInfo.version() == 7 && !Program.ROM.RomInfo.is_multibyte())
                {
                    InputFormRef.JumpForm <OPClassDemoFE7UForm>(tag);
                }
                else if (Program.ROM.RomInfo.version() == 8 && Program.ROM.RomInfo.is_multibyte())
                {
                    InputFormRef.JumpForm <OPClassDemoForm>(tag);
                }
                else if (Program.ROM.RomInfo.version() == 8 && !Program.ROM.RomInfo.is_multibyte())
                {
                    InputFormRef.JumpForm <OPClassDemoFE8UForm>(tag);
                }
                return;
            }
            else if (dataType == FELint.Type.WMAP_BASE_POINT)
            {
                if (Program.ROM.RomInfo.version() == 8)
                {
                    InputFormRef.JumpForm <WorldMapPointForm>(tag);
                }
                return;
            }
            else if (dataType == FELint.Type.SOUNDROOM)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    InputFormRef.JumpForm <SoundRoomFE6Form>(tag);
                }
                else
                {
                    InputFormRef.JumpForm <SoundRoomForm>(tag);
                }
                return;
            }
            else if (dataType == FELint.Type.SENSEKI)
            {
                if (Program.ROM.RomInfo.version() == 7)
                {
                    InputFormRef.JumpForm <EDSensekiCommentForm>(tag);
                }
                return;
            }
            else if (dataType == FELint.Type.DIC)
            {
                if (Program.ROM.RomInfo.version() == 8)
                {
                    InputFormRef.JumpForm <TextDicForm>(U.NOT_FOUND);
                }
                return;
            }
            else if (dataType == FELint.Type.MENU)
            {
                MenuCommandForm f = (MenuCommandForm)InputFormRef.JumpForm <MenuCommandForm>();
                f.JumpToAddr(addr);
                return;
            }
            else if (dataType == FELint.Type.STATUS)
            {
                InputFormRef.JumpForm <StatusParamForm>();
                return;
            }
            else if (dataType == FELint.Type.ED)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    InputFormRef.JumpForm <EDFE6Form>();
                }
                else if (Program.ROM.RomInfo.version() == 7)
                {
                    InputFormRef.JumpForm <EDFE7Form>();
                }
                else
                {
                    InputFormRef.JumpForm <EDForm>();
                }
                return;
            }
            else if (dataType == FELint.Type.TERRAIN)
            {
                if (Program.ROM.RomInfo.is_multibyte())
                {
                    InputFormRef.JumpForm <MapTerrainNameForm>();
                }
                else
                {
                    InputFormRef.JumpForm <MapTerrainNameEngForm>();
                }
                return;
            }
            else if (dataType == FELint.Type.SKILL_CONFIG)
            {
                if (Program.ROM.RomInfo.version() == 8)
                {
                    PatchUtil.skill_system_enum skill = PatchUtil.SearchSkillSystem();
                    if (skill == PatchUtil.skill_system_enum.SkillSystem)
                    {
                        InputFormRef.JumpForm <SkillConfigSkillSystemForm>();
                    }
                    else if (skill == PatchUtil.skill_system_enum.FE8N ||
                             skill == PatchUtil.skill_system_enum.yugudora ||
                             skill == PatchUtil.skill_system_enum.FE8N_ver2
                             )
                    {
                        InputFormRef.JumpForm <SkillConfigFE8NSkillForm>();
                    }
                }
                return;
            }
            else if (dataType == FELint.Type.RMENU)
            {
                InputFormRef.JumpForm <StatusRMenuForm>(tag);
                return;
            }
            else if (dataType == FELint.Type.ITEM_USAGE_POINTER)
            {
                InputFormRef.JumpForm <ItemUsagePointerForm>(tag);
                return;
            }
            else if (dataType == FELint.Type.PATCH)
            {
                PatchForm f = (PatchForm)InputFormRef.JumpForm <PatchForm>();
                f.SelectPatchByTag(tag);
                return;
            }
            else if (dataType == FELint.Type.MAPEXIT)
            {
                InputFormRef.JumpForm <MapExitPointForm>(tag);
                return;
            }
            else if (dataType == FELint.Type.IMAGE_UNIT_WAIT_ICON)
            {
                InputFormRef.JumpForm <ImageUnitWaitIconFrom>(tag);
                return;
            }
            else if (dataType == FELint.Type.IMAGE_UNIT_MOVE_ICON)
            {
                InputFormRef.JumpForm <ImageUnitMoveIconFrom>(tag);
                return;
            }
            else if (dataType == FELint.Type.ITEM_EEFECT_POINTER)
            {
                InputFormRef.JumpForm <ItemEffectPointerForm>(tag);
                return;
            }
            else if (dataType == FELint.Type.IMAGE_UNIT_PALETTE)
            {
                InputFormRef.JumpForm <ImageUnitPaletteForm>(tag);
                return;
            }
            else if (dataType == FELint.Type.IMAGE_BATTLE_SCREEN)
            {
                InputFormRef.JumpForm <ImageBattleScreenForm>();
                return;
            }
            else if (dataType == FELint.Type.ASM)
            {
                DisASMForm f = (DisASMForm)InputFormRef.JumpForm <DisASMForm>(U.NOT_FOUND);
                f.JumpTo(DisassemblerTrumb.ProgramAddrToPlain(tag));
                return;
            }
            else if (dataType == FELint.Type.ASMDATA)
            {
                HexEditorForm f = (HexEditorForm)InputFormRef.JumpForm <HexEditorForm>();
                f.JumpTo(tag);
                return;
            }
            else if (dataType == FELint.Type.STATUS_UNITS_MENU)
            {
                InputFormRef.JumpForm <StatusUnitsMenuForm>(tag);
                return;
            }
            else if (dataType == FELint.Type.TEXTID_FOR_SYSTEM)
            {
                return;
            }
            else if (dataType == FELint.Type.TEXTID_FOR_USER)
            {
                return;
            }
            else if (dataType == FELint.Type.POINTER_TALKGROUP)
            {
                EventTalkGroupFE7Form f = (EventTalkGroupFE7Form)InputFormRef.JumpForm <EventTalkGroupFE7Form>();
                f.JumpToAddr(addr);
                return;
            }
            else if (dataType == FELint.Type.POINTER_MENUEXTENDS)
            {
                MenuExtendSplitMenuForm f = (MenuExtendSplitMenuForm)InputFormRef.JumpForm <MenuExtendSplitMenuForm>();
                f.JumpToAddr(addr);
                return;
            }
            else if (dataType == FELint.Type.POINTER_UNITSSHORTTEXT)
            {
                UnitsShortTextForm f = (UnitsShortTextForm)InputFormRef.JumpForm <UnitsShortTextForm>();
                f.JumpTo(addr);
                return;
            }
            else if (dataType == FELint.Type.MAGIC_ANIME_EXTENDS)
            {
                if (tag >= Program.ROM.RomInfo.magic_effect_original_data_count())
                {
                    tag -= Program.ROM.RomInfo.magic_effect_original_data_count();
                }
                ImageUtilMagic.magic_system_enum magic = ImageUtilMagic.SearchMagicSystem();
                if (magic == ImageUtilMagic.magic_system_enum.FEDITOR_ADV)
                {
                    InputFormRef.JumpForm <ImageMagicFEditorForm>(tag);
                }
                else if (magic == ImageUtilMagic.magic_system_enum.CSA_CREATOR)
                {
                    InputFormRef.JumpForm <ImageMagicCSACreatorForm>(tag);
                }
                return;
            }
            else if (dataType == FELint.Type.FELINT_SYSTEM_ERROR)
            {
                InputFormRef.JumpForm <ToolProblemReportForm>();
                return;
            }
            else if (dataType == FELint.Type.STATUS_GAME_OPTION)
            {
                InputFormRef.JumpForm <StatusOptionForm>(tag);
                return;
            }

            //イベント
            {
                EventCondForm f = (EventCondForm)InputFormRef.JumpForm <EventCondForm>(U.NOT_FOUND);
                f.JumpToMAPIDAndAddr(mapid, FELint.TypeToEventCond(dataType), (uint)addr);
            }
        }
コード例 #15
0
        private void JUMP_ENDING2_EVENT_Click(object sender, EventArgs e)
        {
            EventScriptForm f = (EventScriptForm)InputFormRef.JumpForm <EventScriptForm>();

            f.JumpTo((uint)ENDING2_EVENT.Value);
        }
コード例 #16
0
        private void ParamSrc_ValueChanged(object sender, EventArgs e)
        {
            EventScript.OneCode code;
            int selectID;
            int argindex;

            if (!Get_Select_ParamSrc_Object(sender, out code, out selectID, out argindex))
            {
                return;
            }
            if (selectID < 0 || selectID > ScriptEditSetTables.Length)
            {
                return;
            }

            EventScript.Arg arg   = code.Script.Args[argindex];
            uint            value = EventScriptForm.WriteOneScriptEditSetTables(ScriptEditSetTables[selectID], arg, code);

            EventScriptForm.WriteAliasScriptEditSetTables(ScriptEditSetTables[selectID], arg, code);

            bool   isOrderOfHuman  = (this.ActiveControl == sender); //人間の操作によるものか
            string text            = "";
            Bitmap backgroundImage = null;
            string errorMessage    = "";

            if (arg.Type == EventScript.ArgType.TEXT ||
                arg.Type == EventScript.ArgType.CONVERSATION_TEXT ||
                arg.Type == EventScript.ArgType.SYSTEM_TEXT ||
                arg.Type == EventScript.ArgType.ONELINE_TEXT
                )
            {
                text = TextForm.DirectAndStripAllCode((value));
            }
            else if (arg.Type == EventScript.ArgType.POINTER_TEXT)
            {
                text = TextForm.Direct(value);
            }
            else if (arg.Type == EventScript.ArgType.POINTER_PROCS)
            {
                text = Program.AsmMapFileAsmCache.GetASMName(value, AsmMapFileAsmCache.ASMTYPE.NONE, out errorMessage);
            }
            else if (arg.Type == EventScript.ArgType.POINTER_ASM)
            {
                text = Program.AsmMapFileAsmCache.GetASMName(value, AsmMapFileAsmCache.ASMTYPE.THUMB, out errorMessage);
            }
            else if (arg.Type == EventScript.ArgType.FSEC)
            {//FSEC
                text = InputFormRef.GetFSEC(value);
            }
            else if (arg.Type == EventScript.ArgType.MAPXY)
            {//MAPXY
                if (arg.Size == 4)
                {
                    text = InputFormRef.GetMAPXY32(value);
                }
                else
                {
                    text = InputFormRef.GetMAPXY16(value);
                }
            }

            ScriptEditSetTables[selectID].ParamValue.Text            = text;
            ScriptEditSetTables[selectID].ParamValue.BackgroundImage = backgroundImage;
            ScriptEditSetTables[selectID].ParamValue.ErrorMessage    = errorMessage;

            if (isOrderOfHuman)
            {//現在このコントロールから値を入力している場合は、他のコントロールも連動して変更する
                this.ASMTextBox.Text = U.convertByteToStringDump(code.ByteData);

                //変更があったので、変更ボタンを光らせる.
                InputFormRef.WriteButtonToYellow(this.UpdateButton, true);
                InputFormRef.WriteButtonToYellow(this.NewButton, true);
            }
        }
コード例 #17
0
        private void Script_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Control && e.KeyCode == Keys.Z)
            {
                RunUndo();
                return;
            }
            else if (e.Control && e.KeyCode == Keys.Y)
            {
                RunRedo();
                return;
            }
            else if (e.KeyCode == Keys.Enter)
            {
                ShowFloatingControlpanel();
                return;
            }

            int i = this.Script.SelectedIndex;

            if (i < 0)
            {
                return;
            }

            if (e.Control && e.KeyCode == Keys.C)
            {
                U.SetClipboardText(EventToTextOne(i));
                this.Script.SelectedIndex = i;
            }
            else if (e.Control && e.KeyCode == Keys.V)
            {
                TextToEvent(Clipboard.GetText(), i);
            }
            else if (e.KeyCode == Keys.Delete)
            {
                RemoveButton_Click(null, null);
            }
            else if (e.Control && e.KeyCode == Keys.J)
            {
                ShowFloatingControlpanel();
                EventScriptForm.DirectJump(0, this.ScriptEditSetTables, ParamLabel_Clicked);
                return;
            }
            else if (e.Alt && e.KeyCode == Keys.J)
            {
                ShowFloatingControlpanel();
                EventScriptForm.DirectJump(1, this.ScriptEditSetTables, ParamLabel_Clicked);
                return;
            }
            else if (e.Control && e.KeyCode == Keys.N)
            {
                ChangeDirect();
                return;
            }
            else if ((e.Control && e.KeyCode == Keys.Divide) || (e.Control && e.KeyCode == Keys.OemQuestion))
            {
                ChangeComment();
                return;
            }
        }