void MapSelect_Load(object sender, EventArgs e) { MapList.Items.Clear(); txtPathOut.Text = MapFolderPath; if (DirectoryIsEmpty(MapFolderPath)) { return; } foreach (var map in ModData.FindMapsIn(MapFolderPath)) { ListViewItem map1 = new ListViewItem(); map1.Tag = map; map1.Text = Path.GetFileNameWithoutExtension(map); map1.ImageIndex = 0; MapList.Items.Add(map1); } // hack if (txtNew.Text != "unnamed") { MapList.Items[0].Selected = true; } }
static void UpgradeMaps(string mod) { var MapFolderPath = new string[] { Environment.CurrentDirectory, "mods", mod, "maps" } .Aggregate(Path.Combine); foreach (var path in ModData.FindMapsIn(MapFolderPath)) { var map = new Map(path); // Touch the lazy bits to initialize them map.Actors.Force(); map.Smudges.Force(); map.MapTiles.Force(); map.MapResources.Force(); map.Save(path); } }