示例#1
0
        public MapExitPointForm()
        {
            InitializeComponent();
            FilterComboBox.Items.Add("Enemy Escape Point");
            FilterComboBox.Items.Add("NPC Escape Point");
            //フィルターの指定を忘れる人が多いので、アイコンをつけて目立たせる.
            this.FilterComboBox.OwnerDraw(DrawFilterCombo, DrawMode.OwnerDrawFixed);

            this.N_InputFormRef = N_Init(this);
            this.N_InputFormRef.MakeGeneralAddressListContextMenu(true);
            this.N_InputFormRef.CheckProtectionAddrHigh = false;
            this.InputFormRef = Init(this);
            this.InputFormRef.CheckProtectionAddrHigh = false;

            //マップを最前面に移動する.
            MapPictureBox.BringToFront();

            if (Program.ROM.RomInfo.version() == 6)
            {//たぶんFE6には、NPC離脱ポインタは存在しない
                FilterComboBox.Hide();
                Set_X_Filter_Note_Message(0);
            }
            else
            {
                FilterComboBox.SelectedIndex = 0;
            }
        }
示例#2
0
        private void ANIME2numericUpDown_ValueChanged(object sender, EventArgs e)
        {
            uint plist = (uint)ANIME2numericUpDown.Value;

            LINK_PLIST_ANIME2.Text = PlistToName(plist, MapPointerForm.PLIST_TYPE.ANIMATION2);
            MapPictureBox.LoadMap(ImageUtilMap.DrawMap(GetOBJPLIST(), GetPALPLIST(), GetCONFIGPLIST(), this.MapPointerPListReadOnly));
        }
示例#3
0
        private void MAP_LISTBOX_SelectedIndexChanged(object sender, EventArgs e)
        {
            uint mapid = (uint)MAP_LISTBOX.SelectedIndex;

            if (mapid == U.NOT_FOUND)
            {
                return;
            }
            uint addr = MapSettingForm.GetEventAddrWhereMapID(mapid);

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

            List <U.AddrResult> list = EventCondForm.MakeUnitPointer(mapid);

            //未記帳の拡張した領域があれば追加する.
            EventUnitForm.AppendNoWriteNewData(list, mapid);

            U.ConvertListBox(list, ref this.EVENT_LISTBOX);
            if (this.EVENT_LISTBOX.Items.Count > 0)
            {
                this.EVENT_LISTBOX.SelectedIndex = 0;
            }
            else
            {
                MapPictureBox.LoadMap(mapid);
            }
        }
示例#4
0
        private void N_P8_ValueChanged(object sender, EventArgs e)
        {
            if (this.InputFormRef != null && this.InputFormRef.IsUpdateLock)
            {
                return;
            }

            U.AddrResult ar             = InputFormRef.SelectToAddrResult(this.AddressList);
            uint         mapid          = ar.tag;
            int          width          = (int)N_B3.Value;
            int          height         = (int)N_B4.Value;
            uint         change_address = (uint)N_P8.Value;

            MapPictureBox.SetDefualtIcon(
                MapSettingForm.DrawMapChange(mapid, width, height, change_address)
                );
            if (!U.isSafetyPointer(change_address))
            {
                if (change_address == 0)
                {
                    N_J_8.ErrorMessage = R._("データが設定されていません。マップエディタから、データを作成してください。");
                }
                else
                {
                    N_J_8.ErrorMessage = R._("ポインタが正しくありません");
                }
            }
            else
            {
                N_J_8.ErrorMessage = "";
            }
        }
示例#5
0
        public void DrawSelectedUnit()
        {
            uint unit_id  = (uint)B0.Value;
            uint class_id = (uint)B1.Value;

            if (class_id == 0)
            {//クラスIDが0だったらユーザIDで補完する
                class_id = UnitForm.GetClassID(unit_id);
            }

            List <MapPictureBox.StaticItem> list =
                EventUnitFE7Form.DrawUnit(
                    class_id
                    , (uint)B3.Value
                    , (int)B4.Value
                    , (int)B5.Value
                    , (int)B6.Value
                    , (int)B7.Value
                    );

            for (int n = list.Count - 1; n >= 0; n--)
            {
                MapPictureBox.SetStaticItem("c" + n.ToString(), list[n].x, list[n].y, list[n].bitmap, list[n].draw_x_add, list[n].draw_y_add);
            }
        }
