public void Init(uint mapid, bool showAllError)
 {
     this.ShowAllError.Checked = showAllError;
     this.MapID = mapid;
     this.EventCond_Label.Text = R._("エラー:") + MapSettingForm.GetMapName(this.MapID);
     Scan();
 }
Ejemplo n.º 2
0
        static List <U.AddrResult> MakeShopListLow()
        {
            List <U.AddrResult> ret = new List <U.AddrResult>();
            uint p;

            //編成準備店.
            p = Program.ROM.RomInfo.item_shop_hensei_pointer;
            if (p != 0)
            {
                ret.Add(new U.AddrResult(
                            Program.ROM.p32(p)
                            , R._("編成準備店")
                            , p));
            }
            if (Program.ROM.RomInfo.version >= 8)
            {
                //まずワールドマップイベントをスキャン.
                List <U.AddrResult> worldmaplist = WorldMapPointForm.MakeWorldMapPointList();
                for (uint i = 0; i < worldmaplist.Count; i++)
                {
                    List <U.AddrResult> shops =
                        WorldMapPointForm.GetShopAddr(U.toOffset(worldmaplist[(int)i].addr));
                    foreach (U.AddrResult shop in shops)
                    {
                        if (Program.ROM.u8(shop.addr) == 0)
                        {//店に品物がない.
                            continue;
                        }

                        ret.Add(shop);
                    }
                }
            }
            List <U.AddrResult> maplist = MapSettingForm.MakeMapIDList();

            for (int n = 0; n < maplist.Count; n++)
            {
                uint addr = MapSettingForm.GetEventAddrWhereMapID((uint)n);
                if (!U.isSafetyOffset(addr))
                {
                    continue;
                }
                string mapname = MapSettingForm.GetMapName((uint)n);

                List <U.AddrResult> shops = EventCondForm.MakeShopPointerListBox(addr);
                foreach (U.AddrResult shop in shops)
                {
                    if (Program.ROM.u8(shop.addr) == 0)
                    {//店に品物がない.
                        continue;
                    }
                    shop.name = mapname + " " + shop.name;
                    ret.Add(shop);
                }
            }

            return(ret);
        }
        string PlistToName(uint plist)
        {
            Debug.Assert(SearchType != MapPointerForm.PLIST_TYPE.UNKNOWN);

            if (plist == 0)
            {
                IsAlreadyUse = true;
                return(R._("PLIST=0は、書き込み禁止です。"));
            }
            List <uint> maps;

            if (MapPointerForm.IsPlistSplits())
            {//分割しているので、マップ変化だけを調べる.
                maps = MapSettingForm.GetMapIDsWherePlist(this.SearchType, plist);
                if (maps.Count < 1)
                {
                    if (this.SearchType == MapPointerForm.PLIST_TYPE.PALETTE)
                    {//パレットはオブジェクトも調べる
                        maps = MapSettingForm.GetMapIDsWherePlist(MapPointerForm.PLIST_TYPE.OBJECT, plist);
                    }
                    else if (this.SearchType == MapPointerForm.PLIST_TYPE.OBJECT)
                    {//オブジェクトはパレットも調べる
                        maps = MapSettingForm.GetMapIDsWherePlist(MapPointerForm.PLIST_TYPE.PALETTE, plist);
                    }
                    if (this.SearchType == MapPointerForm.PLIST_TYPE.ANIMATION)
                    {//ANIMATION1はANIMATION2も調べる
                        maps = MapSettingForm.GetMapIDsWherePlist(MapPointerForm.PLIST_TYPE.ANIMATION2, plist);
                    }
                    else if (this.SearchType == MapPointerForm.PLIST_TYPE.ANIMATION2)
                    {//ANIMATION2はANIMATION1も調べる
                        maps = MapSettingForm.GetMapIDsWherePlist(MapPointerForm.PLIST_TYPE.ANIMATION, plist);
                    }
                }
            }
            else
            {//分割していないので、全部調べる必要がある
                maps = MapSettingForm.GetMapIDsWherePlist(MapPointerForm.PLIST_TYPE.UNKNOWN, plist);
            }
            if (maps.Count >= 1)
            {
                IsAlreadyUse = true;
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < maps.Count; i++)
                {
                    if (i != 0)
                    {
                        sb.Append(",");
                    }
                    sb.Append(MapSettingForm.GetMapName(maps[i]));
                }
                return(R._("既に利用されています。\r\n利用マップ:{0}", sb.ToString()));
            }
            IsAlreadyUse = false;
            return(R._("マップ設定では参照されていません。\r\n(このPLISTの利用を推奨します)"));
        }
