Beispiel #1
0
        public static string GetNames(uint addr)
        {
            StringBuilder sb = new StringBuilder();

            addr = U.toOffset(addr);
            uint start  = addr;
            uint length = (uint)Program.ROM.Data.Length;

            for (; addr < length; addr += 1)
            {
                uint value = Program.ROM.u8(addr);
                if (value == 0x00)
                {
                    break;
                }
                if (sb.Length != 0)
                {
                    sb.Append(", ");
                }
                string text = MapTerrainNameForm.GetName(value);
                sb.Append(U.ToHexString(value));
                sb.Append('(');
                sb.Append(text);
                sb.Append(')');
            }

            return(sb.ToString());
        }
Beispiel #2
0
        static void MakeCheckErrorOneMove(FELint.Type type
                                          , uint addr
                                          , uint cid
                                          , List <U.AddrResult> classList
                                          , List <FELint.ErrorSt> errors)
        {
            if (addr == 0)
            {
                return;
            }

            string seetname;

            if (type == FELint.Type.MOVECOST_NORMAL)
            {
                seetname = R._("移動コスト");
            }
            else if (type == FELint.Type.MOVECOST_RAIN)
            {
                seetname = R._("移動コスト(雨)");
            }
            else if (type == FELint.Type.MOVECOST_SHOW)
            {
                seetname = R._("移動コスト(雪)");
            }
            else
            {
                Debug.Assert(false);
                return;
            }

            if (!U.isSafetyOffset(addr))
            {
                errors.Add(new FELint.ErrorSt(FELint.Type.CLASS, classList[(int)cid].addr
                                              , R._("クラス({0})の{1}のポインタ({2})が危険です。"
                                                    , classList[(int)cid].name, seetname, U.To0xHexString(addr)), cid));
                return;
            }
            uint max = 64 + 1;

            if (Program.ROM.RomInfo.version() == 6)
            {
                max = 50 + 1;
            }

            for (uint i = 0; i < max; i++)
            {
                uint v = Program.ROM.u8(addr + i);
                if (v >= 31 || v <= 15)
                {
                    continue;
                }

                string tilename = MapTerrainNameForm.GetName(i);
                errors.Add(new FELint.ErrorSt(type, addr
                                              , R._("クラス({0})の({1})の({2})のタイルの移動コスト({3})が正しくありません。\r\n移動できないタイルは255に、移動できるタイルは0-15の範囲に設定しないといけません。"
                                                    , classList[(int)cid].name, seetname, tilename, v), cid));
            }
        }
