示例#1
0
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            int filter = this.FilterComboBox.SelectedIndex;

            if (filter == 6 || filter == 7)
            {//地形回復/地形ステータス異常回復 全クラス共通
                IndependenceButton.Enabled = false;
                CLASS_LISTBOX.Items.Clear();
                CLASS_LISTBOX.Items.Add(R._("全クラス共通"));
                return;
            }

            uint selectAddr = (uint)this.Address.Value;

            List <U.AddrResult> list =
                ClassForm.MakeClassList((uint addr) =>
            {
                uint p = ClassForm.GetMoveCostAddrLow(addr, (uint)this.FilterComboBox.SelectedIndex);

                return(p == selectAddr);
            }
                                        );

            U.ConvertListBox(list, ref this.CLASS_LISTBOX);

            //クラスが2つ以上あるなら分離ボタンを有効かする
            IndependenceButton.Enabled = (list.Count >= 2);
        }
        //エラーチェック
        public static void MakeCheckError(List <FELint.ErrorSt> errors)
        {
            InputFormRef N_InputFormRef = N_Init(null);

            bool isFE6 = (Program.ROM.RomInfo.version == 6);

            if (!isFE6)
            {//FE6の場合、パラディンなどが手斧モーションを持っていない.
             //そのため、FE7,FE8だけチェックします.
                InputFormRef InputFormRef = Init(null);

                List <U.AddrResult> handAxsItems = ItemForm.MakeItemListByHandAxs();
                List <U.AddrResult> classList    = ClassForm.MakeClassList();
                for (uint cid = 1; cid < classList.Count; cid++)
                {
                    uint pointer;
                    uint class_addr = classList[(int)cid].addr;
                    uint addr       = ClassForm.GetBattleAnimeAddrWhereAddr(class_addr, out pointer);
                    if (addr == 0)
                    {
                        continue;
                    }
                    if (!U.isSafetyOffset(addr))
                    {
                        errors.Add(new FELint.ErrorSt(FELint.Type.CLASS, class_addr
                                                      , R._("クラス({0})の{1}のポインタ({2})が危険です。"
                                                            , classList[(int)cid].name, R._("戦闘アニメ"), U.To0xHexString(addr)), cid));
                        continue;
                    }

                    InputFormRef.ReInit(addr);
                    MakeCheckErrorAxs(InputFormRef, N_InputFormRef
                                      , handAxsItems, classList, cid, errors);
                }
            }

            {
                if (N_InputFormRef.DataCount < 10)
                {
                    errors.Add(new FELint.ErrorSt(FELint.Type.BATTLE_ANIME, U.NOT_FOUND
                                                  , R._("戦闘アニメが極端に少ないです。破損している可能性があります。")));
                }

                List <uint> seatNumberList = new List <uint>(256);
                uint        p = N_InputFormRef.BaseAddress;
                for (int i = 0; i < N_InputFormRef.DataCount; i++, p += N_InputFormRef.BlockSize)
                {
                    if (isFE6 && i == 0x6c)
                    {
                        continue;
                    }
                    ImageUtilOAM.MakeCheckError(errors, p, (uint)(i), seatNumberList);
                }
            }
        }
        public UnitCustomBattleAnimeForm()
        {
            InitializeComponent();

            ImageBattleAnimeForm.MakeComboBattleAnimeSP(L_1_BATTLEANIMESP_0);

            U.ConvertListBox(ClassForm.MakeClassList(), ref this.N2_AddressList);
            this.InputFormRef = Init(this);
            this.InputFormRef.PostAddressListExpandsEvent += AddressListExpandsEvent;

            this.N2_InputFormRef = N2_Init(this);
            this.N2_InputFormRef.PostAddressListExpandsEvent += N2_AddressListExpandsEvent;
        }
        //全データの取得
        public static void MakeAllDataLength(List <Address> list, bool isPointerOnly)
        {
            string       selfname;
            InputFormRef InputFormRef = Init(null);

            uint addr;
            List <U.AddrResult> classList = ClassForm.MakeClassList();

            for (uint cid = 0; cid < classList.Count; cid++)
            {
                uint pointer;
                uint class_addr = classList[(int)cid].addr;
                addr = ClassForm.GetBattleAnimeAddrWhereAddr(class_addr, out pointer);
                if (!U.isSafetyOffset(addr))
                {
                    continue;
                }
                InputFormRef.ReInitPointer(pointer);

                selfname = "BattleAnimeSeting:" + U.To0xHexString(cid);
                FEBuilderGBA.Address.AddAddress(list, InputFormRef
                                                , selfname, new uint[] { });
            }

            selfname = "BattleAnime";
            InputFormRef N_InputFormRef = N_Init(null);

            FEBuilderGBA.Address.AddAddress(list, N_InputFormRef, selfname, new uint[] { 12, 16, 20, 24, 28 });

            //戦闘アニメーションはlz77圧縮の中にポインタがある特殊形式です
            addr = N_InputFormRef.BaseAddress;
            List <uint> seatNumberList = new List <uint>(256);

            for (int i = 0; i < N_InputFormRef.DataCount; i++, addr += N_InputFormRef.BlockSize)
            {
                if (!U.isSafetyOffset(12 + addr + 4))
                {
                    break;
                }

                uint section = Program.ROM.p32(12 + addr);
                if (!U.isSafetyOffset(section))
                {
                    break;
                }
                selfname = "BattleAnime:" + U.To0xHexString(i + 1);
                ImageUtilOAM.MakeAllDataLength(list, isPointerOnly, selfname, addr, seatNumberList);
            }
        }
        public ImageBattleAnimeForm()
        {
            InitializeComponent();

            MakeComboBattleAnimeSP(L_1_BATTLEANIMESP_0);

            InputFormRef.markupJumpLabel(LinkInternt);

            InputFormRef.LoadComboResource(ShowSectionCombo, U.ConfigDataFilename("battleanime_mode_"));
            U.SelectedIndexSafety(ShowSectionCombo, 0);
            U.SelectedIndexSafety(ShowDirectionComboBox, 0);
            U.SelectedIndexSafety(ShowZoomComboBox, 0);
            U.SelectedIndexSafety(ShowPaletteComboBox, 0);

//            X_LZ77_INFO.ForeColor = OptionForm.Color_InputDecimal_ForeColor();
//            X_LZ77_INFO.BackColor = OptionForm.Color_InputDecimal_BackColor();

            this.CLASS_LISTBOX.OwnerDraw(ListBoxEx.DrawClassAndText, DrawMode.OwnerDrawFixed);
            this.CLASS_LISTBOX.ItemListToJumpForm("CLASS");
            U.ConvertListBox(ClassForm.MakeClassList(), ref this.CLASS_LISTBOX);


            this.AddressList.OwnerDraw(ListBoxEx.DrawImageSPTypeAndText, DrawMode.OwnerDrawFixed);
            this.N_AddressList.OwnerDraw(ListBoxEx.DrawImageBattleAndText, DrawMode.OwnerDrawFixed);

            this.InputFormRef   = Init(this);
            this.N_InputFormRef = N_Init(this);

            this.InputFormRef.MakeGeneralAddressListContextMenu(true);
            this.N_InputFormRef.MakeGeneralAddressListContextMenu(true);

            this.InputFormRef.AddressListExpandsEvent += AddressListExpandsEvent;
            U.SelectedIndexSafety(this.CLASS_LISTBOX, 1, false);

            //パレット変更の部分にリンクを置く.
            InputFormRef.markupJumpLabel(this.N_J_28);

            U.SetIcon(BattleAnimeImportButton, Properties.Resources.icon_upload);
            U.SetIcon(BattleAnimeExportButton, Properties.Resources.icon_arrow);
            U.SetIcon(X_N_JumpEditor, Properties.Resources.icon_film);

            U.AllowDropFilename(this, new string[] { ".TXT", ".BIN" }, (string filename) =>
            {
                using (ImageFormRef.AutoDrag ad = new ImageFormRef.AutoDrag(filename))
                {
                    this.BattleAnimeImportButton_Click(null, null);
                }
            });
        }
        public static string GetBattleAnimeHint(uint search_animeindex)
        {
            List <U.AddrResult> classlist = ClassForm.MakeClassList();

            for (int cid = 0; cid < classlist.Count; cid++)
            {
                uint addr = ClassForm.GetBattleAnimeAddrWhereID((uint)cid);
                if (!U.isSafetyOffset(addr))
                {
                    continue;
                }
                for (uint i = 0; true; i += 4)
                {
                    uint a = addr + i;
                    if (!U.isSafetyOffset(a + 3))
                    {
                        break;
                    }

                    uint item  = Program.ROM.u8(a + 0);
                    uint sp    = Program.ROM.u8(a + 1);
                    uint anime = Program.ROM.u16(a + 2);
                    if (item == 0 && sp == 0 && anime == 0)
                    {
                        break;
                    }
                    if (anime != search_animeindex)
                    {
                        continue;
                    }
                    //発見!
                    string name = U.skip(classlist[cid].name, " ").Trim();
                    return(name + " " + getSPTypeName(item, sp));
                }
            }

            //ない
            return("");
        }
