/// <summary> /// Static function to open the filter dialog with additional sample range /// </summary> /// <param name="filter"></param> /// <param name="x1"></param> /// <param name="y1"></param> /// <param name="x2"></param> /// <param name="y2"></param> /// <returns></returns> public static bool RunFilter(IHeightmapFilter filter, int x1, int y1, int x2, int y2) { if (filter == null || TerrainEditor.CurrentTerrain == null || TerrainEditor.CurrentTerrain.EngineTerrain == null) { return(false); } ApplyHeightmapFilterDlg dlg = new ApplyHeightmapFilterDlg(); dlg.Filter = filter; dlg.x1 = x1; dlg.y1 = y1; dlg.x2 = x2; dlg.y2 = y2; return(dlg.ShowDialog() == DialogResult.OK); }
private void comboBox_Import_SelectedIndexChanged(object sender, EventArgs e) { IHeightmapImporter importer = comboBox_Import.SelectedItem as IHeightmapImporter; if (importer == null) { return; } ApplyHeightmapFilterDlg dlg = new ApplyHeightmapFilterDlg(); dlg.Filter = importer; dlg.HasApplyButton = false; // show only if (dlg.ShowDialog() == DialogResult.OK) { Config.SettingsFromImporter(importer); UpdatePropertyGridObj(); UpdateStatistics(); } comboBox_Import.SelectedIndex = 0; }
private void comboBox_Import_SelectedIndexChanged(object sender, EventArgs e) { IHeightmapImporter importer = comboBox_Import.SelectedItem as IHeightmapImporter; if (importer == null) return; ApplyHeightmapFilterDlg dlg = new ApplyHeightmapFilterDlg(); dlg.Filter = importer; dlg.HasApplyButton = false; // show only if (dlg.ShowDialog() == DialogResult.OK) { Config.SettingsFromImporter(importer); UpdatePropertyGridObj(); UpdateStatistics(); } comboBox_Import.SelectedIndex = 0; }
void DecorationFilter_Click(object sender, EventArgs e) { IDecorationFilter filter = ((ToolStripItem)sender).Tag as IDecorationFilter; if (filter.HasCustomProperties) { ApplyHeightmapFilterDlg dlg = new ApplyHeightmapFilterDlg(); dlg.Filter = filter; dlg.ShowDialog(); return; } // run without dialog (see Apply button in dialog): EditorManager.Progress.ShowProgressDialog("Decoration filter : " + filter.Name); TerrainEditor.CurrentTerrain.EngineTerrain.ApplyDecorationFilter(filter, EditorManager.Progress); EditorManager.Actions.Add(new TerrainChangedAction(TerrainEditor.CurrentTerrain.EngineTerrain, "Decoration : " + filter.Name)); EditorManager.Progress.HideProgressDialog(); }
/// <summary> /// Static function to open the filter dialog with additional sample range /// </summary> /// <param name="filter"></param> /// <param name="x1"></param> /// <param name="y1"></param> /// <param name="x2"></param> /// <param name="y2"></param> /// <returns></returns> public static bool RunFilter(IHeightmapFilter filter, int x1, int y1, int x2, int y2) { if (filter == null || TerrainEditor.CurrentTerrain == null || TerrainEditor.CurrentTerrain.EngineTerrain == null) return false; ApplyHeightmapFilterDlg dlg = new ApplyHeightmapFilterDlg(); dlg.Filter = filter; dlg.x1 = x1; dlg.y1 = y1; dlg.x2 = x2; dlg.y2 = y2; return dlg.ShowDialog() == DialogResult.OK; }