Example #1
0
        public static void DumpTerrainAcre(TerrainManager m, int acreIndex, string acre)
        {
            using var sfd = new SaveFileDialog
                  {
                      Filter   = "New Horizons Terrain (*.nht)|*.nht|All files (*.*)|*.*",
                      FileName = $"{acre}.nht",
                  };
            if (sfd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var path = sfd.FileName;
            var data = m.DumpAcre(acreIndex);

            File.WriteAllBytes(path, data);
        }
Example #2
0
        private void B_DumpAcre_Click(object sender, EventArgs e)
        {
            using var sfd = new SaveFileDialog
                  {
                      Filter   = "New Horizons Terrain (*.nht)|*.nht|All files (*.*)|*.*",
                      FileName = $"{CB_Acre.Text}.nht",
                  };
            if (sfd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var path = sfd.FileName;
            var acre = AcreIndex;
            var data = Terrain.DumpAcre(acre);

            File.WriteAllBytes(path, data);
        }