示例#6
0
        private void WorldMapPointForm_Load(object sender, EventArgs e)
        {
            MapPictureBox.HideCommandBar();
            MapPictureBox.LoadWorldMap();
            MapPictureBox.SetChipSize(1);

            for (uint i = 0; i < WorldMapPathForm.DataCount(); i++)
            {
                List <MapPictureBox.StaticItem> list = WorldMapPathForm.DrawPath(i);
                for (int n = 0; n < list.Count; n++)
                {
                    MapPictureBox.SetStaticItem("road" + i.ToString() + "_" + n.ToString(), list[n].x, list[n].y, list[n].bitmap);
                }
                MapPictureBox.Invalidate();
            }

            //拡張ボタンを表示するかどうか
            if (WorldMapPointForm.IsShowWorldmapPointExetdns(AddressList.Items.Count))
            {
                AddressListExpandsButton_255.Show();
            }
            else
            {
                this.AddressList.Height += AddressListExpandsButton_255.Height;
                AddressListExpandsButton_255.Hide();
            }
        }
示例#7
0
 private void EventUnitFE7Form_Load(object sender, EventArgs e)
 {
     X_Tooltip = InputFormRef.GetToolTip <EventUnitFE7Form>();
     this.EVENTUNIT_BEFORE_COORD.SetToolTipEx(this.X_Tooltip);
     this.EVENTUNIT_AFTER_COORD.SetToolTipEx(this.X_Tooltip);
     MapPictureBox.SetDefaultIcon(ImageSystemIconForm.Blank16());
 }
        void MakeWorldMap()
        {
            MapPictureBox.LoadWorldMap();
            MapPictureBox.ClearStaticItem();

            int pathid = this.AddressList.SelectedIndex;

            if (pathid >= 0)
            {
                //道の描画
                List <MapPictureBox.StaticItem> list = WorldMapPathForm.DrawPath((uint)pathid);
                for (int n = 0; n < list.Count; n++)
                {
                    MapPictureBox.SetStaticItem("road" + pathid.ToString() + "_" + n.ToString(), list[n].x, list[n].y, list[n].bitmap);
                }
            }

            //拠点を追加
            List <U.AddrResult> arlist = WorldMapPointForm.MakeWorldMapPointList();

            for (int i = 0; i < arlist.Count; i++)
            {
                MapPictureBox.StaticItem item = WorldMapPointForm.DrawBasePointAddr(arlist[i].addr);
                MapPictureBox.SetStaticItem("base" + i.ToString(), item.x, item.y, item.bitmap, item.draw_x_add, item.draw_y_add);
            }

            MapPictureBox.InvalidateMap();
        }
        private void MapPictureBox_MouseClick(object sender, MouseEventArgs e)
        {
            int clickx = MapPictureBox.CursolToTile(e.X);
            int clicky = MapPictureBox.CursolToTile(e.Y);

            this.ReWriteValueX.Value = clickx;
            this.ReWriteValueY.Value = clicky;
        }
示例#10
0
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            uint obj_plist        = (uint)W4.Value;
            uint palette_plist    = (uint)B6.Value;
            uint config_plist     = (uint)B7.Value;
            uint mappointer_plist = (uint)B8.Value;

            MapPictureBox.LoadMap(ImageUtilMap.DrawMap(obj_plist, palette_plist, config_plist, mappointer_plist));
        }