Beispiel #3
0
        private void MapStyleEditorForm_Load(object sender, EventArgs e)
        {
            IsInit = true;

            //マップIDリストを作る.
            List <U.AddrResult> maplist = MapSettingForm.MakeMapIDList();

            //マップスタイルリストを作る
            this.MapEditConf = MapEditorForm.MakeMapStyleList(maplist);
            //マップスタイルリストを作る
            MakeMapStyleCombo();

            U.SelectedIndexSafety(this.MapStyle, 0);

            List <U.AddrResult> terrainList = MapTerrainNameForm.MakeList();

            U.ConvertComboBox(terrainList, ref this.ConfigTerrain);

            //マップオブジェクト
            this.MAP.SetChipSize(8);
            Bitmap black = ImageUtil.BlankDummy();

            U.MakeTransparent(black);
            this.MAP.SetDefaultIcon(black);

            //パレット
            this.PFR = new PaletteFormRef(this);
            PFR.MakePaletteUI(OnChangeColor, GetSampleBitmap);
            U.SelectedIndexSafety(this.PaletteCombo, 0);

            //TSA変更のイベント適応.
            List <Control> controls = InputFormRef.GetAllControls(this);

            InputFormRef.MakeLinkEvent("Config_", controls);


            //最大化禁止
            //C#のバグである Anchorを四隅にすると、スクロールバーが消えるというバグに対処するために、
            //フォームを固定化しないとおかしなことになる。
            //クレームは microsoft あたりまでどうぞ.
            this.MaximizeBox = false;
            IsInit           = false;

            U.AllowDropFilename(this, ImageFormRef.IMAGE_FILE_FILTER, (string filename) =>
            {
                using (ImageFormRef.AutoDrag ad = new ImageFormRef.AutoDrag(filename))
                {
                    ObjImportButton_Click(null, null);
                }
            });
            U.AllowDropFilename(this, new string[] { ".MAPCHIP_CONFIG" }, (string filename) =>
            {
                using (ImageFormRef.AutoDrag ad = new ImageFormRef.AutoDrag(filename))
                {
                    MapChipImportButton_Click(null, null);
                }
            });
        }
 void LoadNames()
 {
     J_0.Text  = MapTerrainNameForm.GetName(0);
     J_1.Text  = MapTerrainNameForm.GetName(1);
     J_2.Text  = MapTerrainNameForm.GetName(2);
     J_3.Text  = MapTerrainNameForm.GetName(3);
     J_4.Text  = MapTerrainNameForm.GetName(4);
     J_5.Text  = MapTerrainNameForm.GetName(5);
     J_6.Text  = MapTerrainNameForm.GetName(6);
     J_7.Text  = MapTerrainNameForm.GetName(7);
     J_8.Text  = MapTerrainNameForm.GetName(8);
     J_9.Text  = MapTerrainNameForm.GetName(9);
     J_10.Text = MapTerrainNameForm.GetName(10);
     J_11.Text = MapTerrainNameForm.GetName(11);
     J_12.Text = MapTerrainNameForm.GetName(12);
     J_13.Text = MapTerrainNameForm.GetName(13);
     J_14.Text = MapTerrainNameForm.GetName(14);
     J_15.Text = MapTerrainNameForm.GetName(15);
     J_16.Text = MapTerrainNameForm.GetName(16);
     J_17.Text = MapTerrainNameForm.GetName(17);
     J_18.Text = MapTerrainNameForm.GetName(18);
     J_19.Text = MapTerrainNameForm.GetName(19);
     J_20.Text = MapTerrainNameForm.GetName(20);
     J_21.Text = MapTerrainNameForm.GetName(21);
     J_22.Text = MapTerrainNameForm.GetName(22);
     J_23.Text = MapTerrainNameForm.GetName(23);
     J_24.Text = MapTerrainNameForm.GetName(24);
     J_25.Text = MapTerrainNameForm.GetName(25);
     J_26.Text = MapTerrainNameForm.GetName(26);
     J_27.Text = MapTerrainNameForm.GetName(27);
     J_28.Text = MapTerrainNameForm.GetName(28);
     J_29.Text = MapTerrainNameForm.GetName(29);
     J_30.Text = MapTerrainNameForm.GetName(30);
     J_31.Text = MapTerrainNameForm.GetName(31);
     J_32.Text = MapTerrainNameForm.GetName(32);
     J_33.Text = MapTerrainNameForm.GetName(33);
     J_34.Text = MapTerrainNameForm.GetName(34);
     J_35.Text = MapTerrainNameForm.GetName(35);
     J_36.Text = MapTerrainNameForm.GetName(36);
     J_37.Text = MapTerrainNameForm.GetName(37);
     J_38.Text = MapTerrainNameForm.GetName(38);
     J_39.Text = MapTerrainNameForm.GetName(39);
     J_40.Text = MapTerrainNameForm.GetName(40);
     J_41.Text = MapTerrainNameForm.GetName(41);
     J_42.Text = MapTerrainNameForm.GetName(42);
     J_43.Text = MapTerrainNameForm.GetName(43);
     J_44.Text = MapTerrainNameForm.GetName(44);
     J_45.Text = MapTerrainNameForm.GetName(45);
     J_46.Text = MapTerrainNameForm.GetName(46);
     J_47.Text = MapTerrainNameForm.GetName(47);
     J_48.Text = MapTerrainNameForm.GetName(48);
     J_49.Text = MapTerrainNameForm.GetName(49);
     J_50.Text = MapTerrainNameForm.GetName(50);
 }
 void LoadNames()
 {
     J_0.Text  = MapTerrainNameForm.GetName(0, true);
     J_1.Text  = MapTerrainNameForm.GetName(1, true);
     J_2.Text  = MapTerrainNameForm.GetName(2, true);
     J_3.Text  = MapTerrainNameForm.GetName(3, true);
     J_4.Text  = MapTerrainNameForm.GetName(4, true);
     J_5.Text  = MapTerrainNameForm.GetName(5, true);
     J_6.Text  = MapTerrainNameForm.GetName(6, true);
     J_7.Text  = MapTerrainNameForm.GetName(7, true);
     J_8.Text  = MapTerrainNameForm.GetName(8, true);
     J_9.Text  = MapTerrainNameForm.GetName(9, true);
     J_10.Text = MapTerrainNameForm.GetName(10, true);
     J_11.Text = MapTerrainNameForm.GetName(11, true);
     J_12.Text = MapTerrainNameForm.GetName(12, true);
     J_13.Text = MapTerrainNameForm.GetName(13, true);
     J_14.Text = MapTerrainNameForm.GetName(14, true);
     J_15.Text = MapTerrainNameForm.GetName(15, true);
     J_16.Text = MapTerrainNameForm.GetName(16, true);
     J_17.Text = MapTerrainNameForm.GetName(17, true);
     J_18.Text = MapTerrainNameForm.GetName(18, true);
     J_19.Text = MapTerrainNameForm.GetName(19, true);
     J_20.Text = MapTerrainNameForm.GetName(20, true);
     J_21.Text = MapTerrainNameForm.GetName(21, true);
     J_22.Text = MapTerrainNameForm.GetName(22, true);
     J_23.Text = MapTerrainNameForm.GetName(23, true);
     J_24.Text = MapTerrainNameForm.GetName(24, true);
     J_25.Text = MapTerrainNameForm.GetName(25, true);
     J_26.Text = MapTerrainNameForm.GetName(26, true);
     J_27.Text = MapTerrainNameForm.GetName(27, true);
     J_28.Text = MapTerrainNameForm.GetName(28, true);
     J_29.Text = MapTerrainNameForm.GetName(29, true);
     J_30.Text = MapTerrainNameForm.GetName(30, true);
     J_31.Text = MapTerrainNameForm.GetName(31, true);
     J_32.Text = MapTerrainNameForm.GetName(32, true);
     J_33.Text = MapTerrainNameForm.GetName(33, true);
     J_34.Text = MapTerrainNameForm.GetName(34, true);
     J_35.Text = MapTerrainNameForm.GetName(35, true);
     J_36.Text = MapTerrainNameForm.GetName(36, true);
     J_37.Text = MapTerrainNameForm.GetName(37, true);
     J_38.Text = MapTerrainNameForm.GetName(38, true);
     J_39.Text = MapTerrainNameForm.GetName(39, true);
     J_40.Text = MapTerrainNameForm.GetName(40, true);
     J_41.Text = MapTerrainNameForm.GetName(41, true);
     J_42.Text = MapTerrainNameForm.GetName(42, true);
     J_43.Text = MapTerrainNameForm.GetName(43, true);
     J_44.Text = MapTerrainNameForm.GetName(44, true);
     J_45.Text = MapTerrainNameForm.GetName(45, true);
     J_46.Text = MapTerrainNameForm.GetName(46, true);
     J_47.Text = MapTerrainNameForm.GetName(47, true);
     J_48.Text = MapTerrainNameForm.GetName(48, true);
     J_49.Text = MapTerrainNameForm.GetName(49, true);
     J_50.Text = MapTerrainNameForm.GetName(50, true);
 }
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , 0
                             , 1
                             , (int i, uint addr) =>
     {    //読込最大値検索
         return i < Program.ROM.RomInfo.map_terrain_type_count();
     }
                             , (int i, uint addr) =>
     {    //リストボックスに乗せる項目
         string name = MapTerrainNameForm.GetName((uint)i);
         return U.ToHexString(i + 1) + " " + name;
     }
                             ));
 }