示例#7
0
        public static void MakeCheckError(List <FELint.ErrorSt> errors)
        {
            bool         isFE6        = (Program.ROM.RomInfo.version() == 6);
            InputFormRef InputFormRef = Init(null);

            List <U.AddrResult> classList = ClassForm.MakeClassList();

            for (uint cid = 1; cid < classList.Count; cid++)
            {
                uint class_addr = classList[(int)cid].addr;
                if (isFE6)
                {
                    uint addr = Program.ROM.p32(class_addr + 52);
                    MakeCheckErrorOneMove(FELint.Type.MOVECOST_NORMAL, addr, cid, classList, errors);
                    addr = Program.ROM.p32(class_addr + 56);
                    MakeCheckErrorOneAvoid(FELint.Type.MOVECOST_AVOID, addr, cid, classList, errors);
                    addr = Program.ROM.p32(class_addr + 60);
                    MakeCheckErrorOneAvoid(FELint.Type.MOVECOST_DEF, addr, cid, classList, errors);
                    addr = Program.ROM.p32(class_addr + 64);
                    MakeCheckErrorOneAvoid(FELint.Type.MOVECOST_RES, addr, cid, classList, errors);
                }
                else
                {
                    uint addr = Program.ROM.p32(class_addr + 56);
                    MakeCheckErrorOneMove(FELint.Type.MOVECOST_NORMAL, addr, cid, classList, errors);
                    addr = Program.ROM.p32(class_addr + 60);
                    MakeCheckErrorOneMove(FELint.Type.MOVECOST_RAIN, addr, cid, classList, errors);
                    addr = Program.ROM.p32(class_addr + 64);
                    MakeCheckErrorOneMove(FELint.Type.MOVECOST_SHOW, addr, cid, classList, errors);
                    addr = Program.ROM.p32(class_addr + 68);
                    MakeCheckErrorOneAvoid(FELint.Type.MOVECOST_AVOID, addr, cid, classList, errors);
                    addr = Program.ROM.p32(class_addr + 72);
                    MakeCheckErrorOneAvoid(FELint.Type.MOVECOST_DEF, addr, cid, classList, errors);
                    addr = Program.ROM.p32(class_addr + 76);
                    MakeCheckErrorOneAvoid(FELint.Type.MOVECOST_RES, addr, cid, classList, errors);
                }
            }
        }
