using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Geometry; using CodeImp.DoomBuilder.Windows; namespace CodeImp.DoomBuilder.ThreeDFloorMode { public partial class SlopeDataSectorDialog : Form { public SlopeDataSectorDialog() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (General.Map.Map.SelectedSectorsCount == 0) MessageBox.Show("No sectors selected. Please select exactly one sector", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); else if (General.Map.Map.SelectedSectorsCount > 1) MessageBox.Show(General.Map.Map.SelectedSectorsCount.ToString() + " sectors selected. Please select exactly one sector", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); else { General.Map.Map.ClearAllMarks(false); General.Map.Map.GetSelectedSectors(true).First().Marked = true; this.DialogResult = DialogResult.OK; this.Close(); } } private void SlopeDataSectorDialog_Load(object sender, EventArgs e) { webBrowser1.DocumentText = string.Format(System.Globalization.CultureInfo.GetCultureInfo("en-US"), @" The map does not contain a slope data sector. This sector is required by the slope mode to store data for the slope vertex groups. You have two options: Creating the sector in the CSA is the recommended method to use.", this.BackColor.R, this.BackColor.G, this.BackColor.B, this.Font.Name); } private void createnewsector_Click(object sender, EventArgs e) { List drawnvertices = new List(); try { drawnvertices = BuilderPlug.Me.ControlSectorArea.GetNewControlSectorVertices(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } General.Map.Map.ClearAllMarks(false); // DrawLines automatically marks the new sector, so we don't have to do it manually if (Tools.DrawLines(drawnvertices) == false) { MessageBox.Show("Could not draw new sector", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // Update textures General.Map.Data.UpdateUsedTextures(); // Update caches General.Map.Map.Update(); General.Interface.RedrawDisplay(); General.Map.IsChanged = true; this.DialogResult = DialogResult.OK; this.Close(); } } }