示例#11
0
        public MapSettingFE6Form()
        {
            InitializeComponent();

            InputFormRef.markupJumpLabel(X_MAPSTYLE_CHANGE);
            MapPictureBox.HideCommandBar();
            U.ConvertComboBox(InputFormRef.MakeTerrainSet(), ref L_18_COMBO, true);
            this.InputFormRef = Init(this);
            this.InputFormRef.MakeGeneralAddressListContextMenu(true);
        }
        private void WorldMapPathEditorForm_Load(object sender, EventArgs e)
        {
            MakePathCombo();
            MapPictureBox.SetChipSize(1);
            Bitmap icon = ImageSystemIconForm.YubiTate();

            U.MakeTransparent(icon);
            MapPictureBox.SetDefaultIcon(icon, -8, -14);
            U.SelectedIndexSafety(PathType, 0);
        }
        public void DrawAllUnits()
        {
            MapPictureBox.ClearStaticItem();

            DrawUnits(Program.ROM.RomInfo.workmemory_player_units_address, 62);
            DrawUnits(Program.ROM.RomInfo.workmemory_enemy_units_address, 50);
            DrawUnits(Program.ROM.RomInfo.workmemory_npc_units_address, 20);

            MapPictureBox.Invalidate();
        }
        public void DrawUnits(uint topaddr, int max)
        {
            const uint RAMUnitSizeOf = 72; //構造体のサイズ
            bool       isFE6         = (Program.ROM.RomInfo.version == 6);

            uint addr = topaddr;

            for (int i = 0; i < max; i++, addr += RAMUnitSizeOf)
            {
                uint unitPointer  = Program.RAM.u32(addr + 0);
                uint classPointer = Program.RAM.u32(addr + 4);

                if (unitPointer == 0)
                {
                    continue;
                }

                if (!U.isSafetyPointer(unitPointer))
                {
                    continue;
                }
                if (!U.isSafetyPointer(classPointer))
                {
                    continue;
                }

                uint classid = Program.ROM.u8(U.toOffset(classPointer) + 4);

                uint   unit_number  = Program.RAM.u8(addr + 11);
                int    palette_type = GetShowPartyClassPaletteType(unit_number);
                Bitmap bitmap       = ClassForm.DrawWaitIcon(classid, palette_type);
                U.MakeTransparent(bitmap);

                uint x, y;
                if (isFE6)
                {
                    x = Program.RAM.u8(addr + 14);
                    y = Program.RAM.u8(addr + 15);
                }
                else
                {
                    x = Program.RAM.u8(addr + 16);
                    y = Program.RAM.u8(addr + 17);
                }

                MapPictureBox.StaticItem st = new MapPictureBox.StaticItem();
                st.bitmap     = bitmap;
                st.x          = (int)x;
                st.y          = (int)y;
                st.draw_x_add = 0;
                st.draw_y_add = 0;

                MapPictureBox.SetStaticItem(U.To0xHexString(addr), st.x, st.y, st.bitmap, st.draw_x_add, st.draw_y_add);
            }
        }
        private void P8_ValueChanged(object sender, EventArgs e)
        {
            uint mapid          = (uint)MAP_LISTBOX.SelectedIndex;
            int  width          = (int)B3.Value;
            int  height         = (int)B4.Value;
            uint change_address = (uint)P8.Value;

            MapPictureBox.SetDefualtIcon(
                MapSettingForm.DrawMapChange(mapid, width, height, change_address)
                );
        }
        public EventMapChangeForm()
        {
            InitializeComponent();

            this.InputFormRef = Init(this);

            //マップIDリストを作る.
            U.ConvertListBox(MapSettingForm.MakeMapIDList(), ref this.MAP_LISTBOX);
            //マップを最前面に移動する.
            MapPictureBox.BringToFront();
        }
示例#17
0
        private void MapMouseDownEvent(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {//右クリックされたとき
                int clickx = MapPictureBox.CursolToTile(e.X);
                int clicky = MapPictureBox.CursolToTile(e.Y);

                for (int index = 0; true; index++)
                {
                    //表示領域の都合上、選択されたユニットでなければ、最終移動位置しか描画していないため、探索するときはそれを踏まえる.
                    bool isSelectedUnit = (this.AddressList.SelectedIndex == index);

                    uint addr = InputFormRef.SelectToAddr(this.AddressList, index);
                    if (!U.isSafetyOffset(addr))
                    {
                        break;
                    }
                    int before_x = (int)Program.ROM.u8(addr + 4);
                    int before_y = (int)Program.ROM.u8(addr + 5);
                    int after_x  = (int)Program.ROM.u8(addr + 6);
                    int after_y  = (int)Program.ROM.u8(addr + 7);

                    if (isSelectedUnit)
                    {//選択している場合は、配置前座標を探索.
                        if (before_x == clickx && before_y == clicky)
                        {
                            this.AddressList.SelectedIndex = index; //選択されたユニットへ移動
                            this.B4.Focus();                        //移動場所にフォーカスを当てることで notifyモードに切り替える.
                            break;
                        }
                    }
                    //配置後探索
                    if (after_x == clickx && after_y == clicky)
                    {
                        this.AddressList.SelectedIndex = index; //選択されたユニットへ移動

                        //ただし配置後と配置前か同一の場合、配置前を選択する.
                        if (before_x == after_x && before_y == after_y)
                        {
                            this.B4.Focus(); //配置前
                        }
                        else
                        {
                            this.B6.Focus(); //移動場所にフォーカスを当てることで notifyモードに切り替える.
                        }

                        break;
                    }
                }
            }
        }
示例#18
0
        public MapChangeForm()
        {
            InitializeComponent();

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

            //マップを最前面に移動する.
            MapPictureBox.BringToFront();

            this.N_InputFormRef.MakeGeneralAddressListContextMenu(true);
            this.N_InputFormRef.AddressListExpandsEvent += N_AddressListExpandsEvent;
            this.N_InputFormRef.PostWriteHandler        += N_PostWriteEvent;
        }