Ejemplo n.º 4
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , 0
                             , 4
                             , (int i, uint addr) =>
     {
         return false;
     }
                             , (int i, uint addr) =>
     {
         return U.ToHexString(i) + " " + MapSettingForm.GetMapName((uint)i);
     }
                             ));
 }
Ejemplo n.º 5
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.map_exit_point_pointer()
                             , 4
                             , (int i, uint addr) =>
     {
         return i < Program.ROM.RomInfo.map_exit_point_npc_blockadd();
     }
                             , (int i, uint addr) =>
     {
         return MapSettingForm.GetMapName((uint)i);
     }
                             ));
 }
 static InputFormRef N1_Init(Form self)
 {//進行
     return new InputFormRef(self
         , "N1_"
         , 0
         , 1
         , (int i, uint addr) =>
         {//読込最大値検索
             return i < 0xB;
         }
         , (int i, uint addr) =>
         {
             uint mapID = Program.ROM.u8(addr);
             return U.ToHexString(i) + " " + MapSettingForm.GetMapName(mapID);
         }
         );
 }
Ejemplo n.º 7
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.ai_map_setting_pointer()
                             , 4
                             , (int i, uint addr) =>
     {
         return Program.ROM.u8(addr) != 0xFF;
     }
                             , (int i, uint addr) =>
     {
         uint map_id = (uint)i;
         return U.ToHexString(map_id) + " " + MapSettingForm.GetMapName(map_id);
     }
                             ));
 }
        static InputFormRef Init(Form self)
        {
            //天地の剣の資料より
            //強制出撃は 竜の門からスタート

            return(new InputFormRef(self
                                    , ""
                                    , Program.ROM.RomInfo.event_force_sortie_pointer
                                    , 4
                                    , (int i, uint addr) =>
            {
                return i < 23;
            }
                                    , (int i, uint addr) =>
            {
                return MapSettingForm.GetMapName((uint)i + 0x17);
            }
                                    ));
        }
Ejemplo n.º 9
0
        static InputFormRef Init(Form self)
        {
            return(new InputFormRef(self
                                    , ""
                                    , Program.ROM.RomInfo.map_setting_pointer()
                                    , Program.ROM.RomInfo.map_setting_datasize()
                                    , (int i, uint addr) =>
            {
                //0 がポインタであればデータがあると考える.
                return U.isPointer(Program.ROM.u32(addr + 0));
            }
                                    , (int i, uint addr) =>
            {
                MapSettingForm.PLists plist = MapSettingForm.GetMapPListsWhereMapID((uint)i);
                uint change_plist_addr = MapPointerForm.PlistToOffsetAddr(MapPointerForm.PLIST_TYPE.CHANGE, plist.mapchange_plist);
                string name = MapSettingForm.GetMapName((uint)i);

                return new U.AddrResult(change_plist_addr, name, (uint)i);
            }
                                    ));
        }
Ejemplo n.º 10
0
        static InputFormRef Init(Form self)
        {
            return(new InputFormRef(self
                                    , ""
                                    , Program.ROM.RomInfo.map_exit_point_pointer
                                    , 4
                                    , (int i, uint addr) =>
            {
                uint p = Program.ROM.u32(addr);
                if (!U.isPointerOrNULL(p))
                {
                    return false;
                }

                return i < Program.ROM.RomInfo.map_exit_point_npc_blockadd;
            }
                                    , (int i, uint addr) =>
            {
                return MapSettingForm.GetMapName((uint)i);
            }
                                    ));
        }
