private static Fill ( |
||
region | ||
selection | ||
selectionColor | Color | |
util | ||
return | void |
private void Run() { String[] paths = Directory.GetFiles(regionDir, "*.mca", SearchOption.TopDirectoryOnly); String format = String.Format("{{0}} region {{1}} of {0}", paths.Length); int count = 0; foreach (String path in paths) { UpdateStatus(String.Format(format, "Reading", count)); UpdateProgress(count, paths.Length); RegionFile region = new RegionFile(path); UpdateStatus(String.Format(format, replace ? "Replacing" : "Filling", count)); if (!replace) { RegionUtil.Fill(region, null, Color.Black, biome1, worldSeed); } else { RegionUtil.Replace(region, null, Color.Black, ((BiomeType)biome1).ID, biome2, worldSeed); } UpdateStatus(String.Format(format, "Saving", count)); mutex.WaitOne(); region.Write(true); mutex.ReleaseMutex(); count++; } UpdateProgress(paths.Length, paths.Length); UpdateStatus("Done"); }
private void btnFill_Click(object sender, EventArgs e) { if (world == null || region == null) { return; } UpdateStatus("Filling selected area"); RegionUtil.Fill(region, imgRegion.Layers[SELECTIONLAYER].Image, imgRegion.SelectionColor, cmbFill.SelectedItem, world.Seed); if (Settings.RedrawTerrainMap) { UpdateStatus("Generating terrain map"); RegionUtil.RenderRegionTerrain(region, imgRegion.Layers[MAPLAYER].Image); } UpdateStatus("Generating biome map"); RegionUtil.RenderRegionBiomes(region, imgRegion.Layers[BIOMELAYER].Image, imgRegion.ToolTips); UpdateStatus(""); imgRegion.Redraw(); history.RecordBiomeState(region, "Fill Biomes"); }