diff --git a/Build/Configurations/Includes/SRB222_common.cfg b/Build/Configurations/Includes/SRB222_common.cfg
index f01e1487..0e1df4a5 100644
--- a/Build/Configurations/Includes/SRB222_common.cfg
+++ b/Build/Configurations/Includes/SRB222_common.cfg
@@ -121,6 +121,7 @@ mapformat_doom
// When this is set to true, sectors with the same tag will light up when a line is highlighted
linetagindicatesectors = true;
localsidedeftextureoffsets = false;
+ distinctfloorandceilingbrightness = true;
// Special linedefs
include("SRB222_misc.cfg", "speciallinedefs");
diff --git a/Source/Core/Builder.csproj b/Source/Core/Builder.csproj
index f48af9fd..6d412764 100644
--- a/Source/Core/Builder.csproj
+++ b/Source/Core/Builder.csproj
@@ -301,6 +301,12 @@
RunExternalCommandForm.cs
+
+ Form
+
+
+ SectorEditFormSRB2.cs
+
Form
@@ -696,6 +702,9 @@
RunExternalCommandForm.cs
+
+ SectorEditFormSRB2.cs
+
ThingStatisticsForm.cs
diff --git a/Source/Core/BuilderMono.csproj b/Source/Core/BuilderMono.csproj
index e94b0145..cb64c5bd 100644
--- a/Source/Core/BuilderMono.csproj
+++ b/Source/Core/BuilderMono.csproj
@@ -293,6 +293,12 @@
RunExternalCommandForm.cs
+
+ Form
+
+
+ SectorEditFormSRB2.cs
+
Form
@@ -688,6 +694,9 @@
RunExternalCommandForm.cs
+
+ SectorEditFormSRB2.cs
+
ThingStatisticsForm.cs
diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs
index 8ed1e5e9..a06db934 100755
--- a/Source/Core/Windows/MainForm.cs
+++ b/Source/Core/Windows/MainForm.cs
@@ -4216,7 +4216,14 @@ namespace CodeImp.DoomBuilder.Windows
{
if (General.Map.UDMF)
{
- return new SectorEditFormUDMF();
+ if (General.Map.Config.EngineName == "srb2")
+ {
+ return new SectorEditFormSRB2();
+ }
+ else
+ {
+ return new SectorEditFormUDMF();
+ }
}
else
{
diff --git a/Source/Core/Windows/SectorEditFormSRB2.Designer.cs b/Source/Core/Windows/SectorEditFormSRB2.Designer.cs
new file mode 100644
index 00000000..6c615167
--- /dev/null
+++ b/Source/Core/Windows/SectorEditFormSRB2.Designer.cs
@@ -0,0 +1,1171 @@
+namespace CodeImp.DoomBuilder.Windows
+{
+ partial class SectorEditFormSRB2
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if(disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ System.Windows.Forms.GroupBox groupaction;
+ System.Windows.Forms.GroupBox groupeffect;
+ System.Windows.Forms.Label label9;
+ System.Windows.Forms.Label label2;
+ System.Windows.Forms.Label label8;
+ System.Windows.Forms.GroupBox groupfloorceiling;
+ System.Windows.Forms.Label label15;
+ System.Windows.Forms.Label label6;
+ System.Windows.Forms.Label label5;
+ System.Windows.Forms.Label label16;
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SectorEditFormSRB2));
+ this.tagsselector = new CodeImp.DoomBuilder.Controls.TagsSelector();
+ this.brightness = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
+ this.gravity = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
+ this.browseeffect = new System.Windows.Forms.Button();
+ this.effect = new CodeImp.DoomBuilder.Controls.ActionSelectorControl();
+ this.heightoffset = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
+ this.ceilingheight = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
+ this.sectorheightlabel = new System.Windows.Forms.Label();
+ this.sectorheight = new System.Windows.Forms.Label();
+ this.floorheight = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
+ this.tabs = new System.Windows.Forms.TabControl();
+ this.tabproperties = new System.Windows.Forms.TabPage();
+ this.resetdamagetype = new System.Windows.Forms.Button();
+ this.damagetype = new System.Windows.Forms.ComboBox();
+ this.groupBox3 = new System.Windows.Forms.GroupBox();
+ this.flags = new CodeImp.DoomBuilder.Controls.CheckboxArrayControl();
+ this.tabColors = new System.Windows.Forms.TabPage();
+ this.groupBox8 = new System.Windows.Forms.GroupBox();
+ this.lightColor = new CodeImp.DoomBuilder.Controls.ColorFieldsControl();
+ this.fadeColor = new CodeImp.DoomBuilder.Controls.ColorFieldsControl();
+ this.tabSurfaces = new System.Windows.Forms.TabPage();
+ this.groupBox2 = new System.Windows.Forms.GroupBox();
+ this.resetfloorlight = new System.Windows.Forms.Button();
+ this.labelFloorOffsets = new System.Windows.Forms.Label();
+ this.labelFloorScale = new System.Windows.Forms.Label();
+ this.cbUseFloorLineAngles = new System.Windows.Forms.CheckBox();
+ this.floorAngleControl = new CodeImp.DoomBuilder.Controls.AngleControlEx();
+ this.label11 = new System.Windows.Forms.Label();
+ this.floorRotation = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
+ this.floorLightAbsolute = new System.Windows.Forms.CheckBox();
+ this.label12 = new System.Windows.Forms.Label();
+ this.floorBrightness = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
+ this.floorScale = new CodeImp.DoomBuilder.Controls.PairedFieldsControl();
+ this.floorOffsets = new CodeImp.DoomBuilder.Controls.PairedFieldsControl();
+ this.floortex = new CodeImp.DoomBuilder.Controls.FlatSelectorControl();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.resetceillight = new System.Windows.Forms.Button();
+ this.labelCeilOffsets = new System.Windows.Forms.Label();
+ this.labelCeilScale = new System.Windows.Forms.Label();
+ this.cbUseCeilLineAngles = new System.Windows.Forms.CheckBox();
+ this.ceilAngleControl = new CodeImp.DoomBuilder.Controls.AngleControlEx();
+ this.label1 = new System.Windows.Forms.Label();
+ this.ceilRotation = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
+ this.ceilLightAbsolute = new System.Windows.Forms.CheckBox();
+ this.labelLightFront = new System.Windows.Forms.Label();
+ this.ceilBrightness = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
+ this.ceilScale = new CodeImp.DoomBuilder.Controls.PairedFieldsControl();
+ this.ceilOffsets = new CodeImp.DoomBuilder.Controls.PairedFieldsControl();
+ this.ceilingtex = new CodeImp.DoomBuilder.Controls.FlatSelectorControl();
+ this.tabslopes = new System.Windows.Forms.TabPage();
+ this.groupBox5 = new System.Windows.Forms.GroupBox();
+ this.floorslopecontrol = new CodeImp.DoomBuilder.Controls.SectorSlopeControl();
+ this.groupBox4 = new System.Windows.Forms.GroupBox();
+ this.ceilingslopecontrol = new CodeImp.DoomBuilder.Controls.SectorSlopeControl();
+ this.tabcomment = new System.Windows.Forms.TabPage();
+ this.commenteditor = new CodeImp.DoomBuilder.Controls.CommentEditor();
+ this.tabcustom = new System.Windows.Forms.TabPage();
+ this.fieldslist = new CodeImp.DoomBuilder.Controls.FieldsEditorControl();
+ this.cancel = new System.Windows.Forms.Button();
+ this.apply = new System.Windows.Forms.Button();
+ this.tooltip = new System.Windows.Forms.ToolTip(this.components);
+ groupaction = new System.Windows.Forms.GroupBox();
+ groupeffect = new System.Windows.Forms.GroupBox();
+ label9 = new System.Windows.Forms.Label();
+ label2 = new System.Windows.Forms.Label();
+ label8 = new System.Windows.Forms.Label();
+ groupfloorceiling = new System.Windows.Forms.GroupBox();
+ label15 = new System.Windows.Forms.Label();
+ label6 = new System.Windows.Forms.Label();
+ label5 = new System.Windows.Forms.Label();
+ label16 = new System.Windows.Forms.Label();
+ groupaction.SuspendLayout();
+ groupeffect.SuspendLayout();
+ groupfloorceiling.SuspendLayout();
+ this.tabs.SuspendLayout();
+ this.tabproperties.SuspendLayout();
+ this.groupBox3.SuspendLayout();
+ this.tabColors.SuspendLayout();
+ this.groupBox8.SuspendLayout();
+ this.tabSurfaces.SuspendLayout();
+ this.groupBox2.SuspendLayout();
+ this.groupBox1.SuspendLayout();
+ this.tabslopes.SuspendLayout();
+ this.groupBox5.SuspendLayout();
+ this.groupBox4.SuspendLayout();
+ this.tabcomment.SuspendLayout();
+ this.tabcustom.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // groupaction
+ //
+ groupaction.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ groupaction.Controls.Add(this.tagsselector);
+ groupaction.Location = new System.Drawing.Point(7, 445);
+ groupaction.Name = "groupaction";
+ groupaction.Size = new System.Drawing.Size(557, 80);
+ groupaction.TabIndex = 2;
+ groupaction.TabStop = false;
+ groupaction.Text = " Identification ";
+ //
+ // tagsselector
+ //
+ this.tagsselector.Location = new System.Drawing.Point(6, 15);
+ this.tagsselector.Name = "tagsselector";
+ this.tagsselector.Size = new System.Drawing.Size(545, 60);
+ this.tagsselector.TabIndex = 0;
+ //
+ // groupeffect
+ //
+ groupeffect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ groupeffect.Controls.Add(label16);
+ groupeffect.Controls.Add(this.resetdamagetype);
+ groupeffect.Controls.Add(this.brightness);
+ groupeffect.Controls.Add(this.damagetype);
+ groupeffect.Controls.Add(label9);
+ groupeffect.Controls.Add(this.gravity);
+ groupeffect.Controls.Add(label2);
+ groupeffect.Controls.Add(this.browseeffect);
+ groupeffect.Controls.Add(this.effect);
+ groupeffect.Controls.Add(label8);
+ groupeffect.Location = new System.Drawing.Point(7, 330);
+ groupeffect.Name = "groupeffect";
+ groupeffect.Size = new System.Drawing.Size(557, 109);
+ groupeffect.TabIndex = 1;
+ groupeffect.TabStop = false;
+ groupeffect.Text = " Effects ";
+ //
+ // brightness
+ //
+ this.brightness.AllowDecimal = false;
+ this.brightness.AllowExpressions = false;
+ this.brightness.AllowNegative = false;
+ this.brightness.AllowRelative = true;
+ this.brightness.ButtonStep = 8;
+ this.brightness.ButtonStepBig = 16F;
+ this.brightness.ButtonStepFloat = 1F;
+ this.brightness.ButtonStepSmall = 1F;
+ this.brightness.ButtonStepsUseModifierKeys = true;
+ this.brightness.ButtonStepsWrapAround = false;
+ this.brightness.Location = new System.Drawing.Point(89, 46);
+ this.brightness.Name = "brightness";
+ this.brightness.Size = new System.Drawing.Size(81, 24);
+ this.brightness.StepValues = null;
+ this.brightness.TabIndex = 4;
+ this.brightness.WhenTextChanged += new System.EventHandler(this.brightness_WhenTextChanged);
+ //
+ // label9
+ //
+ label9.AutoSize = true;
+ label9.Location = new System.Drawing.Point(21, 51);
+ label9.Name = "label9";
+ label9.Size = new System.Drawing.Size(59, 13);
+ label9.TabIndex = 3;
+ label9.Text = "Brightness:";
+ //
+ // gravity
+ //
+ this.gravity.AllowDecimal = true;
+ this.gravity.AllowExpressions = false;
+ this.gravity.AllowNegative = true;
+ this.gravity.AllowRelative = true;
+ this.gravity.ButtonStep = 1;
+ this.gravity.ButtonStepBig = 1F;
+ this.gravity.ButtonStepFloat = 0.1F;
+ this.gravity.ButtonStepSmall = 0.01F;
+ this.gravity.ButtonStepsUseModifierKeys = true;
+ this.gravity.ButtonStepsWrapAround = false;
+ this.gravity.Location = new System.Drawing.Point(89, 74);
+ this.gravity.Name = "gravity";
+ this.gravity.Size = new System.Drawing.Size(81, 24);
+ this.gravity.StepValues = null;
+ this.gravity.TabIndex = 6;
+ //
+ // label2
+ //
+ label2.Location = new System.Drawing.Point(9, 79);
+ label2.Name = "label2";
+ label2.Size = new System.Drawing.Size(74, 14);
+ label2.TabIndex = 5;
+ label2.Text = "Gravity:";
+ label2.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // browseeffect
+ //
+ this.browseeffect.Image = ((System.Drawing.Image)(resources.GetObject("browseeffect.Image")));
+ this.browseeffect.Location = new System.Drawing.Point(523, 16);
+ this.browseeffect.Name = "browseeffect";
+ this.browseeffect.Size = new System.Drawing.Size(28, 25);
+ this.browseeffect.TabIndex = 2;
+ this.browseeffect.Text = " ";
+ this.browseeffect.UseVisualStyleBackColor = true;
+ this.browseeffect.Click += new System.EventHandler(this.browseeffect_Click);
+ //
+ // effect
+ //
+ this.effect.BackColor = System.Drawing.Color.Transparent;
+ this.effect.Cursor = System.Windows.Forms.Cursors.Default;
+ this.effect.Empty = false;
+ this.effect.GeneralizedCategories = null;
+ this.effect.GeneralizedOptions = null;
+ this.effect.Location = new System.Drawing.Point(89, 18);
+ this.effect.Name = "effect";
+ this.effect.Size = new System.Drawing.Size(428, 21);
+ this.effect.TabIndex = 1;
+ this.effect.Value = 402;
+ //
+ // label8
+ //
+ label8.AutoSize = true;
+ label8.Location = new System.Drawing.Point(35, 22);
+ label8.Name = "label8";
+ label8.Size = new System.Drawing.Size(45, 13);
+ label8.TabIndex = 0;
+ label8.Text = "Special:";
+ //
+ // groupfloorceiling
+ //
+ groupfloorceiling.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ groupfloorceiling.Controls.Add(label15);
+ groupfloorceiling.Controls.Add(label6);
+ groupfloorceiling.Controls.Add(label5);
+ groupfloorceiling.Controls.Add(this.heightoffset);
+ groupfloorceiling.Controls.Add(this.ceilingheight);
+ groupfloorceiling.Controls.Add(this.sectorheightlabel);
+ groupfloorceiling.Controls.Add(this.sectorheight);
+ groupfloorceiling.Controls.Add(this.floorheight);
+ groupfloorceiling.Location = new System.Drawing.Point(7, 186);
+ groupfloorceiling.Name = "groupfloorceiling";
+ groupfloorceiling.Size = new System.Drawing.Size(254, 138);
+ groupfloorceiling.TabIndex = 0;
+ groupfloorceiling.TabStop = false;
+ groupfloorceiling.Text = " Heights ";
+ //
+ // label15
+ //
+ label15.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ label15.ForeColor = System.Drawing.SystemColors.HotTrack;
+ label15.Location = new System.Drawing.Point(9, 83);
+ label15.Name = "label15";
+ label15.Size = new System.Drawing.Size(74, 14);
+ label15.TabIndex = 4;
+ label15.Text = "Height offset:";
+ label15.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ this.tooltip.SetToolTip(label15, "Changes floor and ceiling height by given value.\r\nUse \"++\" to raise by sector hei" +
+ "ght.\r\nUse \"--\" to lower by sector height.");
+ //
+ // label6
+ //
+ label6.Location = new System.Drawing.Point(9, 23);
+ label6.Name = "label6";
+ label6.Size = new System.Drawing.Size(74, 14);
+ label6.TabIndex = 0;
+ label6.Text = "Ceiling height:";
+ label6.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // label5
+ //
+ label5.Location = new System.Drawing.Point(9, 53);
+ label5.Name = "label5";
+ label5.Size = new System.Drawing.Size(74, 14);
+ label5.TabIndex = 2;
+ label5.Text = "Floor height:";
+ label5.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // heightoffset
+ //
+ this.heightoffset.AllowDecimal = false;
+ this.heightoffset.AllowExpressions = true;
+ this.heightoffset.AllowNegative = true;
+ this.heightoffset.AllowRelative = true;
+ this.heightoffset.ButtonStep = 8;
+ this.heightoffset.ButtonStepBig = 16F;
+ this.heightoffset.ButtonStepFloat = 1F;
+ this.heightoffset.ButtonStepSmall = 1F;
+ this.heightoffset.ButtonStepsUseModifierKeys = true;
+ this.heightoffset.ButtonStepsWrapAround = false;
+ this.heightoffset.Location = new System.Drawing.Point(89, 78);
+ this.heightoffset.Name = "heightoffset";
+ this.heightoffset.Size = new System.Drawing.Size(81, 24);
+ this.heightoffset.StepValues = null;
+ this.heightoffset.TabIndex = 5;
+ this.heightoffset.WhenTextChanged += new System.EventHandler(this.heightoffset_WhenTextChanged);
+ //
+ // ceilingheight
+ //
+ this.ceilingheight.AllowDecimal = false;
+ this.ceilingheight.AllowExpressions = true;
+ this.ceilingheight.AllowNegative = true;
+ this.ceilingheight.AllowRelative = true;
+ this.ceilingheight.ButtonStep = 8;
+ this.ceilingheight.ButtonStepBig = 16F;
+ this.ceilingheight.ButtonStepFloat = 1F;
+ this.ceilingheight.ButtonStepSmall = 1F;
+ this.ceilingheight.ButtonStepsUseModifierKeys = true;
+ this.ceilingheight.ButtonStepsWrapAround = false;
+ this.ceilingheight.Location = new System.Drawing.Point(89, 18);
+ this.ceilingheight.Name = "ceilingheight";
+ this.ceilingheight.Size = new System.Drawing.Size(81, 24);
+ this.ceilingheight.StepValues = null;
+ this.ceilingheight.TabIndex = 1;
+ this.ceilingheight.WhenTextChanged += new System.EventHandler(this.ceilingheight_WhenTextChanged);
+ //
+ // sectorheightlabel
+ //
+ this.sectorheightlabel.Location = new System.Drawing.Point(9, 113);
+ this.sectorheightlabel.Name = "sectorheightlabel";
+ this.sectorheightlabel.Size = new System.Drawing.Size(74, 14);
+ this.sectorheightlabel.TabIndex = 6;
+ this.sectorheightlabel.Text = "Sector height:";
+ this.sectorheightlabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // sectorheight
+ //
+ this.sectorheight.AutoSize = true;
+ this.sectorheight.Location = new System.Drawing.Point(89, 114);
+ this.sectorheight.Name = "sectorheight";
+ this.sectorheight.Size = new System.Drawing.Size(13, 13);
+ this.sectorheight.TabIndex = 7;
+ this.sectorheight.Text = "0";
+ //
+ // floorheight
+ //
+ this.floorheight.AllowDecimal = false;
+ this.floorheight.AllowExpressions = true;
+ this.floorheight.AllowNegative = true;
+ this.floorheight.AllowRelative = true;
+ this.floorheight.ButtonStep = 8;
+ this.floorheight.ButtonStepBig = 16F;
+ this.floorheight.ButtonStepFloat = 1F;
+ this.floorheight.ButtonStepSmall = 1F;
+ this.floorheight.ButtonStepsUseModifierKeys = true;
+ this.floorheight.ButtonStepsWrapAround = false;
+ this.floorheight.Location = new System.Drawing.Point(89, 48);
+ this.floorheight.Name = "floorheight";
+ this.floorheight.Size = new System.Drawing.Size(81, 24);
+ this.floorheight.StepValues = null;
+ this.floorheight.TabIndex = 3;
+ this.floorheight.WhenTextChanged += new System.EventHandler(this.floorheight_WhenTextChanged);
+ //
+ // label16
+ //
+ label16.Location = new System.Drawing.Point(218, 50);
+ label16.Name = "label16";
+ label16.Size = new System.Drawing.Size(74, 14);
+ label16.TabIndex = 0;
+ label16.Text = "Damage:";
+ label16.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // tabs
+ //
+ this.tabs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.tabs.Controls.Add(this.tabproperties);
+ this.tabs.Controls.Add(this.tabColors);
+ this.tabs.Controls.Add(this.tabSurfaces);
+ this.tabs.Controls.Add(this.tabslopes);
+ this.tabs.Controls.Add(this.tabcomment);
+ this.tabs.Controls.Add(this.tabcustom);
+ this.tabs.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+ this.tabs.Location = new System.Drawing.Point(10, 10);
+ this.tabs.Margin = new System.Windows.Forms.Padding(1);
+ this.tabs.Name = "tabs";
+ this.tabs.Padding = new System.Drawing.Point(20, 3);
+ this.tabs.SelectedIndex = 0;
+ this.tabs.Size = new System.Drawing.Size(578, 552);
+ this.tabs.TabIndex = 1;
+ //
+ // tabproperties
+ //
+ this.tabproperties.Controls.Add(this.groupBox3);
+ this.tabproperties.Controls.Add(groupaction);
+ this.tabproperties.Controls.Add(groupeffect);
+ this.tabproperties.Controls.Add(groupfloorceiling);
+ this.tabproperties.Cursor = System.Windows.Forms.Cursors.Arrow;
+ this.tabproperties.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.tabproperties.Location = new System.Drawing.Point(4, 22);
+ this.tabproperties.Name = "tabproperties";
+ this.tabproperties.Padding = new System.Windows.Forms.Padding(3);
+ this.tabproperties.Size = new System.Drawing.Size(570, 526);
+ this.tabproperties.TabIndex = 0;
+ this.tabproperties.Text = "Properties";
+ this.tabproperties.UseVisualStyleBackColor = true;
+ //
+ // resetdamagetype
+ //
+ this.resetdamagetype.Image = ((System.Drawing.Image)(resources.GetObject("resetdamagetype.Image")));
+ this.resetdamagetype.Location = new System.Drawing.Point(471, 44);
+ this.resetdamagetype.Name = "resetdamagetype";
+ this.resetdamagetype.Size = new System.Drawing.Size(28, 25);
+ this.resetdamagetype.TabIndex = 2;
+ this.resetdamagetype.Text = " ";
+ this.tooltip.SetToolTip(this.resetdamagetype, "Reset");
+ this.resetdamagetype.UseVisualStyleBackColor = true;
+ this.resetdamagetype.Click += new System.EventHandler(this.resetdamagetype_Click);
+ //
+ // damagetype
+ //
+ this.damagetype.FormattingEnabled = true;
+ this.damagetype.Location = new System.Drawing.Point(298, 46);
+ this.damagetype.Name = "damagetype";
+ this.damagetype.Size = new System.Drawing.Size(167, 21);
+ this.damagetype.TabIndex = 1;
+ this.damagetype.TextChanged += new System.EventHandler(this.damagetype_TextChanged);
+ this.damagetype.MouseDown += new System.Windows.Forms.MouseEventHandler(this.damagetype_MouseDown);
+ //
+ // groupBox3
+ //
+ this.groupBox3.Controls.Add(this.flags);
+ this.groupBox3.Location = new System.Drawing.Point(7, 6);
+ this.groupBox3.Name = "groupBox3";
+ this.groupBox3.Size = new System.Drawing.Size(557, 174);
+ this.groupBox3.TabIndex = 0;
+ this.groupBox3.TabStop = false;
+ this.groupBox3.Text = " Flags ";
+ //
+ // flags
+ //
+ this.flags.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.flags.AutoScroll = true;
+ this.flags.Columns = 2;
+ this.flags.Location = new System.Drawing.Point(15, 21);
+ this.flags.Name = "flags";
+ this.flags.Size = new System.Drawing.Size(536, 147);
+ this.flags.TabIndex = 0;
+ this.flags.VerticalSpacing = 1;
+ //
+ // tabColors
+ //
+ this.tabColors.Controls.Add(this.groupBox8);
+ this.tabColors.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+ this.tabColors.Location = new System.Drawing.Point(4, 22);
+ this.tabColors.Name = "tabColors";
+ this.tabColors.Size = new System.Drawing.Size(570, 526);
+ this.tabColors.TabIndex = 5;
+ this.tabColors.Text = "Colors";
+ this.tabColors.UseVisualStyleBackColor = true;
+ //
+ // groupBox8
+ //
+ this.groupBox8.Controls.Add(this.lightColor);
+ this.groupBox8.Controls.Add(this.fadeColor);
+ this.groupBox8.Location = new System.Drawing.Point(3, 3);
+ this.groupBox8.Name = "groupBox8";
+ this.groupBox8.Size = new System.Drawing.Size(277, 196);
+ this.groupBox8.TabIndex = 18;
+ this.groupBox8.TabStop = false;
+ this.groupBox8.Text = "Global sector colors";
+ //
+ // lightColor
+ //
+ this.lightColor.DefaultValue = 16777215;
+ this.lightColor.Field = "lightcolor";
+ this.lightColor.Label = "Light:";
+ this.lightColor.Location = new System.Drawing.Point(6, 19);
+ this.lightColor.Name = "lightColor";
+ this.lightColor.Size = new System.Drawing.Size(207, 29);
+ this.lightColor.TabIndex = 16;
+ this.lightColor.OnValueChanged += new System.EventHandler(this.lightColor_OnValueChanged);
+ //
+ // fadeColor
+ //
+ this.fadeColor.DefaultValue = 0;
+ this.fadeColor.Field = "fadecolor";
+ this.fadeColor.Label = "Fade:";
+ this.fadeColor.Location = new System.Drawing.Point(6, 47);
+ this.fadeColor.Name = "fadeColor";
+ this.fadeColor.Size = new System.Drawing.Size(207, 31);
+ this.fadeColor.TabIndex = 17;
+ this.fadeColor.OnValueChanged += new System.EventHandler(this.fadeColor_OnValueChanged);
+ //
+ // tabSurfaces
+ //
+ this.tabSurfaces.Controls.Add(this.groupBox2);
+ this.tabSurfaces.Controls.Add(this.groupBox1);
+ this.tabSurfaces.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.tabSurfaces.Location = new System.Drawing.Point(4, 22);
+ this.tabSurfaces.Name = "tabSurfaces";
+ this.tabSurfaces.Size = new System.Drawing.Size(570, 526);
+ this.tabSurfaces.TabIndex = 2;
+ this.tabSurfaces.Text = "Surfaces";
+ this.tabSurfaces.UseVisualStyleBackColor = true;
+ //
+ // groupBox2
+ //
+ this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.groupBox2.Controls.Add(this.resetfloorlight);
+ this.groupBox2.Controls.Add(this.labelFloorOffsets);
+ this.groupBox2.Controls.Add(this.labelFloorScale);
+ this.groupBox2.Controls.Add(this.cbUseFloorLineAngles);
+ this.groupBox2.Controls.Add(this.floorAngleControl);
+ this.groupBox2.Controls.Add(this.label11);
+ this.groupBox2.Controls.Add(this.floorRotation);
+ this.groupBox2.Controls.Add(this.floorLightAbsolute);
+ this.groupBox2.Controls.Add(this.label12);
+ this.groupBox2.Controls.Add(this.floorBrightness);
+ this.groupBox2.Controls.Add(this.floorScale);
+ this.groupBox2.Controls.Add(this.floorOffsets);
+ this.groupBox2.Controls.Add(this.floortex);
+ this.groupBox2.Location = new System.Drawing.Point(3, 244);
+ this.groupBox2.Name = "groupBox2";
+ this.groupBox2.Size = new System.Drawing.Size(564, 235);
+ this.groupBox2.TabIndex = 55;
+ this.groupBox2.TabStop = false;
+ this.groupBox2.Text = " Floor ";
+ //
+ // resetfloorlight
+ //
+ this.resetfloorlight.Image = ((System.Drawing.Image)(resources.GetObject("resetfloorlight.Image")));
+ this.resetfloorlight.Location = new System.Drawing.Point(246, 138);
+ this.resetfloorlight.Name = "resetfloorlight";
+ this.resetfloorlight.Size = new System.Drawing.Size(23, 23);
+ this.resetfloorlight.TabIndex = 12;
+ this.tooltip.SetToolTip(this.resetfloorlight, "Reset");
+ this.resetfloorlight.UseVisualStyleBackColor = true;
+ this.resetfloorlight.Click += new System.EventHandler(this.resetfloorlight_Click);
+ //
+ // labelFloorOffsets
+ //
+ this.labelFloorOffsets.Location = new System.Drawing.Point(8, 27);
+ this.labelFloorOffsets.Name = "labelFloorOffsets";
+ this.labelFloorOffsets.Size = new System.Drawing.Size(98, 14);
+ this.labelFloorOffsets.TabIndex = 0;
+ this.labelFloorOffsets.Tag = "";
+ this.labelFloorOffsets.Text = "Texture offsets:";
+ this.labelFloorOffsets.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // labelFloorScale
+ //
+ this.labelFloorScale.Location = new System.Drawing.Point(8, 59);
+ this.labelFloorScale.Name = "labelFloorScale";
+ this.labelFloorScale.Size = new System.Drawing.Size(98, 14);
+ this.labelFloorScale.TabIndex = 2;
+ this.labelFloorScale.Tag = "";
+ this.labelFloorScale.Text = "Texture scale:";
+ this.labelFloorScale.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // cbUseFloorLineAngles
+ //
+ this.cbUseFloorLineAngles.AutoSize = true;
+ this.cbUseFloorLineAngles.Location = new System.Drawing.Point(181, 172);
+ this.cbUseFloorLineAngles.Name = "cbUseFloorLineAngles";
+ this.cbUseFloorLineAngles.Size = new System.Drawing.Size(113, 17);
+ this.cbUseFloorLineAngles.TabIndex = 16;
+ this.cbUseFloorLineAngles.Tag = "";
+ this.cbUseFloorLineAngles.Text = "Use linedef angles";
+ this.cbUseFloorLineAngles.UseVisualStyleBackColor = true;
+ this.cbUseFloorLineAngles.CheckedChanged += new System.EventHandler(this.cbUseFloorLineAngles_CheckedChanged);
+ //
+ // floorAngleControl
+ //
+ this.floorAngleControl.Angle = -1800;
+ this.floorAngleControl.AngleOffset = 90;
+ this.floorAngleControl.DoomAngleClamping = false;
+ this.floorAngleControl.Location = new System.Drawing.Point(6, 156);
+ this.floorAngleControl.Name = "floorAngleControl";
+ this.floorAngleControl.Size = new System.Drawing.Size(44, 44);
+ this.floorAngleControl.TabIndex = 13;
+ this.floorAngleControl.AngleChanged += new System.EventHandler(this.floorAngleControl_AngleChanged);
+ //
+ // label11
+ //
+ this.label11.Location = new System.Drawing.Point(26, 172);
+ this.label11.Name = "label11";
+ this.label11.Size = new System.Drawing.Size(80, 14);
+ this.label11.TabIndex = 14;
+ this.label11.Tag = "";
+ this.label11.Text = "Rotation:";
+ this.label11.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // floorRotation
+ //
+ this.floorRotation.AllowDecimal = true;
+ this.floorRotation.AllowExpressions = false;
+ this.floorRotation.AllowNegative = true;
+ this.floorRotation.AllowRelative = true;
+ this.floorRotation.ButtonStep = 5;
+ this.floorRotation.ButtonStepBig = 15F;
+ this.floorRotation.ButtonStepFloat = 1F;
+ this.floorRotation.ButtonStepSmall = 0.1F;
+ this.floorRotation.ButtonStepsUseModifierKeys = true;
+ this.floorRotation.ButtonStepsWrapAround = false;
+ this.floorRotation.Location = new System.Drawing.Point(113, 167);
+ this.floorRotation.Name = "floorRotation";
+ this.floorRotation.Size = new System.Drawing.Size(62, 24);
+ this.floorRotation.StepValues = null;
+ this.floorRotation.TabIndex = 15;
+ this.floorRotation.Tag = "";
+ this.floorRotation.WhenTextChanged += new System.EventHandler(this.floorRotation_WhenTextChanged);
+ //
+ // floorLightAbsolute
+ //
+ this.floorLightAbsolute.AutoSize = true;
+ this.floorLightAbsolute.Location = new System.Drawing.Point(181, 142);
+ this.floorLightAbsolute.Name = "floorLightAbsolute";
+ this.floorLightAbsolute.Size = new System.Drawing.Size(67, 17);
+ this.floorLightAbsolute.TabIndex = 11;
+ this.floorLightAbsolute.Text = "Absolute";
+ this.floorLightAbsolute.UseVisualStyleBackColor = true;
+ this.floorLightAbsolute.CheckedChanged += new System.EventHandler(this.floorLightAbsolute_CheckedChanged);
+ //
+ // label12
+ //
+ this.label12.Location = new System.Drawing.Point(26, 142);
+ this.label12.Name = "label12";
+ this.label12.Size = new System.Drawing.Size(80, 14);
+ this.label12.TabIndex = 9;
+ this.label12.Tag = "";
+ this.label12.Text = "Brightness:";
+ this.label12.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // floorBrightness
+ //
+ this.floorBrightness.AllowDecimal = false;
+ this.floorBrightness.AllowExpressions = false;
+ this.floorBrightness.AllowNegative = true;
+ this.floorBrightness.AllowRelative = true;
+ this.floorBrightness.ButtonStep = 16;
+ this.floorBrightness.ButtonStepBig = 32F;
+ this.floorBrightness.ButtonStepFloat = 1F;
+ this.floorBrightness.ButtonStepSmall = 1F;
+ this.floorBrightness.ButtonStepsUseModifierKeys = true;
+ this.floorBrightness.ButtonStepsWrapAround = false;
+ this.floorBrightness.Location = new System.Drawing.Point(113, 137);
+ this.floorBrightness.Name = "floorBrightness";
+ this.floorBrightness.Size = new System.Drawing.Size(62, 24);
+ this.floorBrightness.StepValues = null;
+ this.floorBrightness.TabIndex = 10;
+ this.floorBrightness.Tag = "lightfloor";
+ this.floorBrightness.WhenTextChanged += new System.EventHandler(this.floorBrightness_WhenTextChanged);
+ //
+ // floorScale
+ //
+ this.floorScale.AllowDecimal = true;
+ this.floorScale.AllowValueLinking = true;
+ this.floorScale.ButtonStep = 1;
+ this.floorScale.ButtonStepBig = 1F;
+ this.floorScale.ButtonStepFloat = 0.1F;
+ this.floorScale.ButtonStepSmall = 0.01F;
+ this.floorScale.ButtonStepsUseModifierKeys = true;
+ this.floorScale.DefaultValue = 1F;
+ this.floorScale.Field1 = "xscalefloor";
+ this.floorScale.Field2 = "yscalefloor";
+ this.floorScale.LinkValues = false;
+ this.floorScale.Location = new System.Drawing.Point(110, 53);
+ this.floorScale.Name = "floorScale";
+ this.floorScale.Size = new System.Drawing.Size(186, 26);
+ this.floorScale.TabIndex = 3;
+ this.floorScale.OnValuesChanged += new System.EventHandler(this.floorScale_OnValuesChanged);
+ //
+ // floorOffsets
+ //
+ this.floorOffsets.AllowDecimal = true;
+ this.floorOffsets.AllowValueLinking = false;
+ this.floorOffsets.ButtonStep = 1;
+ this.floorOffsets.ButtonStepBig = 32F;
+ this.floorOffsets.ButtonStepFloat = 16F;
+ this.floorOffsets.ButtonStepSmall = 1F;
+ this.floorOffsets.ButtonStepsUseModifierKeys = true;
+ this.floorOffsets.DefaultValue = 0F;
+ this.floorOffsets.Field1 = "xpanningfloor";
+ this.floorOffsets.Field2 = "ypanningfloor";
+ this.floorOffsets.LinkValues = false;
+ this.floorOffsets.Location = new System.Drawing.Point(110, 21);
+ this.floorOffsets.Name = "floorOffsets";
+ this.floorOffsets.Size = new System.Drawing.Size(186, 26);
+ this.floorOffsets.TabIndex = 1;
+ this.floorOffsets.OnValuesChanged += new System.EventHandler(this.floorOffsets_OnValuesChanged);
+ //
+ // floortex
+ //
+ this.floortex.Location = new System.Drawing.Point(356, 21);
+ this.floortex.MultipleTextures = false;
+ this.floortex.Name = "floortex";
+ this.floortex.Size = new System.Drawing.Size(176, 200);
+ this.floortex.TabIndex = 25;
+ this.floortex.TextureName = "";
+ this.floortex.OnValueChanged += new System.EventHandler(this.floortex_OnValueChanged);
+ //
+ // groupBox1
+ //
+ this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.groupBox1.Controls.Add(this.resetceillight);
+ this.groupBox1.Controls.Add(this.labelCeilOffsets);
+ this.groupBox1.Controls.Add(this.labelCeilScale);
+ this.groupBox1.Controls.Add(this.cbUseCeilLineAngles);
+ this.groupBox1.Controls.Add(this.ceilAngleControl);
+ this.groupBox1.Controls.Add(this.label1);
+ this.groupBox1.Controls.Add(this.ceilRotation);
+ this.groupBox1.Controls.Add(this.ceilLightAbsolute);
+ this.groupBox1.Controls.Add(this.labelLightFront);
+ this.groupBox1.Controls.Add(this.ceilBrightness);
+ this.groupBox1.Controls.Add(this.ceilScale);
+ this.groupBox1.Controls.Add(this.ceilOffsets);
+ this.groupBox1.Controls.Add(this.ceilingtex);
+ this.groupBox1.Location = new System.Drawing.Point(3, 3);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(564, 235);
+ this.groupBox1.TabIndex = 0;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = " Ceiling ";
+ //
+ // resetceillight
+ //
+ this.resetceillight.Image = ((System.Drawing.Image)(resources.GetObject("resetceillight.Image")));
+ this.resetceillight.Location = new System.Drawing.Point(246, 138);
+ this.resetceillight.Name = "resetceillight";
+ this.resetceillight.Size = new System.Drawing.Size(23, 23);
+ this.resetceillight.TabIndex = 12;
+ this.tooltip.SetToolTip(this.resetceillight, "Reset");
+ this.resetceillight.UseVisualStyleBackColor = true;
+ this.resetceillight.Click += new System.EventHandler(this.resetceillight_Click);
+ //
+ // labelCeilOffsets
+ //
+ this.labelCeilOffsets.Location = new System.Drawing.Point(8, 27);
+ this.labelCeilOffsets.Name = "labelCeilOffsets";
+ this.labelCeilOffsets.Size = new System.Drawing.Size(98, 14);
+ this.labelCeilOffsets.TabIndex = 0;
+ this.labelCeilOffsets.Tag = "";
+ this.labelCeilOffsets.Text = "Texture offsets:";
+ this.labelCeilOffsets.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // labelCeilScale
+ //
+ this.labelCeilScale.Location = new System.Drawing.Point(8, 59);
+ this.labelCeilScale.Name = "labelCeilScale";
+ this.labelCeilScale.Size = new System.Drawing.Size(98, 14);
+ this.labelCeilScale.TabIndex = 2;
+ this.labelCeilScale.Tag = "";
+ this.labelCeilScale.Text = "Texture scale:";
+ this.labelCeilScale.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // cbUseCeilLineAngles
+ //
+ this.cbUseCeilLineAngles.AutoSize = true;
+ this.cbUseCeilLineAngles.Location = new System.Drawing.Point(181, 172);
+ this.cbUseCeilLineAngles.Name = "cbUseCeilLineAngles";
+ this.cbUseCeilLineAngles.Size = new System.Drawing.Size(113, 17);
+ this.cbUseCeilLineAngles.TabIndex = 16;
+ this.cbUseCeilLineAngles.Tag = "";
+ this.cbUseCeilLineAngles.Text = "Use linedef angles";
+ this.cbUseCeilLineAngles.UseVisualStyleBackColor = true;
+ this.cbUseCeilLineAngles.CheckedChanged += new System.EventHandler(this.cbUseCeilLineAngles_CheckedChanged);
+ //
+ // ceilAngleControl
+ //
+ this.ceilAngleControl.Angle = -1800;
+ this.ceilAngleControl.AngleOffset = 90;
+ this.ceilAngleControl.DoomAngleClamping = false;
+ this.ceilAngleControl.Location = new System.Drawing.Point(6, 156);
+ this.ceilAngleControl.Name = "ceilAngleControl";
+ this.ceilAngleControl.Size = new System.Drawing.Size(44, 44);
+ this.ceilAngleControl.TabIndex = 13;
+ this.ceilAngleControl.AngleChanged += new System.EventHandler(this.ceilAngleControl_AngleChanged);
+ //
+ // label1
+ //
+ this.label1.Location = new System.Drawing.Point(26, 172);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(80, 14);
+ this.label1.TabIndex = 14;
+ this.label1.Tag = "";
+ this.label1.Text = "Rotation:";
+ this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // ceilRotation
+ //
+ this.ceilRotation.AllowDecimal = true;
+ this.ceilRotation.AllowExpressions = false;
+ this.ceilRotation.AllowNegative = true;
+ this.ceilRotation.AllowRelative = true;
+ this.ceilRotation.ButtonStep = 5;
+ this.ceilRotation.ButtonStepBig = 15F;
+ this.ceilRotation.ButtonStepFloat = 1F;
+ this.ceilRotation.ButtonStepSmall = 0.1F;
+ this.ceilRotation.ButtonStepsUseModifierKeys = true;
+ this.ceilRotation.ButtonStepsWrapAround = true;
+ this.ceilRotation.Location = new System.Drawing.Point(113, 167);
+ this.ceilRotation.Name = "ceilRotation";
+ this.ceilRotation.Size = new System.Drawing.Size(62, 24);
+ this.ceilRotation.StepValues = null;
+ this.ceilRotation.TabIndex = 15;
+ this.ceilRotation.Tag = "";
+ this.ceilRotation.WhenTextChanged += new System.EventHandler(this.ceilRotation_WhenTextChanged);
+ //
+ // ceilLightAbsolute
+ //
+ this.ceilLightAbsolute.AutoSize = true;
+ this.ceilLightAbsolute.Location = new System.Drawing.Point(181, 142);
+ this.ceilLightAbsolute.Name = "ceilLightAbsolute";
+ this.ceilLightAbsolute.Size = new System.Drawing.Size(67, 17);
+ this.ceilLightAbsolute.TabIndex = 11;
+ this.ceilLightAbsolute.Tag = "";
+ this.ceilLightAbsolute.Text = "Absolute";
+ this.ceilLightAbsolute.UseVisualStyleBackColor = true;
+ this.ceilLightAbsolute.CheckedChanged += new System.EventHandler(this.ceilLightAbsolute_CheckedChanged);
+ //
+ // labelLightFront
+ //
+ this.labelLightFront.Location = new System.Drawing.Point(26, 142);
+ this.labelLightFront.Name = "labelLightFront";
+ this.labelLightFront.Size = new System.Drawing.Size(80, 14);
+ this.labelLightFront.TabIndex = 9;
+ this.labelLightFront.Tag = "";
+ this.labelLightFront.Text = "Brightness:";
+ this.labelLightFront.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // ceilBrightness
+ //
+ this.ceilBrightness.AllowDecimal = false;
+ this.ceilBrightness.AllowExpressions = false;
+ this.ceilBrightness.AllowNegative = true;
+ this.ceilBrightness.AllowRelative = true;
+ this.ceilBrightness.ButtonStep = 16;
+ this.ceilBrightness.ButtonStepBig = 32F;
+ this.ceilBrightness.ButtonStepFloat = 1F;
+ this.ceilBrightness.ButtonStepSmall = 1F;
+ this.ceilBrightness.ButtonStepsUseModifierKeys = true;
+ this.ceilBrightness.ButtonStepsWrapAround = false;
+ this.ceilBrightness.Location = new System.Drawing.Point(113, 137);
+ this.ceilBrightness.Name = "ceilBrightness";
+ this.ceilBrightness.Size = new System.Drawing.Size(62, 24);
+ this.ceilBrightness.StepValues = null;
+ this.ceilBrightness.TabIndex = 10;
+ this.ceilBrightness.Tag = "lightceiling";
+ this.ceilBrightness.WhenTextChanged += new System.EventHandler(this.ceilBrightness_WhenTextChanged);
+ //
+ // ceilScale
+ //
+ this.ceilScale.AllowDecimal = true;
+ this.ceilScale.AllowValueLinking = true;
+ this.ceilScale.ButtonStep = 1;
+ this.ceilScale.ButtonStepBig = 1F;
+ this.ceilScale.ButtonStepFloat = 0.1F;
+ this.ceilScale.ButtonStepSmall = 0.01F;
+ this.ceilScale.ButtonStepsUseModifierKeys = true;
+ this.ceilScale.DefaultValue = 1F;
+ this.ceilScale.Field1 = "xscaleceiling";
+ this.ceilScale.Field2 = "yscaleceiling";
+ this.ceilScale.LinkValues = false;
+ this.ceilScale.Location = new System.Drawing.Point(110, 53);
+ this.ceilScale.Name = "ceilScale";
+ this.ceilScale.Size = new System.Drawing.Size(186, 26);
+ this.ceilScale.TabIndex = 3;
+ this.ceilScale.OnValuesChanged += new System.EventHandler(this.ceilScale_OnValuesChanged);
+ //
+ // ceilOffsets
+ //
+ this.ceilOffsets.AllowDecimal = true;
+ this.ceilOffsets.AllowValueLinking = false;
+ this.ceilOffsets.ButtonStep = 1;
+ this.ceilOffsets.ButtonStepBig = 32F;
+ this.ceilOffsets.ButtonStepFloat = 16F;
+ this.ceilOffsets.ButtonStepSmall = 1F;
+ this.ceilOffsets.ButtonStepsUseModifierKeys = true;
+ this.ceilOffsets.DefaultValue = 0F;
+ this.ceilOffsets.Field1 = "xpanningceiling";
+ this.ceilOffsets.Field2 = "ypanningceiling";
+ this.ceilOffsets.LinkValues = false;
+ this.ceilOffsets.Location = new System.Drawing.Point(110, 21);
+ this.ceilOffsets.Name = "ceilOffsets";
+ this.ceilOffsets.Size = new System.Drawing.Size(186, 26);
+ this.ceilOffsets.TabIndex = 1;
+ this.ceilOffsets.OnValuesChanged += new System.EventHandler(this.ceilOffsets_OnValuesChanged);
+ //
+ // ceilingtex
+ //
+ this.ceilingtex.Location = new System.Drawing.Point(356, 21);
+ this.ceilingtex.MultipleTextures = false;
+ this.ceilingtex.Name = "ceilingtex";
+ this.ceilingtex.Size = new System.Drawing.Size(176, 200);
+ this.ceilingtex.TabIndex = 25;
+ this.ceilingtex.TextureName = "";
+ this.ceilingtex.OnValueChanged += new System.EventHandler(this.ceilingtex_OnValueChanged);
+ //
+ // tabslopes
+ //
+ this.tabslopes.Controls.Add(this.groupBox5);
+ this.tabslopes.Controls.Add(this.groupBox4);
+ this.tabslopes.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.tabslopes.Location = new System.Drawing.Point(4, 22);
+ this.tabslopes.Name = "tabslopes";
+ this.tabslopes.Size = new System.Drawing.Size(570, 526);
+ this.tabslopes.TabIndex = 3;
+ this.tabslopes.Text = "Slopes";
+ this.tabslopes.UseVisualStyleBackColor = true;
+ //
+ // groupBox5
+ //
+ this.groupBox5.Controls.Add(this.floorslopecontrol);
+ this.groupBox5.Location = new System.Drawing.Point(3, 261);
+ this.groupBox5.Name = "groupBox5";
+ this.groupBox5.Size = new System.Drawing.Size(298, 266);
+ this.groupBox5.TabIndex = 1;
+ this.groupBox5.TabStop = false;
+ this.groupBox5.Text = " Floor slope ";
+ //
+ // floorslopecontrol
+ //
+ this.floorslopecontrol.Location = new System.Drawing.Point(4, 19);
+ this.floorslopecontrol.Name = "floorslopecontrol";
+ this.floorslopecontrol.Size = new System.Drawing.Size(290, 178);
+ this.floorslopecontrol.TabIndex = 0;
+ this.floorslopecontrol.UseLineAngles = false;
+ this.floorslopecontrol.OnAnglesChanged += new System.EventHandler(this.floorslopecontrol_OnAnglesChanged);
+ this.floorslopecontrol.OnUseLineAnglesChanged += new System.EventHandler(this.floorslopecontrol_OnUseLineAnglesChanged);
+ this.floorslopecontrol.OnPivotModeChanged += new System.EventHandler(this.floorslopecontrol_OnPivotModeChanged);
+ this.floorslopecontrol.OnResetClicked += new System.EventHandler(this.floorslopecontrol_OnResetClicked);
+ //
+ // groupBox4
+ //
+ this.groupBox4.Controls.Add(this.ceilingslopecontrol);
+ this.groupBox4.Location = new System.Drawing.Point(3, 3);
+ this.groupBox4.Name = "groupBox4";
+ this.groupBox4.Size = new System.Drawing.Size(298, 252);
+ this.groupBox4.TabIndex = 0;
+ this.groupBox4.TabStop = false;
+ this.groupBox4.Text = " Ceiling slope ";
+ //
+ // ceilingslopecontrol
+ //
+ this.ceilingslopecontrol.Location = new System.Drawing.Point(4, 19);
+ this.ceilingslopecontrol.Name = "ceilingslopecontrol";
+ this.ceilingslopecontrol.Size = new System.Drawing.Size(290, 178);
+ this.ceilingslopecontrol.TabIndex = 1;
+ this.ceilingslopecontrol.UseLineAngles = false;
+ this.ceilingslopecontrol.OnAnglesChanged += new System.EventHandler(this.ceilingslopecontrol_OnAnglesChanged);
+ this.ceilingslopecontrol.OnUseLineAnglesChanged += new System.EventHandler(this.ceilingslopecontrol_OnUseLineAnglesChanged);
+ this.ceilingslopecontrol.OnPivotModeChanged += new System.EventHandler(this.ceilingslopecontrol_OnPivotModeChanged);
+ this.ceilingslopecontrol.OnResetClicked += new System.EventHandler(this.ceilingslopecontrol_OnResetClicked);
+ //
+ // tabcomment
+ //
+ this.tabcomment.Controls.Add(this.commenteditor);
+ this.tabcomment.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
+ this.tabcomment.Location = new System.Drawing.Point(4, 22);
+ this.tabcomment.Name = "tabcomment";
+ this.tabcomment.Size = new System.Drawing.Size(570, 526);
+ this.tabcomment.TabIndex = 4;
+ this.tabcomment.Text = "Comment";
+ this.tabcomment.UseVisualStyleBackColor = true;
+ //
+ // commenteditor
+ //
+ this.commenteditor.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.commenteditor.Location = new System.Drawing.Point(0, 0);
+ this.commenteditor.Name = "commenteditor";
+ this.commenteditor.Size = new System.Drawing.Size(570, 526);
+ this.commenteditor.TabIndex = 0;
+ //
+ // tabcustom
+ //
+ this.tabcustom.Controls.Add(this.fieldslist);
+ this.tabcustom.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.tabcustom.Location = new System.Drawing.Point(4, 22);
+ this.tabcustom.Name = "tabcustom";
+ this.tabcustom.Padding = new System.Windows.Forms.Padding(3);
+ this.tabcustom.Size = new System.Drawing.Size(570, 526);
+ this.tabcustom.TabIndex = 1;
+ this.tabcustom.Text = "Custom";
+ this.tabcustom.UseVisualStyleBackColor = true;
+ this.tabcustom.MouseEnter += new System.EventHandler(this.tabcustom_MouseEnter);
+ //
+ // fieldslist
+ //
+ this.fieldslist.AllowInsert = true;
+ this.fieldslist.AutoInsertUserPrefix = true;
+ this.fieldslist.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+ this.fieldslist.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.fieldslist.Location = new System.Drawing.Point(3, 3);
+ this.fieldslist.Margin = new System.Windows.Forms.Padding(8);
+ this.fieldslist.Name = "fieldslist";
+ this.fieldslist.PropertyColumnVisible = true;
+ this.fieldslist.PropertyColumnWidth = 150;
+ this.fieldslist.ShowFixedFields = true;
+ this.fieldslist.Size = new System.Drawing.Size(564, 520);
+ this.fieldslist.TabIndex = 1;
+ this.fieldslist.TypeColumnVisible = true;
+ this.fieldslist.TypeColumnWidth = 100;
+ this.fieldslist.ValueColumnVisible = true;
+ //
+ // cancel
+ //
+ this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.cancel.Location = new System.Drawing.Point(474, 566);
+ this.cancel.Name = "cancel";
+ this.cancel.Size = new System.Drawing.Size(112, 25);
+ this.cancel.TabIndex = 4;
+ this.cancel.Text = "Cancel";
+ this.cancel.UseVisualStyleBackColor = true;
+ this.cancel.Click += new System.EventHandler(this.cancel_Click);
+ //
+ // apply
+ //
+ this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.apply.Location = new System.Drawing.Point(356, 566);
+ this.apply.Name = "apply";
+ this.apply.Size = new System.Drawing.Size(112, 25);
+ this.apply.TabIndex = 3;
+ this.apply.Text = "OK";
+ this.apply.UseVisualStyleBackColor = true;
+ this.apply.Click += new System.EventHandler(this.apply_Click);
+ //
+ // tooltip
+ //
+ this.tooltip.AutomaticDelay = 10;
+ this.tooltip.AutoPopDelay = 10000;
+ this.tooltip.InitialDelay = 10;
+ this.tooltip.ReshowDelay = 100;
+ //
+ // SectorEditFormSRB2
+ //
+ this.AcceptButton = this.apply;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
+ this.CancelButton = this.cancel;
+ this.ClientSize = new System.Drawing.Size(598, 592);
+ this.Controls.Add(this.cancel);
+ this.Controls.Add(this.apply);
+ this.Controls.Add(this.tabs);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "SectorEditFormSRB2";
+ this.Opacity = 0D;
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Edit Sector";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SectorEditFormUDMF_FormClosing);
+ this.HelpRequested += new System.Windows.Forms.HelpEventHandler(this.SectorEditFormUDMF_HelpRequested);
+ groupaction.ResumeLayout(false);
+ groupeffect.ResumeLayout(false);
+ groupeffect.PerformLayout();
+ groupfloorceiling.ResumeLayout(false);
+ groupfloorceiling.PerformLayout();
+ this.tabs.ResumeLayout(false);
+ this.tabproperties.ResumeLayout(false);
+ this.groupBox3.ResumeLayout(false);
+ this.tabColors.ResumeLayout(false);
+ this.groupBox8.ResumeLayout(false);
+ this.tabSurfaces.ResumeLayout(false);
+ this.groupBox2.ResumeLayout(false);
+ this.groupBox2.PerformLayout();
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
+ this.tabslopes.ResumeLayout(false);
+ this.groupBox5.ResumeLayout(false);
+ this.groupBox4.ResumeLayout(false);
+ this.tabcomment.ResumeLayout(false);
+ this.tabcustom.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TabControl tabs;
+ private System.Windows.Forms.TabPage tabproperties;
+ private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox brightness;
+ private System.Windows.Forms.Button browseeffect;
+ private CodeImp.DoomBuilder.Controls.ActionSelectorControl effect;
+ private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox ceilingheight;
+ private System.Windows.Forms.Label sectorheightlabel;
+ private System.Windows.Forms.Label sectorheight;
+ private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox floorheight;
+ private System.Windows.Forms.TabPage tabcustom;
+ private CodeImp.DoomBuilder.Controls.FieldsEditorControl fieldslist;
+ private System.Windows.Forms.Button cancel;
+ private System.Windows.Forms.Button apply;
+ private System.Windows.Forms.TabPage tabSurfaces;
+ private System.Windows.Forms.GroupBox groupBox1;
+ private CodeImp.DoomBuilder.Controls.PairedFieldsControl ceilOffsets;
+ private CodeImp.DoomBuilder.Controls.FlatSelectorControl ceilingtex;
+ private CodeImp.DoomBuilder.Controls.PairedFieldsControl ceilScale;
+ private System.Windows.Forms.Label label1;
+ private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox ceilRotation;
+ private System.Windows.Forms.CheckBox ceilLightAbsolute;
+ private System.Windows.Forms.Label labelLightFront;
+ private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox ceilBrightness;
+ private System.Windows.Forms.GroupBox groupBox2;
+ private System.Windows.Forms.Label label11;
+ private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox floorRotation;
+ private System.Windows.Forms.CheckBox floorLightAbsolute;
+ private System.Windows.Forms.Label label12;
+ private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox floorBrightness;
+ private CodeImp.DoomBuilder.Controls.PairedFieldsControl floorScale;
+ private CodeImp.DoomBuilder.Controls.PairedFieldsControl floorOffsets;
+ private CodeImp.DoomBuilder.Controls.FlatSelectorControl floortex;
+ private CodeImp.DoomBuilder.Controls.AngleControlEx floorAngleControl;
+ private CodeImp.DoomBuilder.Controls.AngleControlEx ceilAngleControl;
+ private System.Windows.Forms.GroupBox groupBox3;
+ private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox gravity;
+ private CodeImp.DoomBuilder.Controls.CheckboxArrayControl flags;
+ private System.Windows.Forms.CheckBox cbUseFloorLineAngles;
+ private System.Windows.Forms.CheckBox cbUseCeilLineAngles;
+ private System.Windows.Forms.TabPage tabslopes;
+ private System.Windows.Forms.GroupBox groupBox5;
+ private System.Windows.Forms.GroupBox groupBox4;
+ private CodeImp.DoomBuilder.Controls.SectorSlopeControl floorslopecontrol;
+ private CodeImp.DoomBuilder.Controls.SectorSlopeControl ceilingslopecontrol;
+ private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox heightoffset;
+ private System.Windows.Forms.ToolTip tooltip;
+ private System.Windows.Forms.Label labelFloorOffsets;
+ private System.Windows.Forms.Label labelFloorScale;
+ private System.Windows.Forms.Label labelCeilOffsets;
+ private System.Windows.Forms.Label labelCeilScale;
+ private System.Windows.Forms.TabPage tabcomment;
+ private CodeImp.DoomBuilder.Controls.CommentEditor commenteditor;
+ private CodeImp.DoomBuilder.Controls.TagsSelector tagsselector;
+ private System.Windows.Forms.Button resetfloorlight;
+ private System.Windows.Forms.Button resetceillight;
+ private System.Windows.Forms.Button resetdamagetype;
+ private System.Windows.Forms.ComboBox damagetype;
+ private System.Windows.Forms.TabPage tabColors;
+ private Controls.ColorFieldsControl fadeColor;
+ private Controls.ColorFieldsControl lightColor;
+ private System.Windows.Forms.GroupBox groupBox8;
+ }
+}
\ No newline at end of file
diff --git a/Source/Core/Windows/SectorEditFormSRB2.cs b/Source/Core/Windows/SectorEditFormSRB2.cs
new file mode 100644
index 00000000..ad796fe6
--- /dev/null
+++ b/Source/Core/Windows/SectorEditFormSRB2.cs
@@ -0,0 +1,1568 @@
+#region ================== Namespaces
+
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using CodeImp.DoomBuilder.Controls;
+using CodeImp.DoomBuilder.Geometry;
+using CodeImp.DoomBuilder.Map;
+using CodeImp.DoomBuilder.Rendering;
+using CodeImp.DoomBuilder.Types;
+
+#endregion
+
+namespace CodeImp.DoomBuilder.Windows
+{
+ internal partial class SectorEditFormSRB2 : DelayedForm, ISectorEditForm
+ {
+ #region ================== Events
+
+ public event EventHandler OnValuesChanged; //mxd
+
+ #endregion
+
+ #region ================== Constants
+
+ private const string NO_DAMAGETYPE = "None"; //mxd
+
+ #endregion
+
+ #region ================== Variables
+
+ private ICollection sectors;
+ private Dictionary sectorprops; //mxd
+ private bool preventchanges; //mxd
+ private bool undocreated; //mxd
+ private StepsList anglesteps; //mxd
+
+ //mxd. Slope pivots
+ private Vector2D globalslopepivot;
+ private Dictionary slopepivots;
+
+ private bool oldmapischanged;
+
+ #endregion
+
+ #region ================== Structs
+
+ private struct SectorProperties //mxd
+ {
+ public readonly int Brightness;
+ public readonly int FloorHeight;
+ public readonly int CeilHeight;
+ public readonly string FloorTexture;
+ public readonly string CeilTexture;
+
+ //UDMF stuff
+ public readonly int LightColor;
+ public readonly int FadeColor;
+
+ //UDMF Ceiling
+ public readonly double CeilOffsetX;
+ public readonly double CeilOffsetY;
+ public readonly double CeilScaleX;
+ public readonly double CeilScaleY;
+ //public float CeilAlpha;
+ public readonly double CeilRotation;
+ public readonly int CeilBrightness;
+ public readonly bool CeilLightAbsoulte;
+
+ //UDMF Floor
+ public readonly double FloorOffsetX;
+ public readonly double FloorOffsetY;
+ public readonly double FloorScaleX;
+ public readonly double FloorScaleY;
+ //public float FloorAlpha;
+ public readonly double FloorRotation;
+ public readonly int FloorBrightness;
+ public readonly bool FloorLightAbsoulte;
+
+ //UDMF slopes. Angles are in degrees
+ public readonly Vector3D FloorSlope;
+ public readonly Vector3D CeilSlope;
+ public readonly double FloorSlopeAngleXY;
+ public readonly double FloorSlopeAngleZ;
+ public readonly double FloorSlopeOffset;
+ public readonly double CeilSlopeAngleXY;
+ public readonly double CeilSlopeAngleZ;
+ public readonly double CeilSlopeOffset;
+
+ public SectorProperties(Sector s)
+ {
+ Brightness = s.Brightness;
+ FloorHeight = s.FloorHeight;
+ CeilHeight = s.CeilHeight;
+ FloorTexture = s.FloorTexture;
+ CeilTexture = s.CeilTexture;
+
+ //UDMF stuff
+ LightColor = UniFields.GetInteger(s.Fields, "lightcolor", PixelColor.INT_WHITE_NO_ALPHA);
+ FadeColor = UniFields.GetInteger(s.Fields, "fadecolor", 0);
+
+ //UDMF Ceiling
+ CeilOffsetX = UniFields.GetFloat(s.Fields, "xpanningceiling", 0.0);
+ CeilOffsetY = UniFields.GetFloat(s.Fields, "ypanningceiling", 0.0);
+ CeilScaleX = UniFields.GetFloat(s.Fields, "xscaleceiling", 1.0);
+ CeilScaleY = UniFields.GetFloat(s.Fields, "yscaleceiling", 1.0);
+ //CeilAlpha = UniFields.GetFloat(s.Fields, "alphaceiling", 1.0f);
+ CeilRotation = s.Fields.GetValue("rotationceiling", 0.0);
+ CeilBrightness = s.Fields.GetValue("lightceiling", 0);
+ CeilLightAbsoulte = s.Fields.GetValue("lightceilingabsolute", false);
+
+ //UDMF Floor
+ FloorOffsetX = UniFields.GetFloat(s.Fields, "xpanningfloor", 0.0);
+ FloorOffsetY = UniFields.GetFloat(s.Fields, "ypanningfloor", 0.0);
+ FloorScaleX = UniFields.GetFloat(s.Fields, "xscalefloor", 1.0);
+ FloorScaleY = UniFields.GetFloat(s.Fields, "yscalefloor", 1.0);
+ //FloorAlpha = UniFields.GetFloat(s.Fields, "alphafloor", 1.0f);
+ FloorRotation = s.Fields.GetValue("rotationfloor", 0.0);
+ FloorBrightness = s.Fields.GetValue("lightfloor", 0);
+ FloorLightAbsoulte = s.Fields.GetValue("lightfloorabsolute", false);
+
+ //UDMF slopes
+ if(s.FloorSlope.GetLengthSq() > 0)
+ {
+ FloorSlopeAngleXY = General.ClampAngle(Math.Round(Angle2D.RadToDeg(s.FloorSlope.GetAngleXY()) - 180, 1));
+ FloorSlopeAngleZ = -Math.Round(Angle2D.RadToDeg(s.FloorSlope.GetAngleZ()) - 90, 1);
+ FloorSlopeOffset = (double.IsNaN(s.FloorSlopeOffset) ? s.FloorHeight : s.FloorSlopeOffset);
+ }
+ else
+ {
+ FloorSlopeAngleXY = 0;
+ FloorSlopeAngleZ = 0;
+ FloorSlopeOffset = -s.FloorHeight;
+ }
+ FloorSlope = s.FloorSlope;
+
+ if(s.CeilSlope.GetLengthSq() > 0)
+ {
+ CeilSlopeAngleXY = General.ClampAngle(Math.Round(Angle2D.RadToDeg(s.CeilSlope.GetAngleXY()) - 180, 1));
+ CeilSlopeAngleZ = -Math.Round(270 - Angle2D.RadToDeg(s.CeilSlope.GetAngleZ()), 1);
+ CeilSlopeOffset = (double.IsNaN(s.CeilSlopeOffset) ? s.CeilHeight : s.CeilSlopeOffset);
+ }
+ else
+ {
+ CeilSlopeAngleXY = 0;
+ CeilSlopeAngleZ = 0;
+ CeilSlopeOffset = s.CeilHeight;
+ }
+
+ CeilSlope = s.CeilSlope;
+ }
+ }
+
+ #endregion
+
+ #region ================== Constructor
+
+ public SectorEditFormSRB2()
+ {
+ InitializeComponent();
+
+ //mxd. Load settings
+ if(General.Settings.StoreSelectedEditTab)
+ {
+ int activetab = General.Settings.ReadSetting("windows." + configname + ".activetab", 0);
+ tabs.SelectTab(activetab);
+ }
+
+ // Fill flags list
+ foreach(KeyValuePair lf in General.Map.Config.SectorFlags)
+ flags.Add(lf.Value, lf.Key);
+ flags.Enabled = General.Map.Config.SectorFlags.Count > 0;
+
+ // Fill effects list
+ effect.GeneralizedOptions = General.Map.Config.GenEffectOptions; //mxd
+ effect.AddInfo(General.Map.Config.SortedSectorEffects.ToArray());
+
+ // Fill damagetype list
+ damagetype.Items.Add(NO_DAMAGETYPE);
+ damagetype.Items.AddRange(General.Map.Data.DamageTypes);
+
+ // Initialize custom fields editor
+ fieldslist.Setup("sector");
+
+ // Fill universal fields list
+ fieldslist.ListFixedFields(General.Map.Config.SectorFields);
+
+ // Initialize image selectors
+ floortex.Initialize();
+ ceilingtex.Initialize();
+
+ // Set steps for brightness field
+ brightness.StepValues = General.Map.Config.BrightnessLevels;
+
+ // Apply settings
+ ceilScale.LinkValues = General.Settings.ReadSetting("windows." + configname + ".linkceilingscale", false);
+ floorScale.LinkValues = General.Settings.ReadSetting("windows." + configname + ".linkfloorscale", false);
+
+ cbUseCeilLineAngles.Checked = General.Settings.ReadSetting("windows." + configname + ".useceillineangles", false);
+ cbUseFloorLineAngles.Checked = General.Settings.ReadSetting("windows." + configname + ".usefloorlineangles", false);
+
+ ceilingslopecontrol.UseLineAngles = General.Settings.ReadSetting("windows." + configname + ".useceilslopelineangles", false);
+ floorslopecontrol.UseLineAngles = General.Settings.ReadSetting("windows." + configname + ".usefloorslopelineangles", false);
+
+ ceilingslopecontrol.PivotMode = (SlopePivotMode)General.Settings.ReadSetting("windows." + configname + ".ceilpivotmode", (int)SlopePivotMode.LOCAL);
+ floorslopecontrol.PivotMode = (SlopePivotMode)General.Settings.ReadSetting("windows." + configname + ".floorpivotmode", (int)SlopePivotMode.LOCAL);
+
+ // Diable brightness controls?
+ if(!General.Map.Config.DistinctFloorAndCeilingBrightness)
+ {
+ ceilBrightness.Enabled = false;
+ ceilLightAbsolute.Enabled = false;
+ resetceillight.Enabled = false;
+
+ floorBrightness.Enabled = false;
+ floorLightAbsolute.Enabled = false;
+ resetfloorlight.Enabled = false;
+ }
+ }
+
+ #endregion
+
+ #region ================== Methods
+
+ // This sets up the form to edit the given sectors
+ public void Setup(ICollection sectors)
+ {
+ preventchanges = true; //mxd
+ oldmapischanged = General.Map.IsChanged;
+ undocreated = false;
+ // Keep this list
+ this.sectors = sectors;
+ if(sectors.Count > 1) this.Text = "Edit Sectors (" + sectors.Count + ")";
+ sectorprops = new Dictionary(sectors.Count); //mxd
+
+ //mxd. Set default height offset
+ heightoffset.Text = "0";
+
+ CreateHelperProps(sectors); //mxd
+
+ ////////////////////////////////////////////////////////////////////////
+ // Set all options to the first sector properties
+ ////////////////////////////////////////////////////////////////////////
+
+ // Get first sector
+ Sector sc = General.GetByIndex(sectors, 0);
+
+ // Flags
+ foreach(CheckBox c in flags.Checkboxes)
+ if(sc.Flags.ContainsKey(c.Tag.ToString())) c.Checked = sc.Flags[c.Tag.ToString()];
+
+ // Effects
+ effect.Value = sc.Effect;
+ brightness.Text = sc.Brightness.ToString();
+
+ // Floor/ceiling
+ floorheight.Text = sc.FloorHeight.ToString();
+ ceilingheight.Text = sc.CeilHeight.ToString();
+ floortex.TextureName = sc.FloorTexture;
+ ceilingtex.TextureName = sc.CeilTexture;
+
+ // UDMF stuff
+ // Texture offsets
+ ceilOffsets.SetValuesFrom(sc.Fields, true);
+ floorOffsets.SetValuesFrom(sc.Fields, true);
+
+ // Texture scale
+ ceilScale.SetValuesFrom(sc.Fields, true);
+ floorScale.SetValuesFrom(sc.Fields, true);
+
+ // Texture rotation
+ double ceilAngle = sc.Fields.GetValue("rotationceiling", 0.0);
+ double floorAngle = sc.Fields.GetValue("rotationfloor", 0.0);
+
+ ceilRotation.Text = ceilAngle.ToString();
+ floorRotation.Text = floorAngle.ToString();
+
+ ceilAngleControl.Angle = General.ClampAngle(360 - (int)ceilAngle);
+ floorAngleControl.Angle = General.ClampAngle(360 - (int)floorAngle);
+
+ // Texture brightness
+ ceilBrightness.Text = sc.Fields.GetValue("lightceiling", 0).ToString();
+ floorBrightness.Text = sc.Fields.GetValue("lightfloor", 0).ToString();
+ ceilLightAbsolute.Checked = sc.Fields.GetValue("lightceilingabsolute", false);
+ floorLightAbsolute.Checked = sc.Fields.GetValue("lightfloorabsolute", false);
+
+ // Damage
+ damagetype.Text = sc.Fields.GetValue("damagetype", NO_DAMAGETYPE);
+
+ // Misc
+ gravity.Text = sc.Fields.GetValue("gravity", 1.0).ToString();
+
+ // Sector colors
+ fadeColor.SetValueFrom(sc.Fields, true);
+ lightColor.SetValueFrom(sc.Fields, true);
+
+ // Slopes
+ SetupFloorSlope(sc, true);
+ SetupCeilingSlope(sc, true);
+
+ // Custom fields
+ fieldslist.SetValues(sc.Fields, true);
+
+ // Comments
+ commenteditor.SetValues(sc.Fields, true);
+
+ anglesteps = new StepsList();
+
+ ////////////////////////////////////////////////////////////////////////
+ // Now go for all sectors and change the options when a setting is different
+ ////////////////////////////////////////////////////////////////////////
+
+ // Go for all sectors
+ foreach(Sector s in sectors)
+ {
+ // Flags
+ SetupFlags(flags, s);
+
+ // Effects
+ if(s.Effect != effect.Value) effect.Empty = true;
+ if(s.Brightness.ToString() != brightness.Text) brightness.Text = "";
+
+ // Floor/Ceiling
+ if(s.FloorHeight.ToString() != floorheight.Text) floorheight.Text = "";
+ if(s.CeilHeight.ToString() != ceilingheight.Text) ceilingheight.Text = "";
+ if(s.FloorTexture != floortex.TextureName)
+ {
+ floortex.MultipleTextures = true; //mxd
+ floortex.TextureName = "";
+ }
+ if(s.CeilTexture != ceilingtex.TextureName)
+ {
+ ceilingtex.MultipleTextures = true; //mxd
+ ceilingtex.TextureName = "";
+ }
+
+ // UDMF stuff
+ // Texture offsets
+ ceilOffsets.SetValuesFrom(s.Fields, false);
+ floorOffsets.SetValuesFrom(s.Fields, false);
+
+ // Texture scale
+ ceilScale.SetValuesFrom(s.Fields, false);
+ floorScale.SetValuesFrom(s.Fields, false);
+
+ // Texture rotation
+ if(s.Fields.GetValue("rotationceiling", 0.0).ToString() != ceilRotation.Text)
+ {
+ ceilRotation.Text = "";
+ ceilAngleControl.Angle = AngleControlEx.NO_ANGLE;
+ }
+ if(s.Fields.GetValue("rotationfloor", 0.0).ToString() != floorRotation.Text)
+ {
+ floorRotation.Text = "";
+ floorAngleControl.Angle = AngleControlEx.NO_ANGLE;
+ }
+
+ // Texture brightness
+ if(s.Fields.GetValue("lightceiling", 0).ToString() != ceilBrightness.Text) ceilBrightness.Text = "";
+ if(s.Fields.GetValue("lightfloor", 0).ToString() != floorBrightness.Text) floorBrightness.Text = "";
+
+ if(s.Fields.GetValue("lightceilingabsolute", false) != ceilLightAbsolute.Checked)
+ {
+ ceilLightAbsolute.ThreeState = true;
+ ceilLightAbsolute.CheckState = CheckState.Indeterminate;
+ }
+ if(s.Fields.GetValue("lightfloorabsolute", false) != floorLightAbsolute.Checked)
+ {
+ floorLightAbsolute.ThreeState = true;
+ floorLightAbsolute.CheckState = CheckState.Indeterminate;
+ }
+
+ // Damage
+ if(damagetype.SelectedIndex > -1 && s.Fields.GetValue("damagetype", NO_DAMAGETYPE) != damagetype.Text)
+ damagetype.SelectedIndex = -1;
+
+ // Misc
+ if(s.Fields.GetValue("gravity", 1.0).ToString() != gravity.Text) gravity.Text = "";
+
+ // Sector colors
+ fadeColor.SetValueFrom(s.Fields, false);
+ lightColor.SetValueFrom(s.Fields, false);
+
+ // Slopes
+ SetupFloorSlope(s, false);
+ SetupCeilingSlope(s, false);
+
+ // Custom fields
+ fieldslist.SetValues(s.Fields, false);
+
+ //mxd. Comments
+ commenteditor.SetValues(s.Fields, false);
+
+ //mxd. Angle steps
+ foreach(Sidedef side in s.Sidedefs)
+ {
+ int angle;
+ if(side.Line.Front != null && side.Index == side.Line.Front.Index)
+ angle = General.ClampAngle(270 - side.Line.AngleDeg);
+ else
+ angle = General.ClampAngle(90 - side.Line.AngleDeg);
+
+ if(!anglesteps.Contains(angle)) anglesteps.Add(angle);
+ }
+ }
+
+ //mxd. Setup tags
+ tagsselector.SetValues(sectors);
+
+ //mxd. Update slope controls
+ ceilingslopecontrol.UpdateControls();
+ floorslopecontrol.UpdateControls();
+
+ // Show sector height
+ UpdateSectorHeight();
+
+ //mxd. Update brightness reset buttons
+ resetceillight.Visible = (ceilLightAbsolute.CheckState != CheckState.Unchecked || ceilBrightness.GetResult(0) != 0);
+ resetfloorlight.Visible = (floorLightAbsolute.CheckState != CheckState.Unchecked || floorBrightness.GetResult(0) != 0);
+
+ //mxd. Angle steps
+ anglesteps.Sort();
+ if(cbUseCeilLineAngles.Checked) ceilRotation.StepValues = anglesteps;
+ if(cbUseFloorLineAngles.Checked) floorRotation.StepValues = anglesteps;
+ if(ceilingslopecontrol.UseLineAngles) ceilingslopecontrol.StepValues = anglesteps;
+ if(floorslopecontrol.UseLineAngles) floorslopecontrol.StepValues = anglesteps;
+
+ //mxd. Comments
+ commenteditor.FinishSetup();
+
+ preventchanges = false; //mxd
+ }
+
+ //mxd
+ private static void SetupFlags(CheckboxArrayControl control, Sector s)
+ {
+ foreach(CheckBox c in control.Checkboxes)
+ {
+ if(c.CheckState == CheckState.Indeterminate) continue; //mxd
+ if(s.IsFlagSet(c.Tag.ToString()) != c.Checked)
+ {
+ c.ThreeState = true;
+ c.CheckState = CheckState.Indeterminate;
+ }
+ }
+ }
+
+ //mxd
+ private static void ApplyFlags(CheckboxArrayControl control, Sector s)
+ {
+ foreach(CheckBox c in control.Checkboxes)
+ {
+ switch(c.CheckState)
+ {
+ case CheckState.Checked: s.SetFlag(c.Tag.ToString(), true); break;
+ case CheckState.Unchecked: s.SetFlag(c.Tag.ToString(), false); break;
+ }
+ }
+ }
+
+ //mxd
+ private void MakeUndo()
+ {
+ if(undocreated) return;
+ undocreated = true;
+
+ //mxd. Make undo
+ General.Map.UndoRedo.CreateUndo("Edit " + (sectors.Count > 1 ? sectors.Count + " sectors" : "sector"));
+ foreach(Sector s in sectors) s.Fields.BeforeFieldsChange();
+ }
+
+ // mxd
+ private void CreateHelperProps(ICollection sectors)
+ {
+ slopepivots = new Dictionary(sectors.Count);
+
+ foreach(Sector s in sectors)
+ {
+ if(slopepivots.ContainsKey(s)) continue;
+ Vector2D pivot = new Vector2D(s.BBox.X + s.BBox.Width / 2, s.BBox.Y + s.BBox.Height / 2);
+ globalslopepivot += pivot;
+ slopepivots.Add(s, pivot);
+
+ // Store initial properties
+ sectorprops.Add(s, new SectorProperties(s));
+ }
+
+ globalslopepivot /= sectors.Count;
+ }
+
+ // This updates the sector height field
+ private void UpdateSectorHeight()
+ {
+ int delta = int.MinValue;
+
+ // Check all selected sectors
+ foreach(Sector s in sectors)
+ {
+ if(delta == int.MinValue)
+ {
+ // First sector in list
+ delta = s.CeilHeight - s.FloorHeight;
+ }
+ else if(delta != (s.CeilHeight - s.FloorHeight))
+ {
+ // We can't show heights because the delta
+ // heights for the sectors is different
+ delta = int.MinValue;
+ break;
+ }
+ }
+
+ if(delta != int.MinValue)
+ {
+ sectorheight.Text = delta.ToString();
+ sectorheight.Visible = true;
+ sectorheightlabel.Visible = true;
+ }
+ else
+ {
+ sectorheight.Visible = false;
+ sectorheightlabel.Visible = false;
+ }
+ }
+
+ //mxd
+ private void UpdateCeilingHeight()
+ {
+ int offset;
+
+ if(heightoffset.Text == "++" || heightoffset.Text == "--") // Raise or lower by sector height
+ {
+ int sign = (heightoffset.Text == "++" ? 1 : -1);
+ foreach(Sector s in sectors)
+ {
+ offset = sectorprops[s].CeilHeight - sectorprops[s].FloorHeight;
+ s.CeilHeight += offset * sign;
+ }
+ }
+ else
+ {
+ //restore values
+ if(string.IsNullOrEmpty(ceilingheight.Text))
+ {
+ // Reset increment steps, otherwise it's just keep counting and counting
+ heightoffset.ResetIncrementStep();
+
+ foreach (Sector s in sectors)
+ {
+ // To get the steps for ---/+++ into effect the offset has to be retrieved again for each sector
+ offset = heightoffset.GetResult(0);
+ s.CeilHeight = sectorprops[s].CeilHeight + offset;
+ }
+ }
+ else //update values
+ {
+ // Reset increment steps, otherwise it's just keep counting and counting
+ heightoffset.ResetIncrementStep();
+
+ foreach (Sector s in sectors)
+ {
+ // To get the steps for ---/+++ into effect the offset has to be retrieved again for each sector
+ offset = heightoffset.GetResult(0);
+ s.CeilHeight = ceilingheight.GetResult(sectorprops[s].CeilHeight) + offset;
+ }
+ }
+ }
+ }
+
+ //mxd
+ private void UpdateFloorHeight()
+ {
+ int offset;
+
+ if(heightoffset.Text == "++" || heightoffset.Text == "--")
+ {
+ // Raise or lower by sector height
+ int sign = (heightoffset.Text == "++" ? 1 : -1);
+ foreach(Sector s in sectors)
+ {
+ offset = sectorprops[s].CeilHeight - sectorprops[s].FloorHeight;
+ s.FloorHeight += offset * sign;
+ }
+ }
+ else
+ {
+ // Reset increment steps, otherwise it's just keep counting and counting
+ heightoffset.ResetIncrementStep();
+
+ //restore values
+ if(string.IsNullOrEmpty(floorheight.Text))
+ {
+ foreach(Sector s in sectors)
+ {
+ // To get the steps for ---/+++ into effect the offset has to be retrieved again for each sector
+ offset = heightoffset.GetResult(0);
+ s.FloorHeight = sectorprops[s].FloorHeight + offset;
+ }
+ }
+ else //update values
+ {
+ foreach(Sector s in sectors)
+ {
+ // To get the steps for ---/+++ into effect the offset has to be retrieved again for each sector
+ offset = heightoffset.GetResult(0);
+ s.FloorHeight = floorheight.GetResult(sectorprops[s].FloorHeight) + offset;
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region ================== Events
+
+ private void apply_Click(object sender, EventArgs e)
+ {
+ // Verify the effect
+ if((effect.Value < General.Map.FormatInterface.MinEffect) || (effect.Value > General.Map.FormatInterface.MaxEffect))
+ {
+ General.ShowWarningMessage("Sector effect must be between " + General.Map.FormatInterface.MinEffect + " and " + General.Map.FormatInterface.MaxEffect + ".", MessageBoxButtons.OK);
+ return;
+ }
+
+ MakeUndo(); //mxd
+
+ // Go for all sectors
+ foreach(Sector s in sectors)
+ {
+ // Apply all flags
+ ApplyFlags(flags, s);
+
+ // Effects
+ if(!effect.Empty) s.Effect = effect.Value;
+
+ // Fields
+ fieldslist.Apply(s.Fields);
+
+ //mxd. Comments
+ commenteditor.Apply(s.Fields);
+
+ //Damage
+ if(!string.IsNullOrEmpty(damagetype.Text))
+ UniFields.SetString(s.Fields, "damagetype", damagetype.Text, NO_DAMAGETYPE);
+
+ // Misc
+ if(!string.IsNullOrEmpty(gravity.Text))
+ UniFields.SetFloat(s.Fields, "gravity", gravity.GetResultFloat(s.Fields.GetValue("gravity", 1.0)), 1.0);
+
+ // Clear horizontal slopes
+ double diff = Math.Abs(Math.Round(s.FloorSlopeOffset) - s.FloorSlopeOffset);
+ if (Math.Abs(s.FloorSlope.z) == 1.0 && diff < 0.000000001)
+ {
+ s.FloorHeight = -Convert.ToInt32(s.FloorSlopeOffset);
+ s.FloorSlope = new Vector3D();
+ s.FloorSlopeOffset = double.NaN;
+ }
+
+ diff = Math.Abs(Math.Round(s.CeilSlopeOffset) - s.CeilSlopeOffset);
+ if (Math.Abs(s.CeilSlope.z) == 1.0 && diff < 0.000000001)
+ {
+ s.CeilHeight = Convert.ToInt32(s.CeilSlopeOffset);
+ s.CeilSlope = new Vector3D();
+ s.CeilSlopeOffset = double.NaN;
+ }
+ }
+
+ //mxd. Apply tags
+ tagsselector.ApplyTo(sectors);
+
+ // Update the used textures
+ General.Map.Data.UpdateUsedTextures();
+
+ // Done
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); //mxd
+ this.DialogResult = DialogResult.OK;
+ this.Close();
+ }
+
+ private void cancel_Click(object sender, EventArgs e)
+ {
+ //mxd. Let's pretend nothing of this really happened...
+ if (undocreated)
+ {
+ General.Map.UndoRedo.WithdrawUndo();
+
+ // Changing certain properties of the sector, like floor/ceiling textures will set General.Map.IsChanged to true.
+ // But if cancel is pressed and the changes are discarded, and the map was not changed before, we have to force
+ // General.Map.IsChanged back to false
+ if (General.Map.IsChanged && oldmapischanged == false)
+ General.Map.ForceMapIsChangedFalse();
+ }
+
+ // Be gone
+ this.DialogResult = DialogResult.Cancel;
+ this.Close();
+ }
+
+ private void browseeffect_Click(object sender, EventArgs e)
+ {
+ effect.Value = EffectBrowserForm.BrowseEffect(this, effect.Value);
+ }
+
+ //mxd
+ private void SectorEditFormUDMF_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ // Save settings
+ General.Settings.WriteSetting("windows." + configname + ".activetab", tabs.SelectedIndex);
+
+ General.Settings.WriteSetting("windows." + configname + ".linkceilingscale", ceilScale.LinkValues);
+ General.Settings.WriteSetting("windows." + configname + ".linkfloorscale", floorScale.LinkValues);
+
+ General.Settings.WriteSetting("windows." + configname + ".useceillineangles", cbUseCeilLineAngles.Checked);
+ General.Settings.WriteSetting("windows." + configname + ".usefloorlineangles", cbUseFloorLineAngles.Checked);
+
+ General.Settings.WriteSetting("windows." + configname + ".useceilslopelineangles", ceilingslopecontrol.UseLineAngles);
+ General.Settings.WriteSetting("windows." + configname + ".usefloorslopelineangles", floorslopecontrol.UseLineAngles);
+
+ General.Settings.WriteSetting("windows." + configname + ".ceilpivotmode", (int)ceilingslopecontrol.PivotMode);
+ General.Settings.WriteSetting("windows." + configname + ".floorpivotmode", (int)floorslopecontrol.PivotMode);
+ }
+
+ private void SectorEditFormUDMF_HelpRequested(object sender, HelpEventArgs hlpevent)
+ {
+ General.ShowHelp("w_sectoredit.html");
+ hlpevent.Handled = true;
+ }
+
+ private void tabcustom_MouseEnter(object sender, EventArgs e)
+ {
+ fieldslist.Focus();
+ }
+
+ private void ceilAngleControl_AngleChanged(object sender, EventArgs e)
+ {
+ ceilRotation.Text = (General.ClampAngle(360 - ceilAngleControl.Angle)).ToString();
+ }
+
+ private void floorAngleControl_AngleChanged(object sender, EventArgs e)
+ {
+ floorRotation.Text = (General.ClampAngle(360 - floorAngleControl.Angle)).ToString();
+ }
+
+ private void cbUseCeilLineAngles_CheckedChanged(object sender, EventArgs e)
+ {
+ ceilRotation.ButtonStepsWrapAround = cbUseCeilLineAngles.Checked;
+ ceilRotation.StepValues = (cbUseCeilLineAngles.Checked ? anglesteps : null);
+ }
+
+ private void cbUseFloorLineAngles_CheckedChanged(object sender, EventArgs e)
+ {
+ floorRotation.ButtonStepsWrapAround = cbUseFloorLineAngles.Checked;
+ floorRotation.StepValues = (cbUseFloorLineAngles.Checked ? anglesteps : null);
+ }
+
+ private void resetdamagetype_Click(object sender, EventArgs e)
+ {
+ damagetype.Focus();
+ damagetype.Text = NO_DAMAGETYPE;
+ }
+
+ private void damagetype_TextChanged(object sender, EventArgs e)
+ {
+ resetdamagetype.Visible = (damagetype.Text != NO_DAMAGETYPE);
+ }
+
+ private void damagetype_MouseDown(object sender, MouseEventArgs e)
+ {
+ if(damagetype.Text == NO_DAMAGETYPE) damagetype.SelectAll();
+ }
+
+ #endregion
+
+ #region ================== Sector Realtime events (mxd)
+
+ private void ceilingheight_WhenTextChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ UpdateCeilingHeight();
+ UpdateSectorHeight();
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void floorheight_WhenTextChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ UpdateFloorHeight();
+ UpdateSectorHeight();
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void heightoffset_WhenTextChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ UpdateFloorHeight();
+ UpdateCeilingHeight();
+ UpdateSectorHeight();
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void brightness_WhenTextChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ // Reset increment steps, otherwise it's just keep counting and counting
+ brightness.ResetIncrementStep();
+
+ //restore values
+ if (string.IsNullOrEmpty(brightness.Text))
+ {
+ foreach(Sector s in sectors)
+ s.Brightness = sectorprops[s].Brightness;
+
+ }
+ else //update values
+ {
+ foreach(Sector s in sectors)
+ s.Brightness = General.Clamp(brightness.GetResult(sectorprops[s].Brightness), General.Map.FormatInterface.MinBrightness, General.Map.FormatInterface.MaxBrightness);
+ }
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void ceilingtex_OnValueChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ //restore values
+ if(string.IsNullOrEmpty(ceilingtex.TextureName))
+ {
+ foreach(Sector s in sectors)
+ s.SetCeilTexture(sectorprops[s].CeilTexture);
+
+ }
+ else //update values
+ {
+ foreach(Sector s in sectors)
+ s.SetCeilTexture(ceilingtex.GetResult(s.CeilTexture));
+ }
+
+ // Update the used textures
+ General.Map.Data.UpdateUsedTextures();
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void floortex_OnValueChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ //restore values
+ if(string.IsNullOrEmpty(floortex.TextureName))
+ {
+ foreach(Sector s in sectors)
+ s.SetFloorTexture(sectorprops[s].FloorTexture);
+
+ }
+ else //update values
+ {
+ foreach(Sector s in sectors)
+ s.SetFloorTexture(floortex.GetResult(s.FloorTexture));
+ }
+
+ // Update the used textures
+ General.Map.Data.UpdateUsedTextures();
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void floorRotation_WhenTextChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ // Reset increment steps, otherwise it's just keep counting and counting
+ floorRotation.ResetIncrementStep();
+
+ //restore values
+ if (string.IsNullOrEmpty(floorRotation.Text))
+ {
+ floorAngleControl.Angle = AngleControlEx.NO_ANGLE;
+
+ foreach(Sector s in sectors)
+ {
+ UniFields.SetFloat(s.Fields, "rotationfloor", sectorprops[s].FloorRotation, 0.0);
+ s.UpdateNeeded = true;
+ }
+ }
+ else //update values
+ {
+ floorAngleControl.Angle = (int)General.ClampAngle(360 - floorRotation.GetResultFloat(0));
+
+ foreach(Sector s in sectors)
+ {
+ UniFields.SetFloat(s.Fields, "rotationfloor", floorRotation.GetResultFloat(sectorprops[s].FloorRotation), 0.0);
+ s.UpdateNeeded = true;
+ }
+ }
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void ceilRotation_WhenTextChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ // Reset increment steps, otherwise it's just keep counting and counting
+ ceilRotation.ResetIncrementStep();
+
+ //restore values
+ if (string.IsNullOrEmpty(ceilRotation.Text))
+ {
+ ceilAngleControl.Angle = AngleControlEx.NO_ANGLE;
+
+ foreach(Sector s in sectors)
+ {
+ UniFields.SetFloat(s.Fields, "rotationceiling", sectorprops[s].CeilRotation, 0.0);
+ s.UpdateNeeded = true;
+ }
+ }
+ else //update values
+ {
+ ceilAngleControl.Angle = (int)General.ClampAngle(360 - ceilRotation.GetResultFloat(0));
+
+ foreach(Sector s in sectors)
+ {
+ UniFields.SetFloat(s.Fields, "rotationceiling", ceilRotation.GetResultFloat(sectorprops[s].CeilRotation), 0.0);
+ s.UpdateNeeded = true;
+ }
+ }
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void lightColor_OnValueChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ foreach(Sector s in sectors)
+ {
+ lightColor.ApplyTo(s.Fields, sectorprops[s].LightColor);
+ s.UpdateNeeded = true;
+ }
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void fadeColor_OnValueChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ foreach(Sector s in sectors)
+ {
+ fadeColor.ApplyTo(s.Fields, sectorprops[s].FadeColor);
+ s.UpdateNeeded = true;
+ }
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ #endregion
+
+ #region ================== Ceiling/Floor realtime events (mxd)
+
+ private void ceilOffsets_OnValuesChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ // Reset increment steps, otherwise it's just keep counting and counting
+ ceilOffsets.ResetIncrementStep();
+
+ foreach (Sector s in sectors)
+ {
+ ceilOffsets.ApplyTo(s.Fields, General.Map.FormatInterface.MinTextureOffset, General.Map.FormatInterface.MaxTextureOffset, sectorprops[s].CeilOffsetX, sectorprops[s].CeilOffsetY);
+ s.UpdateNeeded = true;
+ }
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void floorOffsets_OnValuesChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ // Reset increment steps, otherwise it's just keep counting and counting
+ floorOffsets.ResetIncrementStep();
+
+ foreach (Sector s in sectors)
+ {
+ floorOffsets.ApplyTo(s.Fields, General.Map.FormatInterface.MinTextureOffset, General.Map.FormatInterface.MaxTextureOffset, sectorprops[s].FloorOffsetX, sectorprops[s].FloorOffsetY);
+ s.UpdateNeeded = true;
+ }
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void ceilScale_OnValuesChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ // Reset increment steps, otherwise it's just keep counting and counting
+ ceilScale.ResetIncrementStep();
+
+ foreach (Sector s in sectors)
+ {
+ ceilScale.ApplyTo(s.Fields, General.Map.FormatInterface.MinTextureOffset, General.Map.FormatInterface.MaxTextureOffset, sectorprops[s].CeilScaleX, sectorprops[s].CeilScaleY);
+ s.UpdateNeeded = true;
+ }
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void floorScale_OnValuesChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ // Reset increment steps, otherwise it's just keep counting and counting
+ floorScale.ResetIncrementStep();
+
+ foreach (Sector s in sectors)
+ {
+ floorScale.ApplyTo(s.Fields, General.Map.FormatInterface.MinTextureOffset, General.Map.FormatInterface.MaxTextureOffset, sectorprops[s].FloorScaleX, sectorprops[s].FloorScaleY);
+ s.UpdateNeeded = true;
+ }
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void ceilBrightness_WhenTextChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ // Reset increment steps, otherwise it's just keep counting and counting
+ ceilBrightness.ResetIncrementStep();
+
+ //restore values
+ if (string.IsNullOrEmpty(ceilBrightness.Text))
+ {
+ foreach(Sector s in sectors)
+ {
+ UniFields.SetInteger(s.Fields, "lightceiling", sectorprops[s].CeilBrightness, 0);
+ s.UpdateNeeded = true;
+ }
+ }
+ else //update values
+ {
+ foreach(Sector s in sectors)
+ {
+ bool absolute = false;
+ switch(ceilLightAbsolute.CheckState)
+ {
+ case CheckState.Indeterminate:
+ absolute = s.Fields.GetValue("lightceilingabsolute", false);
+ break;
+ case CheckState.Checked:
+ absolute = true;
+ break;
+ }
+
+ int value = General.Clamp(ceilBrightness.GetResult(sectorprops[s].CeilBrightness), (absolute ? 0 : -255), 255);
+ UniFields.SetInteger(s.Fields, "lightceiling", value, 0);
+ s.UpdateNeeded = true;
+ }
+ }
+
+ resetceillight.Visible = (ceilLightAbsolute.CheckState != CheckState.Unchecked || ceilBrightness.Text != "0");
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void floorBrightness_WhenTextChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ // Reset increment steps, otherwise it's just keep counting and counting
+ floorBrightness.ResetIncrementStep();
+
+ //restore values
+ if (string.IsNullOrEmpty(floorBrightness.Text))
+ {
+ foreach(Sector s in sectors)
+ {
+ UniFields.SetInteger(s.Fields, "lightfloor", sectorprops[s].FloorBrightness, 0);
+ s.UpdateNeeded = true;
+ }
+ }
+ else //update values
+ {
+ foreach(Sector s in sectors)
+ {
+ bool absolute = false;
+ switch(floorLightAbsolute.CheckState)
+ {
+ case CheckState.Indeterminate:
+ absolute = s.Fields.GetValue("lightfloorabsolute", false);
+ break;
+ case CheckState.Checked:
+ absolute = true;
+ break;
+ }
+
+ int value = General.Clamp(floorBrightness.GetResult(sectorprops[s].FloorBrightness), (absolute ? 0 : -255), 255);
+ UniFields.SetInteger(s.Fields, "lightfloor", value, 0);
+ s.UpdateNeeded = true;
+ }
+ }
+
+ resetfloorlight.Visible = (floorLightAbsolute.CheckState != CheckState.Unchecked || floorBrightness.Text != "0");
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void ceilLightAbsolute_CheckedChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ if(ceilLightAbsolute.Checked)
+ {
+ foreach(Sector s in sectors)
+ {
+ s.Fields["lightceilingabsolute"] = new UniValue(UniversalType.Boolean, true);
+ s.UpdateNeeded = true;
+ }
+ }
+ else if(ceilLightAbsolute.CheckState == CheckState.Indeterminate)
+ {
+ foreach(Sector s in sectors)
+ {
+ if(sectorprops[s].CeilLightAbsoulte)
+ {
+ s.Fields["lightceilingabsolute"] = new UniValue(UniversalType.Boolean, true);
+ s.UpdateNeeded = true;
+ }
+ else if(s.Fields.ContainsKey("lightceilingabsolute"))
+ {
+ s.Fields.Remove("lightceilingabsolute");
+ s.UpdateNeeded = true;
+ }
+ }
+ }
+ else
+ {
+ foreach(Sector s in sectors)
+ {
+ if(s.Fields.ContainsKey("lightceilingabsolute"))
+ {
+ s.Fields.Remove("lightceilingabsolute");
+ s.UpdateNeeded = true;
+ }
+ }
+ }
+
+ resetceillight.Visible = (ceilLightAbsolute.CheckState != CheckState.Unchecked || ceilBrightness.Text != "0");
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void floorLightAbsolute_CheckedChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ if(floorLightAbsolute.Checked)
+ {
+ foreach(Sector s in sectors)
+ {
+ s.Fields["lightfloorabsolute"] = new UniValue(UniversalType.Boolean, true);
+ s.UpdateNeeded = true;
+ }
+ }
+ else if(floorLightAbsolute.CheckState == CheckState.Indeterminate)
+ {
+ foreach(Sector s in sectors)
+ {
+ if(sectorprops[s].FloorLightAbsoulte)
+ {
+ s.Fields["lightfloorabsolute"] = new UniValue(UniversalType.Boolean, true);
+ s.UpdateNeeded = true;
+ }
+ else if(s.Fields.ContainsKey("lightfloorabsolute"))
+ {
+ s.Fields.Remove("lightfloorabsolute");
+ s.UpdateNeeded = true;
+ }
+ }
+ }
+ else
+ {
+ foreach(Sector s in sectors)
+ {
+ if(s.Fields.ContainsKey("lightfloorabsolute"))
+ {
+ s.Fields.Remove("lightfloorabsolute");
+ s.UpdateNeeded = true;
+ }
+ }
+ }
+
+ resetfloorlight.Visible = (floorLightAbsolute.CheckState != CheckState.Unchecked || floorBrightness.Text != "0");
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void resetceillight_Click(object sender, EventArgs e)
+ {
+ MakeUndo(); //mxd
+
+ preventchanges = true;
+
+ ceilLightAbsolute.Checked = false;
+ ceilBrightness.Text = "0";
+
+ foreach(Sector s in sectors)
+ {
+ if(s.Fields.ContainsKey("lightceilingabsolute")) s.Fields.Remove("lightceilingabsolute");
+ if(s.Fields.ContainsKey("lightceiling")) s.Fields.Remove("lightceiling");
+ }
+
+ preventchanges = false;
+
+ resetceillight.Visible = false;
+ ceilBrightness.Focus();
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void resetfloorlight_Click(object sender, EventArgs e)
+ {
+ MakeUndo(); //mxd
+
+ preventchanges = true;
+
+ floorLightAbsolute.Checked = false;
+ floorBrightness.Text = "0";
+
+ foreach(Sector s in sectors)
+ {
+ if(s.Fields.ContainsKey("lightfloorabsolute")) s.Fields.Remove("lightfloorabsolute");
+ if(s.Fields.ContainsKey("lightfloor")) s.Fields.Remove("lightfloor");
+ }
+
+ preventchanges = false;
+
+ resetfloorlight.Visible = false;
+ floorBrightness.Focus();
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ #endregion
+
+ #region ================== Slope Utility (mxd)
+
+ private void SetupFloorSlope(Sector s, bool first)
+ {
+ if(s.FloorSlope.GetLengthSq() > 0)
+ {
+ double anglexy = General.ClampAngle(Math.Round(Angle2D.RadToDeg(s.FloorSlope.GetAngleXY()) - 180, 1));
+ double anglez = -Math.Round(Angle2D.RadToDeg(s.FloorSlope.GetAngleZ()) - 90, 1);
+ double offset = Math.Round(GetVirtualSlopeOffset(s, floorslopecontrol.PivotMode, true), 1);
+
+ if(anglexy >= 180 && anglez < 0)
+ {
+ anglexy -= 180;
+ anglez = -anglez;
+ }
+
+ floorslopecontrol.SetValues(anglexy, anglez, offset, first);
+ }
+ else
+ {
+ floorslopecontrol.SetValues(0.0, 0.0, s.FloorHeight, first);
+ }
+ }
+
+ private void SetupCeilingSlope(Sector s, bool first)
+ {
+ if(s.CeilSlope.GetLengthSq() > 0)
+ {
+ double anglexy = General.ClampAngle(Math.Round(Angle2D.RadToDeg(s.CeilSlope.GetAngleXY()) - 180, 1));
+ double anglez = -(270 - Math.Round(Angle2D.RadToDeg(s.CeilSlope.GetAngleZ()), 1));
+ double offset = Math.Round(GetVirtualSlopeOffset(s, ceilingslopecontrol.PivotMode, false), 1);
+
+ if(anglexy >= 180 && anglez < 0)
+ {
+ anglexy -= 180;
+ anglez = -anglez;
+ }
+
+ ceilingslopecontrol.SetValues(anglexy, anglez, offset, first);
+ }
+ else
+ {
+ ceilingslopecontrol.SetValues(0.0, 0.0, s.CeilHeight, first);
+ }
+ }
+
+ // Gets the offset to be displayed in a SectorSlopeControl
+ private double GetVirtualSlopeOffset(Sector s, SlopePivotMode mode, bool floor)
+ {
+ double offset = (floor ? s.FloorSlopeOffset : s.CeilSlopeOffset);
+ if(double.IsNaN(offset))
+ {
+ offset = (floor ? s.FloorHeight : s.CeilHeight);
+ }
+
+ Vector3D normal = (floor ? s.FloorSlope : s.CeilSlope);
+
+ if(normal.GetLengthSq() > 0)
+ {
+ Vector3D center = GetSectorCenter(s, 0, mode);
+ Plane p = new Plane(normal, offset);
+ return p.GetZ(center);
+ }
+
+ return offset;
+ }
+
+ // Gets the offset to be displayed in a SectorSlopeControl
+ private double GetInitialVirtualSlopeOffset(Sector s, SlopePivotMode mode, bool floor)
+ {
+ double offset = (floor ? sectorprops[s].FloorSlopeOffset : sectorprops[s].CeilSlopeOffset);
+ Vector3D normal = (floor ? sectorprops[s].FloorSlope : sectorprops[s].CeilSlope);
+
+ if(normal.GetLengthSq() > 0)
+ {
+ Vector3D center = GetSectorCenter(s, 0, mode);
+ Plane p = new Plane(normal, offset);
+ return p.GetZ(center);
+ }
+
+ return offset;
+ }
+
+ private Vector3D GetSectorCenter(Sector s, double offset, SlopePivotMode mode)
+ {
+ switch(mode)
+ {
+ case SlopePivotMode.GLOBAL: //translate from the center of selection
+ return new Vector3D(globalslopepivot, offset);
+
+ case SlopePivotMode.LOCAL: //translate from sector's bounding box center
+ return new Vector3D(slopepivots[s], offset);
+
+ case SlopePivotMode.ORIGIN: //don't translate
+ return new Vector3D(0, 0, offset);
+
+ default:
+ throw new NotImplementedException("Unknown SlopePivotMode: " + (int)mode);
+ }
+ }
+
+ #endregion
+
+ #region ================== Slopes realtime events (mxd)
+
+ private void ceilingslopecontrol_OnAnglesChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ //Set or restore values
+ foreach(Sector s in sectors)
+ {
+ double anglexy = General.ClampAngle(ceilingslopecontrol.GetAngleXY(sectorprops[s].CeilSlopeAngleXY) + 270);
+ double anglez = -(ceilingslopecontrol.GetAngleZ(sectorprops[s].CeilSlopeAngleZ) + 90);
+
+ double virtualoffset = GetInitialVirtualSlopeOffset(s, ceilingslopecontrol.PivotMode, false);
+ Vector3D center = GetSectorCenter(s, ceilingslopecontrol.GetOffset(virtualoffset), ceilingslopecontrol.PivotMode);
+ Plane p = new Plane(center, Angle2D.DegToRad(anglexy), Angle2D.DegToRad(anglez), false);
+ s.CeilSlope = p.Normal;
+ s.CeilSlopeOffset = p.Offset;
+
+ s.UpdateNeeded = true;
+ }
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void floorslopecontrol_OnAnglesChanged(object sender, EventArgs e)
+ {
+ if(preventchanges) return;
+ MakeUndo(); //mxd
+
+ //Set or restore values
+ foreach(Sector s in sectors)
+ {
+ double anglexy = General.ClampAngle(floorslopecontrol.GetAngleXY(sectorprops[s].FloorSlopeAngleXY) + 90);
+ double anglez = -(floorslopecontrol.GetAngleZ(sectorprops[s].FloorSlopeAngleZ) + 90);
+
+ double virtualoffset = GetInitialVirtualSlopeOffset(s, floorslopecontrol.PivotMode, true);
+ Vector3D center = GetSectorCenter(s, floorslopecontrol.GetOffset(virtualoffset), floorslopecontrol.PivotMode);
+ Plane p = new Plane(center, Angle2D.DegToRad(anglexy), Angle2D.DegToRad(anglez), true);
+ s.FloorSlope = p.Normal;
+ s.FloorSlopeOffset = p.Offset;
+
+ s.UpdateNeeded = true;
+ }
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ // Update displayed ceiling offset value
+ private void ceilingslopecontrol_OnPivotModeChanged(object sender, EventArgs e)
+ {
+ MakeUndo(); //mxd
+ bool first = true;
+ foreach(Sector s in sectors)
+ {
+ SetupCeilingSlope(s, first);
+ first = false;
+ }
+ }
+
+ // Update displayed floor offset value
+ private void floorslopecontrol_OnPivotModeChanged(object sender, EventArgs e)
+ {
+ MakeUndo(); //mxd
+ bool first = true;
+ foreach(Sector s in sectors)
+ {
+ SetupFloorSlope(s, first);
+ first = false;
+ }
+ }
+
+ private void ceilingslopecontrol_OnResetClicked(object sender, EventArgs e)
+ {
+ MakeUndo(); //mxd
+ Sector fs = General.GetByIndex(sectors, 0);
+
+ // biwa. Do not reset to the z position of the plane of the center of the sector anymore, since
+ // that will result in pretty crazy values of 3D floor control sectors
+ /*
+ if (fs.CeilSlope.IsNormalized())
+ {
+ fs.UpdateBBox();
+ Plane p = new Plane(fs.CeilSlope, fs.CeilSlopeOffset);
+ ceilingslopecontrol.SetOffset((int)Math.Round(p.GetZ(fs.BBox.X + fs.BBox.Width / 2, fs.BBox.Y + fs.BBox.Height / 2)), true);
+ }
+ else
+ ceilingslopecontrol.SetOffset(fs.CeilHeight, true);
+ */
+ ceilingslopecontrol.SetOffset(fs.CeilHeight, true);
+
+ foreach (Sector s in sectors)
+ {
+ // biwa. Do not reset to the z position of the plane of the center of the sector anymore, since
+ // that will result in pretty crazy values of 3D floor control sectors
+ /*
+ if (s.CeilSlope.IsNormalized())
+ {
+ s.UpdateBBox();
+ Plane p = new Plane(s.CeilSlope, s.CeilSlopeOffset);
+ s.CeilHeight = (int)Math.Round(p.GetZ(s.BBox.X + s.BBox.Width / 2, s.BBox.Y + s.BBox.Height / 2));
+ }
+ */
+
+ s.CeilSlope = new Vector3D();
+ s.CeilSlopeOffset = double.NaN;
+ s.UpdateNeeded = true;
+ ceilingslopecontrol.SetOffset(s.CeilHeight, false);
+ }
+
+ ceilingslopecontrol.UpdateOffset();
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void floorslopecontrol_OnResetClicked(object sender, EventArgs e)
+ {
+ MakeUndo(); //mxd
+ Sector fs = General.GetByIndex(sectors, 0);
+
+ // biwa. Do not reset to the z position of the plane of the center of the sector anymore, since
+ // that will result in pretty crazy values of 3D floor control sectors
+ /*
+ if (fs.FloorSlope.IsNormalized())
+ {
+ fs.UpdateBBox();
+ Plane p = new Plane(fs.FloorSlope, fs.FloorSlopeOffset);
+ floorslopecontrol.SetOffset((int)Math.Round(p.GetZ(fs.BBox.X + fs.BBox.Width / 2, fs.BBox.Y + fs.BBox.Height / 2)), true);
+ }
+ else
+ floorslopecontrol.SetOffset(fs.FloorHeight, true);
+ */
+
+ floorslopecontrol.SetOffset(fs.FloorHeight, true);
+
+ foreach (Sector s in sectors)
+ {
+ // biwa. Do not reset to the z position of the plane of the center of the sector anymore, since
+ // that will result in pretty crazy values of 3D floor control sectors
+ /*
+ if (s.FloorSlope.IsNormalized())
+ {
+ s.UpdateBBox();
+ Plane p = new Plane(s.FloorSlope, s.FloorSlopeOffset);
+ s.FloorHeight = (int)Math.Round(p.GetZ(s.BBox.X + s.BBox.Width / 2, s.BBox.Y + s.BBox.Height / 2));
+ }
+ */
+
+ s.FloorSlope = new Vector3D();
+ s.FloorSlopeOffset = double.NaN;
+ s.UpdateNeeded = true;
+ floorslopecontrol.SetOffset(s.FloorHeight, false);
+ }
+
+ floorslopecontrol.UpdateOffset();
+
+ General.Map.IsChanged = true;
+ if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);
+ }
+
+ private void ceilingslopecontrol_OnUseLineAnglesChanged(object sender, EventArgs e)
+ {
+ ceilingslopecontrol.StepValues = (ceilingslopecontrol.UseLineAngles ? anglesteps : null);
+ }
+
+ private void floorslopecontrol_OnUseLineAnglesChanged(object sender, EventArgs e)
+ {
+ floorslopecontrol.StepValues = (floorslopecontrol.UseLineAngles ? anglesteps : null);
+ }
+
+ #endregion
+
+ }
+}
diff --git a/Source/Core/Windows/SectorEditFormSRB2.resx b/Source/Core/Windows/SectorEditFormSRB2.resx
new file mode 100644
index 00000000..33f195cb
--- /dev/null
+++ b/Source/Core/Windows/SectorEditFormSRB2.resx
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+ dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAG/SURBVDhPpZJLKERRGMdnPPKmCVEoibK0sJyUSFmQ
+ SRQTNoaQhrzuZcPKbpq7YWNBymNl7T23yXvQDGPCmGai8RgLsrD8O+fTNYbSTBa/c7/z/b///5zbvSoA
+ /4IWccrDHp8Ni+0RAttXjHiQb/ARvBanPZCZpswp0BJbcYKxGS/Myz6U9nuQOxhAwcQbiibfCV7zHtfM
+ S15m+RGQ1nyJnOEnFAr3yBt9JrL7/Mjo9BK8Vvp5nW6YF4M3piVV70TO+DMjgGzBj6qJa0gLbjjdTwSv
+ K0UXMo0+ZA3doaTnHPKRn0IoILHxGBmjt4Sm/wbtpgu8vr3QgIJ8dIfyITs0RjdSDRcQpDPSSYzT7SBl
+ 4JpINl4iXm+DKJ3SwHekeRcS2k6Q1O1EWc8+6SSoS1cQU7P9RXT1BnhPNNloSOH86gEx9VbEdTmQrtsk
+ 7UsMBx4QVbeJaIMNmtpV1oowQJpzQN1ggbptD9qOLdaKIEA+9ELbK0PdskshgumAtcMMkObsn+YmKwvY
+ QXHrBiwHPiaFEcDfm67NT2bmFN0azLPBL/TL8BMWoOIGbixuXQ8xc0KG/4IbLfvBX1ghZBM5UH0A43jP
+ b2gw2QkAAAAASUVORK5CYII=
+
+
+
+ 17, 17
+
+
+ False
+
+
+ False
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29m
+ dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGkSURBVDhPpVNrSwJRFDw/r689qIjoQRFBkZUUaBFE
+ SEEUEVGYmWmLuZXiSiKrqImhvSiKgp7f+wF903W650QRIZE1MMze4Z4ze8/uJQD/ItWP6AMLxvPrxM4T
+ nEFF7QGOwB3Gt24xtnkDu/cao+uXGHZfwLZ6hsGVEzjXj165Thq49p+tZfMFtdK2lLOkASf/hX3zh6pe
+ NXBqj/xQM3pm0yxEju17MfqzIigWiygUCsjn88jlcshms0in00ilUjBNU8jociVZVAM1sJ9QqVQ+aVmW
+ kNExnWAh4mmL8d5YUjOZDJLJJBKJBOLxOGKxGKLRKCKRCMLhsOxrn4qzEPGn+o5qqR8sl8uyp20yxkJk
+ 37gSo0GtuYDPyKmGYUiarusIBoPQNA2BQAB+v1/2tzqjLES2tXMxvqdx0leWSqVPMprG9lmIhlZOxahT
+ ay7k83JyKBSSVJ/PB6/XC4/HA7fbLWQ02ndZiAaXj8WoFfWjOovcBb1/MS9/Vu9cBt2uFDpnTDXlAxlU
+ 64SBFkcEzeNh9dp7KlmHqmFyB6p6w2phVfP3BL0BYxQ+S88AMgkAAAAASUVORK5CYII=
+
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ False
+
+
+ True
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+ dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAG/SURBVDhPpZJLKERRGMdnPPKmCVEoibK0sJyUSFmQ
+ SRQTNoaQhrzuZcPKbpq7YWNBymNl7T23yXvQDGPCmGai8RgLsrD8O+fTNYbSTBa/c7/z/b///5zbvSoA
+ /4IWccrDHp8Ni+0RAttXjHiQb/ARvBanPZCZpswp0BJbcYKxGS/Myz6U9nuQOxhAwcQbiibfCV7zHtfM
+ S15m+RGQ1nyJnOEnFAr3yBt9JrL7/Mjo9BK8Vvp5nW6YF4M3piVV70TO+DMjgGzBj6qJa0gLbjjdTwSv
+ K0UXMo0+ZA3doaTnHPKRn0IoILHxGBmjt4Sm/wbtpgu8vr3QgIJ8dIfyITs0RjdSDRcQpDPSSYzT7SBl
+ 4JpINl4iXm+DKJ3SwHekeRcS2k6Q1O1EWc8+6SSoS1cQU7P9RXT1BnhPNNloSOH86gEx9VbEdTmQrtsk
+ 7UsMBx4QVbeJaIMNmtpV1oowQJpzQN1ggbptD9qOLdaKIEA+9ELbK0PdskshgumAtcMMkObsn+YmKwvY
+ QXHrBiwHPiaFEcDfm67NT2bmFN0azLPBL/TL8BMWoOIGbixuXQ8xc0KG/4IbLfvBX1ghZBM5UH0A43jP
+ b2gw2QkAAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+ dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAG/SURBVDhPpZJLKERRGMdnPPKmCVEoibK0sJyUSFmQ
+ SRQTNoaQhrzuZcPKbpq7YWNBymNl7T23yXvQDGPCmGai8RgLsrD8O+fTNYbSTBa/c7/z/b///5zbvSoA
+ /4IWccrDHp8Ni+0RAttXjHiQb/ARvBanPZCZpswp0BJbcYKxGS/Myz6U9nuQOxhAwcQbiibfCV7zHtfM
+ S15m+RGQ1nyJnOEnFAr3yBt9JrL7/Mjo9BK8Vvp5nW6YF4M3piVV70TO+DMjgGzBj6qJa0gLbjjdTwSv
+ K0UXMo0+ZA3doaTnHPKRn0IoILHxGBmjt4Sm/wbtpgu8vr3QgIJ8dIfyITs0RjdSDRcQpDPSSYzT7SBl
+ 4JpINl4iXm+DKJ3SwHekeRcS2k6Q1O1EWc8+6SSoS1cQU7P9RXT1BnhPNNloSOH86gEx9VbEdTmQrtsk
+ 7UsMBx4QVbeJaIMNmtpV1oowQJpzQN1ggbptD9qOLdaKIEA+9ELbK0PdskshgumAtcMMkObsn+YmKwvY
+ QXHrBiwHPiaFEcDfm67NT2bmFN0azLPBL/TL8BMWoOIGbixuXQ8xc0KG/4IbLfvBX1ghZBM5UH0A43jP
+ b2gw2QkAAAAASUVORK5CYII=
+
+
+
+ True
+
+
\ No newline at end of file