Beispiel #7
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , 0
                             , 1
                             , (int i, uint addr) =>
     {
         return Program.ROM.u8(addr) != 0x00;
     }
                             , (int i, uint addr) =>
     {
         uint tileid = Program.ROM.u8(addr + 0);
         return U.ToHexString(tileid) + " " + MapTerrainNameForm.GetName(tileid);
     }
                             ));
 }
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.map_terrain_name_pointer()
                             , 2
                             , (int i, uint addr) =>
     {    //読込最大値検索
         return Program.ROM.u16(addr + 0) != 0x00;
     }
                             , (int i, uint addr) =>
     {    //リストボックスに乗せる項目
         uint text_id = Program.ROM.u16(addr);
         string hint = MapTerrainNameForm.MakeHint_Full((uint)i);
         return U.ToHexString(i) + " " + text_id.ToString("X04") + " " + TextForm.Direct(text_id) + hint;
     }
                             ));
 }
Beispiel #9
0
        public void ImportFont(Form self, string FontROMTextBox, bool FontAutoGenelateCheckBox, Font ttf)
        {
            string filename = FontROMTextBox;

            this.YourROM = new ROM();

            this.ProcessedFont      = new Dictionary <string, bool>();
            this.MyselfPriorityCode = PatchUtil.SearchPriorityCode();

            string version;

            if (this.YourROM.Load(filename, out version))
            {//フォントを取るようのROM
                this.YourPriorityCode = PatchUtil.SearchPriorityCode(this.YourROM);
            }
            else
            {
                this.YourROM = null;
            }

            if (FontAutoGenelateCheckBox)
            {//自動生成する
                this.UseAutoGenFont = ttf;
            }
            else
            {//自動生成しない
                this.UseAutoGenFont = null;
            }
            FETextDecode decode = new FETextDecode();


            //少し時間がかかるので、しばらくお待ちください表示.
            using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(self))
            {
                this.UndoData = Program.Undo.NewUndoData("FONT Import");

                //文字列からフォントを探索
                {
                    List <U.AddrResult> list = TextForm.MakeItemList();
                    for (int i = 0; i < list.Count; i++)
                    {
                        string text = decode.Decode((uint)i);
                        pleaseWait.DoEvents("String:" + U.To0xHexString((uint)i));

                        FontImporter(text);
                    }
                }
                //メニュー1
                if (Program.ROM.RomInfo.is_multibyte())
                {
                    List <U.AddrResult> menuDefineList = MenuDefinitionForm.MakeListAll();
                    for (int n = 0; n < menuDefineList.Count; n++)
                    {
                        if (!U.isSafetyOffset(menuDefineList[n].addr + 8))
                        {
                            continue;
                        }
                        uint p = menuDefineList[n].addr + 8;
                        if (!U.isSafetyOffset(Program.ROM.p32(p)))
                        {
                            continue;
                        }
                        List <U.AddrResult> list = MenuCommandForm.MakeListPointer(p);
                        for (int i = 0; i < list.Count; i++)
                        {
                            if (!U.isSafetyOffset(list[i].addr))
                            {
                                continue;
                            }
                            uint   textid = Program.ROM.u32(list[i].addr + 0);
                            string str    = FETextDecode.Direct(textid);

                            pleaseWait.DoEvents("Menu:" + U.To0xHexString(textid));
                            FontImporter(str);
                        }
                    }
                }

                //地形
                if (Program.ROM.RomInfo.is_multibyte())
                {
                    List <U.AddrResult> list = MapTerrainNameForm.MakeList();
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (!U.isSafetyOffset(list[i].addr))
                        {
                            continue;
                        }
                        uint   textid = Program.ROM.u32(list[i].addr + 0);
                        string str    = FETextDecode.Direct(textid);

                        pleaseWait.DoEvents("Terrain:" + U.To0xHexString(textid));
                        FontImporter(str);
                    }
                }

                //サウンドルーム
                //FE7のサウンドルームは、日本語直地
                if (Program.ROM.RomInfo.is_multibyte() && Program.ROM.RomInfo.version() == 7)
                {
                    List <U.AddrResult> list = SoundRoomForm.MakeList();
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (!U.isSafetyOffset(list[i].addr))
                        {
                            continue;
                        }
                        uint   textid = Program.ROM.u32(list[i].addr + 12);
                        string str    = FETextDecode.Direct(textid);

                        pleaseWait.DoEvents("SoundRoom:" + U.To0xHexString(textid));
                        FontImporter(str);
                    }
                }
                //その他文字列
                {
                    List <U.AddrResult> list = OtherTextForm.MakeList();
                    for (int i = 0; i < list.Count; i++)
                    {
                        if (!U.isSafetyOffset(list[i].addr))
                        {
                            continue;
                        }

                        uint   p_str = Program.ROM.p32(list[i].addr);
                        string str   = Program.ROM.getString(p_str);

                        pleaseWait.DoEvents("Other:" + U.To0xHexString(p_str));
                        FontImporter(str);
                    }
                }

                Program.Undo.Push(this.UndoData);
            }
        }
