diff --git a/Source/Plugins/BuilderModes/Interface/SlopeArchForm.Designer.cs b/Source/Plugins/BuilderModes/Interface/SlopeArchForm.Designer.cs index e6d70116f886ecf92587982af282744be0661b69..ad9a9512d25b016f3fbd8699a2e0c14100ff6911 100644 --- a/Source/Plugins/BuilderModes/Interface/SlopeArchForm.Designer.cs +++ b/Source/Plugins/BuilderModes/Interface/SlopeArchForm.Designer.cs @@ -45,6 +45,7 @@ this.quartercircleleft = new System.Windows.Forms.Button(); this.lockoffset = new System.Windows.Forms.CheckBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.invert = new System.Windows.Forms.Button(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // @@ -112,7 +113,7 @@ // cancel // this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancel.Location = new System.Drawing.Point(147, 167); + this.cancel.Location = new System.Drawing.Point(147, 194); this.cancel.Name = "cancel"; this.cancel.Size = new System.Drawing.Size(88, 24); this.cancel.TabIndex = 22; @@ -122,7 +123,7 @@ // accept // this.accept.DialogResult = System.Windows.Forms.DialogResult.OK; - this.accept.Location = new System.Drawing.Point(53, 167); + this.accept.Location = new System.Drawing.Point(53, 194); this.accept.Name = "accept"; this.accept.Size = new System.Drawing.Size(88, 24); this.accept.TabIndex = 23; @@ -258,21 +259,32 @@ // // groupBox1 // + this.groupBox1.Controls.Add(this.invert); this.groupBox1.Controls.Add(this.up); this.groupBox1.Controls.Add(this.down); this.groupBox1.Location = new System.Drawing.Point(156, 65); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(108, 69); + this.groupBox1.Size = new System.Drawing.Size(108, 96); this.groupBox1.TabIndex = 35; this.groupBox1.TabStop = false; this.groupBox1.Text = "Direction"; // + // invert + // + this.invert.Location = new System.Drawing.Point(6, 65); + this.invert.Name = "invert"; + this.invert.Size = new System.Drawing.Size(96, 23); + this.invert.TabIndex = 36; + this.invert.Text = "Invert"; + this.invert.UseVisualStyleBackColor = true; + this.invert.Click += new System.EventHandler(this.invert_Click); + // // SlopeArchForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.cancel; - this.ClientSize = new System.Drawing.Size(286, 203); + this.ClientSize = new System.Drawing.Size(286, 228); this.Controls.Add(this.groupBox1); this.Controls.Add(this.lockoffset); this.Controls.Add(this.label4); @@ -321,5 +333,6 @@ private System.Windows.Forms.Label label4; private System.Windows.Forms.CheckBox lockoffset; private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button invert; } } \ No newline at end of file diff --git a/Source/Plugins/BuilderModes/Interface/SlopeArchForm.cs b/Source/Plugins/BuilderModes/Interface/SlopeArchForm.cs index 29b04761a9e705ade19595c5d8a822cc92e9ba73..15cf08862a2a695d5f3b4a107969a1de009fe66f 100644 --- a/Source/Plugins/BuilderModes/Interface/SlopeArchForm.cs +++ b/Source/Plugins/BuilderModes/Interface/SlopeArchForm.cs @@ -289,6 +289,39 @@ namespace CodeImp.DoomBuilder.BuilderModes offset.Enabled = !offset.Enabled; } + /// <summary> + /// Inverts the current slope + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void invert_Click(object sender, EventArgs e) + { + // Flip up/down direction + if(up.Checked) + { + up.Checked = false; + down.Checked = true; + } + else + { + up.Checked = true; + down.Checked = false; + } + + double t = theta.GetResultFloat(originaltheta); + double o = offset.GetResultFloat(originaloffset); + + // Subtract theta from the offset, if the result is greater than 0, otherwise add theta + if (o - t < 0.0) + o = o + t; + else + o = o - t; + + offset.Text = o.ToString(); + + UpdateArch(); + } + #endregion } }