public static RenderRegionBiomes ( |
||
region | ||
b | ||
toolTips | String | |
clip | bool | |
return | void |
private void lstRegions_SelectedIndexChanged(object sender, EventArgs e) { if (world == null || lstRegions.SelectedIndex == lastSelectedRegionIndex) { return; } if (!SaveIfNecessary()) { lstRegions.SelectedIndex = lastSelectedRegionIndex; return; } history.FilterOutType(typeof(BiomeAction)); history.FilterOutType(typeof(PopulateAction)); Match m = Regex.Match(lstRegions.SelectedItem.ToString(), @"Region (-?\d+), (-?\d+)"); int x = int.Parse(m.Groups[1].Value); int z = int.Parse(m.Groups[2].Value); String pathFormat = String.Format("{0}{1}r.{{0}}.{{1}}.mca", world.GetRegionDirectory(dim), Path.DirectorySeparatorChar); UpdateStatus("Reading region file"); region = new RegionFile(String.Format(pathFormat, x, z)); history.RecordBiomeState(region, "Initial Biomes"); history.RecordPopulateState(region, "Initial Populate Flags"); history.SetLastSaveActions(); imgRegion.Reset(); UpdateStatus("Generating terrain map"); RegionUtil.RenderRegionTerrain(region, imgRegion.Layers[MAPLAYER].Image, false); UpdateStatus("Generating biome map"); RegionUtil.RenderRegionBiomes(region, imgRegion.Layers[BIOMELAYER].Image, imgRegion.ToolTips, false); UpdateStatus(""); RegionUtil.RenderRegionChunkstobePopulated(region, imgRegion.Layers[POPULATELAYER].Image, false); imgRegion.Redraw(); RegionFile[,] surrounding = new RegionFile[3, 3]; UpdateStatus("Reading surrounding chunks"); surrounding[0, 0] = new RegionFile(String.Format(pathFormat, x - 1, z - 1), 30, 31, 30, 31); surrounding[1, 0] = new RegionFile(String.Format(pathFormat, x, z - 1), 0, 31, 30, 31); surrounding[2, 0] = new RegionFile(String.Format(pathFormat, x + 1, z - 1), 0, 1, 30, 31); surrounding[0, 1] = new RegionFile(String.Format(pathFormat, x - 1, z), 30, 31, 0, 31); surrounding[1, 1] = null; surrounding[2, 1] = new RegionFile(String.Format(pathFormat, x + 1, z, 0, 1, 0, 31)); surrounding[0, 2] = new RegionFile(String.Format(pathFormat, x - 1, z + 1), 30, 31, 0, 1); surrounding[1, 2] = new RegionFile(String.Format(pathFormat, x, z + 1), 0, 31, 0, 1); surrounding[2, 2] = new RegionFile(String.Format(pathFormat, x + 1, z + 1), 0, 1, 0, 1); UpdateStatus("Generating map for surrounding chunks"); RegionUtil.RenderSurroundingRegions(surrounding, imgRegion.Layers[MAPLAYER].Image, imgRegion.Layers[BIOMELAYER].Image, imgRegion.ToolTips, imgRegion.Layers[POPULATELAYER].Image); UpdateStatus(""); imgRegion.Redraw(); lastSelectedRegionIndex = lstRegions.SelectedIndex; }
private void imgRegion_CustomBrushClick(object sender, CustomBrushClickEventArgs e) { if (ClipboardManager.Paste(region, e.MouseX - RegionUtil.OFFSETX, e.MouseY - RegionUtil.OFFSETY)) { 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, "Paste Biomes"); } }
private void reloadCurrentRegionToolStripMenuItem_Click(object sender, EventArgs e) { if (world == null || region == null) { return; } UpdateStatus("Reading region file"); region = new RegionFile(region.Path); history.RecordBiomeState(region, "Reload Biomes"); history.RecordPopulateState(region, "Reload Populate Flags"); history.SetLastSaveActions(); 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(""); RegionUtil.RenderRegionChunkstobePopulated(region, imgRegion.Layers[POPULATELAYER].Image); imgRegion.Redraw(); }
private void btnReplace_Click(object sender, EventArgs e) { if (world == null || region == null) { return; } UpdateStatus("Replacing in selected area"); RegionUtil.Replace(region, imgRegion.Layers[SELECTIONLAYER].Image, imgRegion.SelectionColor, ((BiomeType)cmbReplace1.SelectedItem).ID, cmbReplace2.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, "Replace Biomes"); }