示例#19
0
 public void Init(uint objPList, uint palPList, uint configPList
                  , uint mapPointerPListReadOnly
                  , uint anime1PList, uint anime2PList)
 {
     InitUI();
     MapPointerPListReadOnly = mapPointerPListReadOnly;
     U.SelectedIndexSafety(OBJ1numericUpDown, objPList & 0xff);
     U.SelectedIndexSafety(OBJ2numericUpDown, (objPList >> 8) & 0xff);
     U.SelectedIndexSafety(PALnumericUpDown, palPList);
     U.SelectedIndexSafety(CONFIGnumericUpDown, configPList);
     U.SelectedIndexSafety(ANIME1numericUpDown, anime1PList);
     U.SelectedIndexSafety(ANIME2numericUpDown, anime2PList);
     MapPictureBox.LoadMap(ImageUtilMap.DrawMap(objPList, palPList, configPList, mapPointerPListReadOnly));
 }
        private void EVENT_LISTBOX_SelectedIndexChanged(object sender, EventArgs e)
        {
            U.AddrResult ar = InputFormRef.SelectToAddrResult(this.EVENT_LISTBOX);
            if (!U.isSafetyOffset(ar.addr))
            {
                this.MapPictureBox.ClearAllPoint();
                return;
            }
            //タグにマップ番号が入っている.
            MapPictureBox.LoadMap(ar.tag);

            this.MapPictureBox.ClearAllPoint();
            this.InputFormRef.ReInit(ar.addr);
        }
示例#21
0
        public MapChangeForm()
        {
            InitializeComponent();

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

            MapPictureBox.HideCommandBar2();

            this.N_InputFormRef.MakeGeneralAddressListContextMenu(true);
            this.N_InputFormRef.AddressListExpandsEvent += N_AddressListExpandsEvent;
            this.N_InputFormRef.PostWriteHandler        += N_PostWriteEvent;

            InputFormRef.markupJumpLabel(X_MAPEDITOR_LINK);
        }
示例#22
0
        private void N_P8_ValueChanged(object sender, EventArgs e)
        {
            if (this.InputFormRef != null && this.InputFormRef.IsUpdateLock)
            {
                return;
            }

            U.AddrResult ar             = InputFormRef.SelectToAddrResult(this.AddressList);
            uint         mapid          = ar.tag;
            int          width          = (int)N_B3.Value;
            int          height         = (int)N_B4.Value;
            uint         change_address = (uint)N_P8.Value;

            MapPictureBox.SetDefualtIcon(
                MapSettingForm.DrawMapChange(mapid, width, height, change_address)
                );
        }
示例#23
0
        public MapSettingFE7Form()
        {
            InitializeComponent();


            InputFormRef.markupJumpLabel(X_MAPSTYLE_CHANGE);
            MapPictureBox.HideCommandBar();
            MapPictureBox.SetPointIcon("L_142_MAPXY_143", ImageSystemIconForm.ExitPoint());

            //われら輸送体
            Bitmap yusoutai = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(0x3A, 0, true);

            MapPictureBox.SetPointIcon("L_130_MAPXY_132", yusoutai);
            MapPictureBox.SetPointIcon("L_131_MAPXY_133", yusoutai);
            U.ConvertComboBox(InputFormRef.MakeTerrainSet(), ref L_19_COMBO, true);
            this.InputFormRef = Init(this);
            this.InputFormRef.MakeGeneralAddressListContextMenu(true);
        }
示例#24
0
        public void DrawAllUnits()
        {
            MapPictureBox.ClearStaticItem();
            List <U.AddrResult> list = InputFormRef.MakeList();

            for (int i = 0; i < list.Count; i++)
            {
                if (AddressList.SelectedIndex == i)
                {//選択しているものは別ルーチンで詳細に描画する.
                    DrawSelectedUnit();
                }
                else
                {//選択していないものは、移動後座標だけ描画する.
                    MapPictureBox.StaticItem sitem = DrawAfterPosUnit(list[i].addr);
                    MapPictureBox.SetStaticItem("o" + i.ToString(), sitem.x, sitem.y, sitem.bitmap, sitem.draw_x_add, sitem.draw_y_add);
                }
            }
            MapPictureBox.Invalidate();
        }