Beispiel #10
0
        public void ExportallText(Form self
                                  , string writeTextFileName
                                  , string tralnslate_from, string tralnslate_to
                                  , string rom_from, string rom_to
                                  , bool isModifiedTextOnly
                                  , bool isOneLiner
                                  )
        {
            //少し時間がかかるので、しばらくお待ちください表示.
            using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(self))
            {
                FETextDecode decode = new FETextDecode();

                Dictionary <string, string> transDic = TranslateTextUtil.MakeFixedDic(tralnslate_from, tralnslate_to, rom_from, rom_to);
                if (ExportFilterArray != null)
                {
                    using (StreamWriter writer = new StreamWriter(writeTextFileName))
                    {
                        List <U.AddrResult> list = TextForm.MakeItemList();
                        for (int i = 0; i < list.Count; i++)
                        {
                            if (!ExportFilterArray.ContainsKey(i))
                            {
                                continue;
                            }
                            string text = decode.Decode((uint)i);

                            pleaseWait.DoEvents("Text:" + U.To0xHexString((uint)i));
                            ExportText(writer, (uint)i, text, tralnslate_from, tralnslate_to, transDic, isModifiedTextOnly, isOneLiner);
                        }
                    }
                    return;
                }

                using (StreamWriter writer = new StreamWriter(writeTextFileName))
                {
                    //テキスト
                    {
                        List <U.AddrResult> list = TextForm.MakeItemList();
                        for (int i = 0; i < list.Count; i++)
                        {
                            if (ExportFilterArray != null && ExportFilterArray[i] != false)
                            {
                                continue;
                            }
                            string text = decode.Decode((uint)i);

                            pleaseWait.DoEvents("Text:" + U.To0xHexString((uint)i));
                            ExportText(writer, (uint)i, text, tralnslate_from, tralnslate_to, transDic, isModifiedTextOnly, isOneLiner);
                        }
                    }

                    //メニュー1
                    if (Program.ROM.RomInfo.is_multibyte)
                    {
                        List <U.AddrResult> menuDefineList = MenuDefinitionForm.MakeListAll();
                        for (int n = 0; n < menuDefineList.Count; n++)
                        {
                            if (!U.isSafetyOffset(menuDefineList[n].addr + 8))
                            {
                                continue;
                            }
                            uint p = menuDefineList[n].addr + 8;
                            if (!U.isSafetyOffset(Program.ROM.p32(p)))
                            {
                                continue;
                            }
                            List <U.AddrResult> list = MenuCommandForm.MakeListPointer(p);
                            for (int i = 0; i < list.Count; i++)
                            {
                                if (!U.isSafetyOffset(list[i].addr))
                                {
                                    continue;
                                }
                                uint   text_pointer = list[i].addr + 0;
                                uint   textid       = Program.ROM.u32(text_pointer);
                                string str          = FETextDecode.Direct(textid);
                                if (str.Trim() == "")
                                {
                                    continue;
                                }

                                pleaseWait.DoEvents("Menu:" + U.To0xHexString(textid));
                                ExportText(writer, U.toPointer(text_pointer), str, tralnslate_from, tralnslate_to, transDic, isModifiedTextOnly, isOneLiner);
                            }
                        }
                    }

                    //地形
                    if (Program.ROM.RomInfo.is_multibyte)
                    {
                        List <U.AddrResult> list = MapTerrainNameForm.MakeList();
                        for (int i = 0; i < list.Count; i++)
                        {
                            if (!U.isSafetyOffset(list[i].addr))
                            {
                                continue;
                            }
                            uint   text_pointer = list[i].addr + 0;
                            uint   textid       = Program.ROM.u32(text_pointer);
                            string str          = FETextDecode.Direct(textid);
                            if (str.Trim() == "")
                            {
                                continue;
                            }

                            pleaseWait.DoEvents("Terrain:" + U.To0xHexString(textid));
                            ExportText(writer, U.toPointer(text_pointer), str, tralnslate_from, tralnslate_to, transDic, isModifiedTextOnly, isOneLiner);
                        }
                    }

                    //サウンドルーム
                    //FE7のサウンドルームは、日本語直地
                    if (Program.ROM.RomInfo.is_multibyte && Program.ROM.RomInfo.version == 7)
                    {
                        List <U.AddrResult> list = SoundRoomForm.MakeList();
                        for (int i = 0; i < list.Count; i++)
                        {
                            if (!U.isSafetyOffset(list[i].addr))
                            {
                                continue;
                            }
                            uint   text_pointer = list[i].addr + 12;
                            uint   textid       = Program.ROM.u32(text_pointer);
                            string str          = FETextDecode.Direct(textid);
                            if (str.Trim() == "")
                            {
                                continue;
                            }

                            pleaseWait.DoEvents("SoundRoom:" + U.To0xHexString(textid));
                            ExportText(writer, U.toPointer(text_pointer), str, tralnslate_from, tralnslate_to, transDic, isModifiedTextOnly, isOneLiner);
                        }
                    }
                    //その他文字列
                    {
                        List <U.AddrResult> list = OtherTextForm.MakeList();
                        for (int i = 0; i < list.Count; i++)
                        {
                            if (!U.isSafetyOffset(list[i].addr))
                            {
                                continue;
                            }
                            uint   text_pointer = list[i].addr + 0;
                            uint   p_str        = Program.ROM.p32(text_pointer);
                            string str          = Program.ROM.getString(p_str);
                            if (str.Trim() == "")
                            {
                                continue;
                            }

                            pleaseWait.DoEvents("Other:" + U.To0xHexString(p_str));
                            ExportText(writer, U.toPointer(text_pointer), str, tralnslate_from, tralnslate_to, transDic, isModifiedTextOnly, isOneLiner);
                        }
                    }
                }
            }
        }
