コード例 #1
0
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.X_ICON_PIC.Image     = DrawIcon((uint)this.Address.Value);
            this.X_ICON_BIG_PIC.Image = DrawIcon((uint)this.Address.Value);

            U.ConvertListBox(ItemForm.MakeItemListByUseIcon((uint)this.AddressList.SelectedIndex),
                             ref this.X_ICON_REF_ITEM);
        }
コード例 #2
0
        //エラーチェック
        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);
                }
            }
        }
コード例 #3
0
        public void InitExportFilter(uint filter)
        {
            List <UseValsID> list = new List <UseValsID>();

            if (filter == 1)
            {//ユニット関係のみ
                UnitForm.MakeVarsIDArray(list);
            }
            else if (filter == 2)
            {//クラス関係のみ
                ClassForm.MakeVarsIDArray(list);
            }
            else if (filter == 3)
            {//アイテム関係のみ
                ItemForm.MakeVarsIDArray(list);
            }
            else if (filter == 4)
            {//サウンドルーム関係のみ
                if (Program.ROM.RomInfo.version == 6)
                {
                    SoundRoomFE6Form.MakeVarsIDArray(list);
                }
                else
                {
                    SoundRoomForm.MakeVarsIDArray(list);
                }
            }
            else if (filter == 5)
            {//支援会話関係
                SupportTalkForm.MakeVarsIDArray(list);
            }
            else if (filter == 6)
            {//スキル関係
                if (Program.ROM.RomInfo.is_multibyte)
                {
                    SkillConfigFE8NSkillForm.MakeVarsIDArray(list);
                    SkillConfigFE8NVer2SkillForm.MakeVarsIDArray(list);
                }
                else
                {
                    SkillConfigSkillSystemForm.MakeVarsIDArray(list);
                }
            }
            else
            {//all
                ExportFilterArray = null;
                return;
            }

            ExportFilterArray = new Dictionary <int, bool>();
            foreach (UseValsID val in list)
            {
                ExportFilterArray[(int)val.ID] = true;
            }
        }
コード例 #4
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , 0
                             , 4
                             , (int i, uint addr) =>
     {
         return false;
     }
                             , (int i, uint addr) =>
     {
         uint baseaddr = addr - (uint)(4 * i);
         uint itemID = 0;
         if (baseaddr == Program.ROM.p32(Program.ROM.RomInfo.item_usability_array_pointer()))
         {
             itemID = Program.ROM.u8(Program.ROM.RomInfo.item_usability_array_switch2_address()) + (uint)i;
         }
         else if (baseaddr == Program.ROM.p32(Program.ROM.RomInfo.item_effect_array_pointer()))
         {
             itemID = Program.ROM.u8(Program.ROM.RomInfo.item_effect_array_switch2_address()) + (uint)i;
         }
         else if (baseaddr == Program.ROM.p32(Program.ROM.RomInfo.item_promotion1_array_pointer()))
         {
             itemID = Program.ROM.u8(Program.ROM.RomInfo.item_promotion1_array_switch2_address()) + (uint)i;
         }
         else if (baseaddr == Program.ROM.p32(Program.ROM.RomInfo.item_promotion2_array_pointer()))
         {
             itemID = Program.ROM.u8(Program.ROM.RomInfo.item_promotion2_array_switch2_address()) + (uint)i;
         }
         else if (baseaddr == Program.ROM.p32(Program.ROM.RomInfo.item_staff1_array_pointer()))
         {
             itemID = Program.ROM.u8(Program.ROM.RomInfo.item_staff1_array_switch2_address()) + (uint)i;
         }
         else if (baseaddr == Program.ROM.p32(Program.ROM.RomInfo.item_staff2_array_pointer()))
         {
             itemID = Program.ROM.u8(Program.ROM.RomInfo.item_staff2_array_switch2_address()) + (uint)i;
         }
         else if (baseaddr == Program.ROM.p32(Program.ROM.RomInfo.item_statbooster1_array_pointer()))
         {
             itemID = Program.ROM.u8(Program.ROM.RomInfo.item_statbooster1_array_switch2_address()) + (uint)i;
         }
         else if (baseaddr == Program.ROM.p32(Program.ROM.RomInfo.item_statbooster2_array_pointer()))
         {
             itemID = Program.ROM.u8(Program.ROM.RomInfo.item_statbooster2_array_switch2_address()) + (uint)i;
         }
         else
         {
             return "";
         }
         //Log.Debug(U.ToHexString(U.toPointer(Program.ROM.p32(addr)))+"="+ItemForm.GetItemName(itemID));
         return U.ToHexString(itemID) + " " + ItemForm.GetItemName(itemID);
     }
                             ));
 }