示例#25
0
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            U.AddrResult ar    = InputFormRef.SelectToAddrResult(this.AddressList);
            uint         mapid = ar.tag;

            MapPictureBox.LoadMap(mapid);
            this.MapPictureBox.ClearAllPoint();

            uint change_addr = MapSettingForm.GetMapChangeAddrWhereMapID(mapid);

            if (!U.isSafetyOffset(change_addr))
            {
                this.N_InputFormRef.ClearSelect(true);
                this.N_AddressListExpandsButton_80.Enabled = false;
                return;
            }

            this.N_InputFormRef.ReInit(change_addr);
        }
示例#26
0
        public MapExitPointForm()
        {
            InitializeComponent();
            FilterComboBox.Items.Add("Enemy Escape Point");
            FilterComboBox.Items.Add("NPC Escape Point");
            //フィルターの指定を忘れる人が多いので、アイコンをつけて目立たせる.
            this.FilterComboBox.OwnerDraw(DrawFilterCombo, DrawMode.OwnerDrawFixed);

            this.N_InputFormRef = N_Init(this);
            this.N_InputFormRef.MakeGeneralAddressListContextMenu(true);
            this.N_InputFormRef.CheckProtectionAddrHigh = false;
            this.InputFormRef = Init(this);
            this.InputFormRef.CheckProtectionAddrHigh = false;

            //マップを最前面に移動する.
            MapPictureBox.BringToFront();

            FilterComboBox.SelectedIndex = 0;
        }
示例#27
0
        public MapSettingForm()
        {
            InitializeComponent();

            InputFormRef.markupJumpLabel(X_MAPSTYLE_CHANGE);
            MapPictureBox.HideCommandBar();
            MapPictureBox.SetPointIcon("L_143_MAPXY_144", ImageSystemIconForm.ExitPoint());
            U.ConvertComboBox(InputFormRef.MakeTerrainSet(), ref L_19_COMBO, true);
            this.InputFormRef = Init(this);
            this.InputFormRef.MakeGeneralAddressListContextMenu(true);

            uint shinan = PatchUtil.SearchShinanTablePatch();

            if (shinan != U.NOT_FOUND)
            {
                InputFormRef.markupJumpLabel(X_JUMP_SHINAN);
                X_JUMP_SHINAN.Show();
            }
        }
示例#28
0
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            uint exit_point_addrp = InputFormRef.SelectToAddr(this.AddressList);

            if (!U.isSafetyOffset(exit_point_addrp))
            {
                this.N_InputFormRef.ReInit(0);
                return;
            }

            MapPictureBox.LoadMap((uint)this.AddressList.SelectedIndex);

            this.MapPictureBox.ClearAllPoint();

            uint exit_point_addr = Program.ROM.u32(exit_point_addrp);

            if (!U.isPointer(exit_point_addr))
            {
                this.N_InputFormRef.ReInit(0);
                return;
            }

            exit_point_addr = U.toOffset(exit_point_addr);
            if (!U.isSafetyOffset(exit_point_addrp))
            {
                this.N_InputFormRef.ReInit(0);
                return;
            }

            if (exit_point_addr == Program.ROM.RomInfo.map_exit_point_blank)
            {//一つも離脱ポインタがない 共通NULLマーク
                N_AddressListExpandsButton.Hide();
                NewListAlloc.Show();
            }
            else
            {
                NewListAlloc.Hide();
                N_AddressListExpandsButton.Show();
            }

            this.N_InputFormRef.ReInit(exit_point_addr);
        }
示例#29
0
        public MapExitPointForm()
        {
            InitializeComponent();

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

            //マップを最前面に移動する.
            MapPictureBox.BringToFront();

            if (Program.ROM.RomInfo.version() == 6)
            {//たぶんFE6には、NPC離脱ポインタは存在しない
                FilterComboBox.Hide();
            }
            else
            {
                FilterComboBox.SelectedIndex = 0;
            }
        }
示例#30
0
        private void WorldMapPathForm_Load(object sender, EventArgs e)
        {
            MapPictureBox.HideCommandBar();
            MapPictureBox.SetChipSize(1);
            Bitmap icon = ImageSystemIconForm.YubiTate();

            U.MakeTransparent(icon);
            MapPictureBox.SetDefualtIcon(icon, -8, -14);

            //拡張ボタンを表示するかどうか
            if (WorldMapPathForm.IsShowWorldmapPathExetdns(this.AddressList))
            {
                AddressListExpandsButton_255.Show();
            }
            else
            {
                this.AddressList.Height += AddressListExpandsButton_255.Height;
                AddressListExpandsButton_255.Hide();
            }
        }