diff --git a/Source/Plugins/BuilderModes/Interface/SlopeArchForm.Designer.cs b/Source/Plugins/BuilderModes/Interface/SlopeArchForm.Designer.cs index 8b114e8eca31b9e426677c49b96d9157417f6357..8ef8ecac9cf065904c48dddf3e091c8ce3edd5bc 100644 --- a/Source/Plugins/BuilderModes/Interface/SlopeArchForm.Designer.cs +++ b/Source/Plugins/BuilderModes/Interface/SlopeArchForm.Designer.cs @@ -62,7 +62,7 @@ this.theta.Size = new System.Drawing.Size(63, 24); this.theta.StepValues = null; this.theta.TabIndex = 18; - this.theta.WhenTextChanged += new System.EventHandler(this.UpdateArch); + this.theta.WhenTextChanged += new System.EventHandler(this.theta_WhenTextChanged); // // label1 // @@ -72,7 +72,6 @@ this.label1.Size = new System.Drawing.Size(37, 13); this.label1.TabIndex = 19; this.label1.Text = "Angle:"; - this.label1.Click += new System.EventHandler(this.label1_Click); // // offset // @@ -91,7 +90,7 @@ this.offset.Size = new System.Drawing.Size(63, 24); this.offset.StepValues = null; this.offset.TabIndex = 20; - this.offset.WhenTextChanged += new System.EventHandler(this.UpdateArch); + this.offset.WhenTextChanged += new System.EventHandler(this.offset_WhenTextChanged); // // label2 // @@ -133,7 +132,7 @@ this.up.TabStop = true; this.up.Text = "Up"; this.up.UseVisualStyleBackColor = true; - this.up.CheckedChanged += new System.EventHandler(this.UpdateArch); + this.up.CheckedChanged += new System.EventHandler(this.up_CheckedChanged); // // down // @@ -144,7 +143,7 @@ this.down.TabIndex = 25; this.down.Text = "Down"; this.down.UseVisualStyleBackColor = true; - this.down.CheckedChanged += new System.EventHandler(this.UpdateArch); + this.down.CheckedChanged += new System.EventHandler(this.down_CheckedChanged); // // scale // @@ -163,7 +162,7 @@ this.scale.Size = new System.Drawing.Size(63, 24); this.scale.StepValues = null; this.scale.TabIndex = 26; - this.scale.WhenTextChanged += new System.EventHandler(this.UpdateArch); + this.scale.WhenTextChanged += new System.EventHandler(this.scale_WhenTextChanged); // // label3 // @@ -221,7 +220,7 @@ this.heightoffset.Size = new System.Drawing.Size(63, 24); this.heightoffset.StepValues = null; this.heightoffset.TabIndex = 31; - this.heightoffset.WhenTextChanged += new System.EventHandler(this.UpdateArch); + this.heightoffset.WhenTextChanged += new System.EventHandler(this.heightoffset_WhenTextChanged); // // label4 // diff --git a/Source/Plugins/BuilderModes/Interface/SlopeArchForm.cs b/Source/Plugins/BuilderModes/Interface/SlopeArchForm.cs index 6a0e4643c2f09c9aaecb3f5ec8575e9c78306c28..d789eecdbc5d7f8c40483245057e37447cb922d1 100644 --- a/Source/Plugins/BuilderModes/Interface/SlopeArchForm.cs +++ b/Source/Plugins/BuilderModes/Interface/SlopeArchForm.cs @@ -23,6 +23,7 @@ namespace CodeImp.DoomBuilder.BuilderModes private double originalheightoffset; private SlopeArcher slopearcher; public event EventHandler UpdateChangedObjects; + bool updating; internal SlopeArchForm(EditMode mode, SlopeArcher slopearcher) { @@ -40,9 +41,11 @@ namespace CodeImp.DoomBuilder.BuilderModes offset.Text = originaloffset.ToString(); scale.Text = (originalscale * 100.0).ToString(); heightoffset.Text = originalheightoffset.ToString(); + + updating = false; } - private void UpdateArch(object sender, EventArgs e) + private void UpdateArch() { double t = theta.GetResultFloat(originaltheta); double o = offset.GetResultFloat(originaloffset); @@ -75,25 +78,99 @@ namespace CodeImp.DoomBuilder.BuilderModes private void halfcircle_Click(object sender, EventArgs e) { + updating = true; + theta.Text = "180"; offset.Text = "0"; + + UpdateArch(); + + updating = false; } private void quartercircleleft_Click(object sender, EventArgs e) { + updating = true; + theta.Text = "90"; offset.Text = "90"; + + UpdateArch(); + + updating = false; } private void quartercircleright_Click(object sender, EventArgs e) { + updating = true; + theta.Text = "90"; offset.Text = "0"; + + UpdateArch(); + + updating = false; + } + + private void theta_WhenTextChanged(object sender, EventArgs e) + { + if (updating) + return; + + updating = true; + + double t = theta.GetResultFloat(originaltheta); + + if (t > 180.0) + t = 180.0; + + double o = (180 - t) / 2.0; + + offset.Text = o.ToString(); + + UpdateArch(); + + updating = false; + } + + private void offset_WhenTextChanged(object sender, EventArgs e) + { + if (updating) + return; + + UpdateArch(); + } + + private void scale_WhenTextChanged(object sender, EventArgs e) + { + if (updating) + return; + + UpdateArch(); } - private void label1_Click(object sender, EventArgs e) + private void heightoffset_WhenTextChanged(object sender, EventArgs e) { + if (updating) + return; + + UpdateArch(); + } + + private void up_CheckedChanged(object sender, EventArgs e) + { + if (updating) + return; + + UpdateArch(); + } + + private void down_CheckedChanged(object sender, EventArgs e) + { + if (updating) + return; + UpdateArch(); } } } diff --git a/Source/Plugins/BuilderModes/VisualModes/SlopeArcher.cs b/Source/Plugins/BuilderModes/VisualModes/SlopeArcher.cs index bc66157667a62e2065e0142fae8aad2df8023b18..e53007df0c0f27c36d735e5e4d9698eb811feb63 100644 --- a/Source/Plugins/BuilderModes/VisualModes/SlopeArcher.cs +++ b/Source/Plugins/BuilderModes/VisualModes/SlopeArcher.cs @@ -45,7 +45,12 @@ namespace CodeImp.DoomBuilder.BuilderModes handleline = new Line2D(handle1.GetCenterPoint(), handle2.GetCenterPoint()); length = handleline.GetLength(); - baseheight = handle1.Level.type == SectorLevelType.Ceiling ? handle1.Level.sector.CeilHeight : handle1.Level.sector.FloorHeight; + if (handle1.Level.type == SectorLevelType.Ceiling) + baseheight = handle1.Level.extrafloor ? handle1.Level.sector.FloorHeight : handle1.Level.sector.CeilHeight; + else + baseheight = handle1.Level.extrafloor ? handle1.Level.sector.CeilHeight : handle1.Level.sector.FloorHeight; + + //baseheight = handle1.Level.type == SectorLevelType.Ceiling ? handle1.Level.sector.CeilHeight : handle1.Level.sector.FloorHeight; baseheightoffset = 0.0; }