コード例 #5
0
 public static string getSPTypeName(uint b0, uint b1)
 {
     if (b1 == 0)
     {//アイテム指定 b0はアイテム名
         return(ItemForm.GetItemName(b0));
     }
     else if (b1 == 1)
     {//種類指定
         return(InputFormRef.GetWeaponName(b0));
     }
     return("??");
 }
コード例 #6
0
        public static Bitmap DrawItemIconOnly(uint addr, int itemcount)
        {
            uint p = addr + 8 + (uint)itemcount;

            if (!U.isSafetyZArray(p))
            {
                return(ImageUtil.BlankDummy());
            }
            uint item_id = Program.ROM.u8(p);

            return(ItemForm.DrawIcon(item_id));
        }
コード例 #7
0
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            //該当アイテム.
            uint selectaddress       = (uint)this.Address.Value;
            List <U.AddrResult> list = ItemForm.MakeItemList((uint addr) =>
            {
                uint ITEMSTATBOOSTER = Program.ROM.p32(addr + 12);
                return(selectaddress == ITEMSTATBOOSTER);
            }
                                                             );

            U.ConvertListBox(list, ref this.ItemListBox);
        }
コード例 #8
0
        public static string GetName(uint id)
        {
            InputFormRef InputFormRef = Init(null);
            uint         addr         = InputFormRef.IDToAddr(id);

            if (!U.isSafetyOffset(addr))
            {
                return("");
            }
            uint item_id = (uint)Program.ROM.u8(addr);

            return(ItemForm.GetItemName(item_id));
        }
コード例 #9
0
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            //該当アイテム.
            uint selectaddress       = (uint)this.Address.Value;
            List <U.AddrResult> list = ItemForm.MakeItemList((uint addr) =>
            {
                uint itemCritical = Program.ROM.p32(addr + 16);
                return(selectaddress == itemCritical);
            }
                                                             );

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

            this.N_InputFormRef.ReInit(selectaddress);
        }
コード例 #10
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.ai_preform_item_pointer
                             , 8
                             , (int i, uint addr) =>
     {
         return Program.ROM.u16(addr) != 0x0;
     }
                             , (int i, uint addr) =>
     {
         uint item_id = Program.ROM.u16(addr);
         return U.ToHexString(item_id) + " " + ItemForm.GetItemName(item_id);
     }
                             ));
 }
コード例 #11
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , 0
                             , 2
                             , (int i, uint addr) =>
     {
         return Program.ROM.u8(addr) != 0x00;
     }
                             , (int i, uint addr) =>
     {
         uint item_id = Program.ROM.u8(addr);
         return U.ToHexString(item_id) + " " + ItemForm.GetItemName(item_id);
     }
                             ));
 }
コード例 #12
0
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            //該当アイテム.
            uint selectaddress       = (uint)this.Address.Value;
            List <U.AddrResult> list = ItemForm.MakeItemList((uint addr) =>
            {
                uint itemCritical = Program.ROM.p32(addr + 16);
                return(selectaddress == itemCritical);
            }
                                                             );

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

            this.N_InputFormRef.ReInit(selectaddress);

            //他のアイテムでこのデータを参照しているならば、独立ボタンを出す.
            IndependencePanel.Visible = UpdateIndependencePanel();
        }
コード例 #13
0
 static InputFormRef N_Init(Form self)
 {
     return(new InputFormRef(self
                             , "N_"
                             , Program.ROM.RomInfo.arena_enemy_weapon_rankup_pointer()
                             , 1
                             , (int i, uint addr) =>
     {
         return i < 0x1A;
     }
                             , (int i, uint addr) =>
     {
         string disp;
         uint icon;
         uint itemid = Program.ROM.u8(addr);
         return U.ToHexString(itemid) + " " + ItemForm.GetItemName(itemid) + " (" + GetRankupTypeName(i, out disp, out icon) + ")";
     }
                             ));
 }
