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); }
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); }