示例#8
0
        string MakeNMMDropDownList(InputFormRef ifr, string basefilename, Dictionary <string, string> addFiles, List <Control> controls, string linktype, int num)
        {
            string filename = basefilename + linktype + ".txt";

            if (addFiles.ContainsKey(linktype))
            {
                return(addFiles[filename]);
            }

            string data = "";

            if (linktype == "INDEX")
            {
                data = MakeNMMDropDownListInner(ifr.MakeList());
            }
            else if (linktype == "PORTRAIT")
            {
                data = MakeNMMDropDownListInner(ImagePortraitForm.MakePortraitList());
            }
            else if (linktype == "UNIT")
            {
                List <U.AddrResult> list = UnitForm.MakeUnitList();
                data = MakeNMMDropDownListInner(list);
            }
            else if (linktype == "CLASS")
            {
                data = MakeNMMDropDownListInner(ClassForm.MakeClassList());
            }
            else if (linktype == "ITEM")
            {
                data = MakeNMMDropDownListInner(ItemForm.MakeItemList());
            }
            else if (linktype == "SONG")
            {
                data = MakeNMMDropDownListInner(SongTableForm.MakeItemList());
            }
            else if (linktype == "COMBO")
            {
                Control c = InputFormRef.FindObject(ifr.Prefix, controls, num + "_" + linktype);
                if (c is ComboBox)
                {
                    data = MakeNMMDropDownListInner((ComboBox)c);
                    data = string.Join("\r\n", U.ComboBoxToStringList((ComboBox)c));
                }
            }
            else if (linktype == "ATTRIBUTE")
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("8");
                for (uint n = 0; n < 8; n++)
                {
                    sb.AppendLine(U.To0xHexString(n) + " " + InputFormRef.GetAttributeName(n));
                }
                data = sb.ToString();
            }
            else if (linktype == "WEAPON")
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("7");
                sb.AppendLine("0x0 -");
                sb.AppendLine("0x1 E");
                sb.AppendLine("0x31 D");
                sb.AppendLine("0x71 C");
                sb.AppendLine("0x121 B");
                sb.AppendLine("0x181 A");
                sb.AppendLine("0x251 S");
                data = sb.ToString();
            }
            else if (linktype == "FLAG")
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("128");
                string dummy;
                for (uint n = 0; n < 128; n++)
                {
                    sb.AppendLine(U.To0xHexString(n) + " " + InputFormRef.GetFlagName(n, out dummy));
                }
                data = sb.ToString();
            }
            else if (linktype == "BIT")
            {
                filename = basefilename + linktype + num + ".txt";
                if (addFiles.ContainsKey(linktype))
                {
                    return(addFiles[filename]);
                }

                data = MakeBitsListInner(ifr, controls, linktype, num);
            }

            if (data == "")
            {
                return("NULL");
            }
            addFiles[filename] = data;
            return(filename);
        }