コード例 #14
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.arena_enemy_weapon_basic_pointer
                             , 1
                             , (int i, uint addr) =>
     {
         return i < 8;
     }
                             , (int i, uint addr) =>
     {
         string disp;
         uint icon;
         uint itemid = Program.ROM.u8(addr);
         return U.ToHexString(itemid) + " " + ItemForm.GetItemName(itemid) + " (" + GetBasicTypeName(i, out disp, out icon) + ")";
     }
                             ));
 }
コード例 #15
0
ファイル: ListBoxEx.cs プロジェクト: MrMeow76/FEBuilderGBA
        //Item + テキストを書く
        public static Size DrawItemAndText(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 = ItemForm.DrawIcon(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);

            //テキストを描く.
            b         = bounds;
            b.Y      += textmargineY;
            bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, b);


            bitmap.Dispose();
            brush.Dispose();

            bounds.Y += OWNER_DRAW_ICON_SIZE;
            return(new Size(bounds.X, bounds.Y));
        }
コード例 #16
0
 static InputFormRef N4_Init(Form self)
 {
     return(new InputFormRef(self
                             , "N4_"
                             , 0
                             , 1
                             , (int i, uint addr) =>
     {    //読込最大値検索
         uint a = Program.ROM.u8(addr);
         if (a == 0)
         {
             return false;
         }
         return true;
     }
                             , (int i, uint addr) =>
     {
         uint itemid = Program.ROM.u8(addr);
         return U.ToHexString(itemid) + " " + ItemForm.GetItemName(itemid);
     }
                             ));
 }
コード例 #17
0
        private void IndependenceButton_Click(object sender, EventArgs e)
        {
            if (this.ItemListBox.SelectedIndex < 0)
            {
                return;
            }

            uint   itemid   = (uint)U.atoh(this.ItemListBox.Text);
            uint   itemaddr = ItemForm.GetItemAddr(itemid);
            string name     = U.ToHexString(itemid) + " " + ClassForm.GetClassNameLow(itemaddr);

            uint pointer;
            uint currentP = ItemForm.GetEFFECTIVENESSPointerWhereID(itemid, out pointer);

            if (!U.isSafetyOffset(currentP))
            {
                return;
            }
            if (InputFormRef.DataCount == 0)
            {
                DialogResult dr = R.ShowNoYes("リストが0件です。\r\n空のリストを分離させても意味がないのですが、それでも分離独立させますか?");
                if (dr != DialogResult.Yes)
                {
                    return;
                }
            }

            Undo.UndoData undodata = Program.Undo.NewUndoData(this, this.Name + " Independence");

            uint dataSize = (InputFormRef.DataCount + 1) * InputFormRef.BlockSize;

            PatchUtil.WriteIndependence(currentP, dataSize, pointer, name, undodata);
            Program.Undo.Push(undodata);

            InputFormRef.ShowWriteNotifyAnimation(this, currentP);

            ReselectItem(itemid);
        }
コード例 #18
0
        private void MakeCCItemList()
        {
            uint id;

            id = Program.ROM.RomInfo.cc_item_hero_crest_itemid();
            this.ITEM_LIST.Items.Add(U.ToHexString(id) + " " + ItemForm.GetItemName(id));

            id = Program.ROM.RomInfo.cc_item_knight_crest_itemid();
            this.ITEM_LIST.Items.Add(U.ToHexString(id) + " " + ItemForm.GetItemName(id));

            id = Program.ROM.RomInfo.cc_item_orion_bolt_itemid();
            this.ITEM_LIST.Items.Add(U.ToHexString(id) + " " + ItemForm.GetItemName(id));

            id = Program.ROM.RomInfo.cc_elysian_whip_itemid();
            this.ITEM_LIST.Items.Add(U.ToHexString(id) + " " + ItemForm.GetItemName(id));

            id = Program.ROM.RomInfo.cc_guiding_ring_itemid();
            this.ITEM_LIST.Items.Add(U.ToHexString(id) + " " + ItemForm.GetItemName(id));

            if (Program.ROM.RomInfo.version() >= 7)
            {
                id = Program.ROM.RomInfo.cc_fallen_contract_itemid();
                this.ITEM_LIST.Items.Add(U.ToHexString(id) + " " + ItemForm.GetItemName(id));

                id = Program.ROM.RomInfo.cc_master_seal_itemid();
                this.ITEM_LIST.Items.Add(U.ToHexString(id) + " " + ItemForm.GetItemName(id));

                id = Program.ROM.RomInfo.cc_ocean_seal_itemid();
                this.ITEM_LIST.Items.Add(U.ToHexString(id) + " " + ItemForm.GetItemName(id));

                id = Program.ROM.RomInfo.cc_moon_bracelet_itemid();
                this.ITEM_LIST.Items.Add(U.ToHexString(id) + " " + ItemForm.GetItemName(id));

                id = Program.ROM.RomInfo.cc_sun_bracelet_itemid();
                this.ITEM_LIST.Items.Add(U.ToHexString(id) + " " + ItemForm.GetItemName(id));
            }
        }