Ejemplo n.º 11
0
        string PlistToName(uint plist, MapPointerForm.PLIST_TYPE type)
        {
            Debug.Assert(type != MapPointerForm.PLIST_TYPE.UNKNOWN);

            if (plist == 0)
            {
                return("");
            }
            List <uint> maps;

            if (MapPointerForm.IsPlistSplits())
            {//分割しているので、マップ変化だけを調べる.
                maps = MapSettingForm.GetMapIDsWherePlist(type, plist);
                if (maps.Count < 1)
                {
                    if (type == MapPointerForm.PLIST_TYPE.PALETTE)
                    {//パレットはオブジェクトも調べる
                        maps = MapSettingForm.GetMapIDsWherePlist(MapPointerForm.PLIST_TYPE.OBJECT, plist);
                    }
                    else if (type == MapPointerForm.PLIST_TYPE.OBJECT)
                    {//オブジェクトはパレットも調べる
                        maps = MapSettingForm.GetMapIDsWherePlist(MapPointerForm.PLIST_TYPE.PALETTE, plist);
                    }
                    if (type == MapPointerForm.PLIST_TYPE.ANIMATION)
                    {//ANIMATION1はANIMATION2も調べる
                        maps = MapSettingForm.GetMapIDsWherePlist(MapPointerForm.PLIST_TYPE.ANIMATION2, plist);
                    }
                    else if (type == MapPointerForm.PLIST_TYPE.ANIMATION2)
                    {//ANIMATION2はANIMATION1も調べる
                        maps = MapSettingForm.GetMapIDsWherePlist(MapPointerForm.PLIST_TYPE.ANIMATION, plist);
                    }
                }
            }
            else
            {//分割していないので、全部調べる必要がある
                maps = MapSettingForm.GetMapIDsWherePlist(MapPointerForm.PLIST_TYPE.UNKNOWN, plist);
            }
            if (maps.Count >= 1)
            {
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < maps.Count; i++)
                {
                    if (i != 0)
                    {
                        sb.Append(",");
                    }
                    sb.Append(MapSettingForm.GetMapName(maps[i]));
                }
                return(R._("利用マップ:{0}", sb.ToString()));
            }

            if (type == MapPointerForm.PLIST_TYPE.PALETTE)
            {
                if (this.OBJ1numericUpDown.Value == plist ||
                    this.OBJ2numericUpDown.Value == plist
                    )
                {
                    return(R._("{0}と重複しています。\r\n未使用のPLISTですが、データを共有する{1}と同じ番号を利用しているため、利用できません。", R._("オブジェクト"), R._("パレット")));
                }
            }
            else if (type == MapPointerForm.PLIST_TYPE.OBJECT)
            {
                if (this.PALnumericUpDown.Value == plist)
                {
                    return(R._("{0}と重複しています。\r\n未使用のPLISTですが、データを共有する{1}と同じ番号を利用しているため、利用できません。", R._("パレット"), R._("オブジェクト")));
                }
            }
            else if (type == MapPointerForm.PLIST_TYPE.ANIMATION)
            {
                if (this.ANIME2numericUpDown.Value == plist)
                {
                    return(R._("{0}と重複しています。\r\n未使用のPLISTですが、データを共有する{1}と同じ番号を利用しているため、利用できません。", R._("タイルアニメーション2"), R._("タイルアニメーション1")));
                }
            }
            else if (type == MapPointerForm.PLIST_TYPE.ANIMATION2)
            {
                if (this.ANIME1numericUpDown.Value == plist)
                {
                    return(R._("{0}と重複しています。\r\n未使用のPLISTですが、データを共有する{1}と同じ番号を利用しているため、利用できません。", R._("タイルアニメーション1"), R._("タイルアニメーション2")));
                }
            }

            return(R._("未使用のPLISTです。新規にデザインを作りたいときに利用します。データはマップスタイルエディタからインポートしてください。"));
        }
Ejemplo n.º 12
0
 public void Init(uint mapid, bool showAllError)
 {
     this.ShowAllError.Checked = showAllError;
     this.MapID = mapid;
     if (mapid == FELint.SYSTEM_MAP_ID)
     {
         this.EventCond_Label.Text = R._("システムエラー:");
     }
     else
     {
         this.EventCond_Label.Text = R._("エラー:") + " MapID:" + U.To0xHexString(mapid) + " " + MapSettingForm.GetMapName(this.MapID);
     }
     Scan();
 }