Ejemplo n.º 1
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();
            }
        }
Ejemplo n.º 2
0
        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 SaveASbutton_Click(object sender, EventArgs e)
        {
            uint addr   = U.toOffset((uint)this.MapAddress.Value);
            uint length = WorldMapPathForm.CalcPathDataLength(addr);

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

            string title  = R._("保存するファイル名を選択してください");
            string filter = R._("Road.BIN|*.road.bin|All files|*");

            SaveFileDialog save = new SaveFileDialog();

            save.Title  = title;
            save.Filter = filter;
            save.ShowDialog();
            if (save.FileNames.Length <= 0 || !U.CanWriteFileRetry(save.FileNames[0]))
            {
                return;
            }
            Program.LastSelectedFilename.Save(this, "", save);

            //書き込み.
            byte[] bin = Program.ROM.getBinaryData(addr, length);
            U.WriteAllBytes(save.FileName, bin);

            //エクスプローラで選択しよう
            U.SelectFileByExplorer(save.FileName);
        }
        //道データの長さを求める.
        static MoveToUnuseSpace.ADDR_AND_LENGTH get_path_data_length_callback(uint addr)
        {
            addr = U.toOffset(addr);

            uint length = WorldMapPathForm.CalcPathDataLength(addr);

            MoveToUnuseSpace.ADDR_AND_LENGTH aal = new MoveToUnuseSpace.ADDR_AND_LENGTH();
            aal.addr   = addr;
            aal.length = length;
            return(aal);
        }
        private void WorldMapPathEditorForm_Load(object sender, EventArgs e)
        {
            this.WorldmapBGCache = WorldMapImageForm.DrawWorldMap();
            this.PathCacheImage  = WorldMapPathForm.GetPathImage();
            this.MapCache        = ImageUtil.CloneBitmap(this.WorldmapBGCache);

            MakePathCombo();
            MakePATHCHIPLIST();

            U.SelectedIndexSafety(PathType, 0);
        }
Ejemplo n.º 6
0
        //道データの長さを求める.
        static InputFormRef.ADDR_AND_LENGTH get_path_data_length_callback(uint addr)
        {
            addr = U.toOffset(addr);

            uint length = WorldMapPathForm.CalcPathDataLength(addr);

            InputFormRef.ADDR_AND_LENGTH aal = new InputFormRef.ADDR_AND_LENGTH();
            aal.addr   = addr;
            aal.length = length;
            return(aal);
        }
Ejemplo n.º 7
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();
            }
        }
        void MakePathCombo()
        {
            List <U.AddrResult> list = WorldMapPathForm.MakeList();

            U.ConvertComboBox(list, ref this.PathType);
        }