コード例 #19
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);
            }
        }
コード例 #20
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);
        }
コード例 #21
0
        //ROM読みこみに伴うシステムの初期化.
        static void InitSystem(string fullfilename)
        {
            Log.Notify("InitSystem:", Path.GetFileName(ROM.Filename), "ver:", ROM.RomInfo.VersionToFilename, "length:", ROM.Data.Length.ToString("X"), "FEBuilderGBA:", U.getVersion());

            //Undoバッファの準備
            Undo = new Undo();


            //数を求める部分はあまりにたくさん呼び出すのでキャッシュすることにしました.
            InputFormRef.ClearCacheDataCount();
            //パッチのインストールの是非の判定 FE8には策パッチがあるのでキャッシュする.
            PatchForm.ClearCheckIF();

            if (fullfilename != "")
            {
                //変更監視
                UpdateWatcher.RegistMain(fullfilename);
            }


            //tbl適応判定
            OptionForm.AutoUpdateTBLOption();

            //システム側のテキストエンコード どうやってUnicodeにするかどうか.
            ReBuildSystemTextEncoder();

            //FEテキストエンコード用のハフマンツリーマップの構成
            ReBuildFETextEncoder();

            //イベントの読込
            ReLoadEventScript();

            //イベント条件の解釈リスト
            EventCondForm.PreLoadResource(U.ConfigDataFilename("eventcond_"));

            //AI1 と 2, 3
            EventUnitForm.PreLoadResourceAI1(U.ConfigDataFilename("ai1_"));
            EventUnitForm.PreLoadResourceAI2(U.ConfigDataFilename("ai2_"));
            EventUnitForm.PreLoadResourceAI3(U.ConfigDataFilename("ai3_"));

            //アイテム 利用効果リスト
            ItemForm.PreLoadResource_item_weapon_effect(U.ConfigDataFilename("item_weapon_effect_"));
            ItemForm.PreLoadResource_item_staff_use_effect(U.ConfigDataFilename("item_staff_use_effect_"));

            //SondEffectリスト
            SongTableForm.PreLoadResource(U.ConfigDataFilename("sound_"));
            //UnitActionリスト
            UnitActionPointerForm.PreLoadResource(U.ConfigDataFilename("unitaction_"));

            //ROM内アニメ
            ImageRomAnimeForm.PreLoadResource();
            ImageTSAAnimeForm.PreLoadResource();
            if (Program.ROM.RomInfo.version == 8)
            {
                ImageTSAAnime2Form.PreLoadResource();
            }

            //MODの読込.
            ReLoadMod();

            //新規に追加ユニットリストキャッシュの削除
            EventUnitForm.ClearNewData();

            //システムアイコンキャッシュのクリア
            ImageSystemIconForm.ClearCache();

            //EVENTとASMのキャッシュをクリア
            AsmMapFileAsmCache = new FEBuilderGBA.AsmMapFileAsmCache();
            //asm mapキャッシュの更新.
            AsmMapFileAsmCache.ClearCache();

            //RAM
            ReBuildRAM();

            if (fullfilename != "" &&
                fullfilename != Program.Config.at("Last_Rom_Filename"))
            {//最後に開いたファイル名を保存する.
                Program.Config["Last_Rom_Filename"] = fullfilename;
                Program.Config.Save();
            }
            //Log.Notify("InitSystem:Complate");
        }