Beispiel #11
0
        void DrawMapChipInfo(int chipset_id, int x, int y, PaintEventArgs e)
        {
            PointF pt = new PointF();

            pt.X = x;
            pt.Y = y;

            //このチップセットの名前を問い合わせる.
            uint terrain_data = ImageUtilMap.GetChipsetID(chipset_id, this.configUZ);

            if (terrain_data == U.NOT_FOUND)
            {
                return;
            }
            const uint test_class = 1; //主人公クラス

            string terrain_name    = MapTerrainNameForm.GetName(terrain_data);
            string terrain_kaihi   = R._("地形回避") + ":" + MoveCostForm.GetMoveCost(test_class, terrain_data, 3).ToString(); //地形回避
            string terrain_kaifuku = R._("地形回復") + ":" + MoveCostForm.GetMoveCost(test_class, terrain_data, 6).ToString(); //地形回復

            string terrain_tuukou = R._("地形コスト") + ":";
            uint   cost           = MoveCostForm.GetMoveCost(test_class, terrain_data, 0);

            terrain_tuukou += cost.ToString();
            if (cost >= 255)
            {
                cost = MoveCostForm.GetMoveCost(ClassForm.GetFlyClass(), terrain_data, 0);
                if (cost < 255)
                {
                    terrain_tuukou += R._("(飛行のみ)");
                }
                else
                {
                    terrain_tuukou += R._("(全員不可)");
                }
            }


            Rectangle windowrc = new Rectangle();

            windowrc.X      = (int)pt.X + 48 + 1;
            windowrc.Y      = (int)pt.Y;
            windowrc.Width  = (int)0;
            windowrc.Height = (int)this.Font.Height * 4;

            //枠を描画する幅を特定します.
            SizeF textSize = e.Graphics.MeasureString(terrain_name, this.Font, 1000);

            if (windowrc.Width < textSize.Width)
            {
                windowrc.Width = (int)textSize.Width;
            }
            textSize = e.Graphics.MeasureString(terrain_kaihi, this.Font, 1000);
            if (windowrc.Width < textSize.Width)
            {
                windowrc.Width = (int)textSize.Width;
            }
            textSize = e.Graphics.MeasureString(terrain_kaifuku, this.Font, 1000);
            if (windowrc.Width < textSize.Width)
            {
                windowrc.Width = (int)textSize.Width;
            }
            textSize = e.Graphics.MeasureString(terrain_tuukou, this.Font, 1000);
            if (windowrc.Width < textSize.Width)
            {
                windowrc.Width = (int)textSize.Width;
            }

            if (windowrc.X + windowrc.Width > e.ClipRectangle.Right)
            {//画面右端の場合、左側に押し出す.
                windowrc.X = windowrc.X - windowrc.Width - 32;
                windowrc.Y = windowrc.Y + 16 + 32;
            }
            if (windowrc.Y + windowrc.Height > e.ClipRectangle.Bottom)
            {//画面下端の場合、上側に押し出す.
                windowrc.X = windowrc.X - 16 - 32;
                windowrc.Y = windowrc.Y - windowrc.Height - 32;
            }
            if (windowrc.X < 0)
            {
                windowrc.X = 0;
                while (true)
                {
                    if (pt.X < windowrc.Width && pt.Y >= windowrc.Y && pt.Y <= windowrc.Y + windowrc.Height)
                    {
                        windowrc.Y += 16;
                        continue;
                    }
                    break;
                }
            }
            pt.X = windowrc.X;
            pt.Y = windowrc.Y;

            e.Graphics.FillRectangle(this.BackBrush, windowrc);

            e.Graphics.DrawString(terrain_name, this.Font, this.ForeBrush, pt);

            pt.Y = pt.Y + this.Font.Height;
            e.Graphics.DrawString(terrain_kaihi, this.Font, this.ForeBrush, pt);

            pt.Y = pt.Y + this.Font.Height;
            e.Graphics.DrawString(terrain_kaifuku, this.Font, this.ForeBrush, pt);

            pt.Y = pt.Y + this.Font.Height;
            e.Graphics.DrawString(terrain_tuukou, this.Font, this.ForeBrush, pt);
        }