コード例 #22
0
        //斧使いが、手斧のモーションを持っているかテストする.
        static void MakeCheckErrorAxs(InputFormRef ifr
                                      , List <U.AddrResult> axsItems
                                      , List <U.AddrResult> classList
                                      , uint cid
                                      , List <FELint.ErrorSt> errors)
        {
            bool        axsUser = false;
            List <uint> axsList = new List <uint>();

            List <U.AddrResult> list = ifr.MakeList();

            for (int i = 0; i < list.Count; i++)
            {
                uint b0 = Program.ROM.u8(list[i].addr);
                uint b1 = Program.ROM.u8(list[i].addr + 1);

                if (b1 == 1)
                {     //1=種類
                    if (b0 == 2)
                    { //2=斧
                        axsUser = true;
                    }
                }
                else if (b1 == 0)
                {//0=アイテム
                    axsList.Add(b0);
                }
            }

            if (axsUser == false)
            {//問題なし
                return;
            }
            //斧使い 全種類の手斧をもっているか?
            for (int i = 0; i < axsItems.Count; i++)
            {
                uint itemid = axsItems[i].tag;
                if (axsList.IndexOf(itemid) >= 0)
                {//もっている.
                    continue;
                }

                //取りこぼし.

                //武器レベルS ?
                uint wlevel = ItemForm.GetItemWeaponLevelAddr(axsItems[i].addr);
                if (wlevel >= 250)
                {
                    //上級職ではない?
                    bool isHigh = ClassForm.isHighClassAddr(classList[(int)cid].addr);
                    if (isHigh == false)
                    {//上級職でないので、この武器を使えません.
                        continue;
                    }
                }

                if (PatchUtil.SearchCache_HandAxsWildCard() == PatchUtil.HandAxsWildCard_extends.Enable)
                {
                    if (axsList.IndexOf(0x28) >= 0)
                    {//手斧モーションで代用可
                        continue;
                    }
                }
                errors.Add(new FELint.ErrorSt(FELint.Type.BATTLE_ANIME_CLASS, ifr.BaseAddress
                                              , R._("クラス({0})は、斧を利用できますが、手斧({1})の設定がありません。\r\nGBAFEでは、手斧系の武器は、アイテムごとに投げるモーションを設定する必要があります。"
                                                    , classList[(int)cid].name
                                                    , axsItems[i].name), cid));
            }
        }
コード例 #23
0
        private void SwitchListExpandsButton_Click(object sender, EventArgs e)
        {
            int  selected = this.FilterComboBox.SelectedIndex;
            uint newCount = ItemForm.DataCount();

            if (this.L_0_COMBO.Items.Count <= 0)
            {
                return;
            }
            uint defAddr = U.FindComboSelectHexFromValueWhereName(this.L_0_COMBO, "-");

            if (defAddr == U.NOT_FOUND)
            {//見つからない場合、先頭の要素を利用します
                defAddr = U.atoh(this.L_0_COMBO.Items[0].ToString());
            }

            Undo.UndoData undodata = Program.Undo.NewUndoData(this, "ItemUsage SwitchExpands" + selected);
            switch (selected)
            {
            case 0:     //0=アイテムを利用できるか判定する
            default:
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_usability_array_pointer()
                                         , Program.ROM.RomInfo.item_usability_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 1:     //1=アイテムを利用した場合の効果を定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_effect_array_pointer()
                                         , Program.ROM.RomInfo.item_effect_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 2:     //2=CCアイテムを使った場合の処理を定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_promotion1_array_pointer()
                                         , Program.ROM.RomInfo.item_promotion1_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 3:     //3=CCアイテムかどうかを定義する(FE7のみ)
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_promotion2_array_pointer()
                                         , Program.ROM.RomInfo.item_promotion2_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 4:     //4=アイテムのターゲット選択の方法を定義する(多分)
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_staff1_array_pointer()
                                         , Program.ROM.RomInfo.item_staff1_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 5:     //5=杖の種類を定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_staff2_array_pointer()
                                         , Program.ROM.RomInfo.item_staff2_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 6:     //6=ドーピングアイテムを利用した時のメッセージを定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_statbooster1_array_pointer()
                                         , Program.ROM.RomInfo.item_statbooster1_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 7:     //7=ドーピングアイテムとCCアイテムかどうかを定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_statbooster2_array_pointer()
                                         , Program.ROM.RomInfo.item_statbooster2_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 8:     //8=エラーメッセージを定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_errormessage_array_pointer()
                                         , Program.ROM.RomInfo.item_errormessage_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 9:     //9=アイテム名の前置詞を定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_name_article_pointer()
                                         , Program.ROM.RomInfo.item_name_article_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;
            }

            Program.Undo.Push(undodata);

            ReInit(selected, this.InputFormRef);
        }