diff --git a/Source/Plugins/BuilderModes/ClassicModes/DrawEllipseMode.cs b/Source/Plugins/BuilderModes/ClassicModes/DrawEllipseMode.cs index bab6c923..6980981c 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/DrawEllipseMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/DrawEllipseMode.cs @@ -73,8 +73,7 @@ namespace CodeImp.DoomBuilder.BuilderModes //got shape if (bevelWidth < 0) { - int bevelSign = (bevelWidth > 0 ? 1 : -1); - currentBevelWidth = Math.Min(Math.Abs(bevelWidth), Math.Min(width, height) / 2) * bevelSign; + currentBevelWidth = -Math.Min(Math.Abs(bevelWidth), Math.Min(width, height) / 2) + 1; } else { currentBevelWidth = bevelWidth; } @@ -108,7 +107,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } protected override string getHintText() { - return "BVL: "+bevelWidth+"; VERTS: "+subdivisions; + return "BVL: " + bevelWidth + "; VERTS: " + subdivisions; } #endregion @@ -154,7 +153,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } protected override void decreaseBevel() { - if(currentBevelWidth == bevelWidth || bevelWidth > 0) { + if(bevelWidth > 0 || currentBevelWidth <= bevelWidth + 1) { bevelWidth = Math.Max(bevelWidth - General.Map.Grid.GridSize, panel.MinSpikiness); panel.Spikiness = bevelWidth; Update(); diff --git a/Source/Plugins/BuilderModes/Interface/DrawCurveOptionsPanel.Designer.cs b/Source/Plugins/BuilderModes/Interface/DrawCurveOptionsPanel.Designer.cs index eb8e09db..d7f86515 100644 --- a/Source/Plugins/BuilderModes/Interface/DrawCurveOptionsPanel.Designer.cs +++ b/Source/Plugins/BuilderModes/Interface/DrawCurveOptionsPanel.Designer.cs @@ -26,8 +26,9 @@ /// private void InitializeComponent() { this.toolstrip = new System.Windows.Forms.ToolStrip(); - this.seglen = new CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown(); this.seglabel = new System.Windows.Forms.ToolStripLabel(); + this.seglen = new CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown(); + this.reset = new System.Windows.Forms.ToolStripButton(); this.toolstrip.SuspendLayout(); this.SuspendLayout(); // @@ -35,22 +36,14 @@ // this.toolstrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.seglabel, - this.seglen}); + this.seglen, + this.reset}); this.toolstrip.Location = new System.Drawing.Point(0, 0); this.toolstrip.Name = "toolstrip"; this.toolstrip.Size = new System.Drawing.Size(249, 25); this.toolstrip.TabIndex = 7; this.toolstrip.Text = "toolStrip1"; // - // seglen - // - this.seglen.AutoSize = false; - this.seglen.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); - this.seglen.Name = "seglen"; - this.seglen.Size = new System.Drawing.Size(56, 20); - this.seglen.Text = "0"; - this.seglen.ValueChanged += new System.EventHandler(this.seglen_ValueChanged); - // // seglabel // this.seglabel.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Gear; @@ -58,6 +51,40 @@ this.seglabel.Size = new System.Drawing.Size(113, 22); this.seglabel.Text = "Segment Length:"; // + // seglen + // + this.seglen.AutoSize = false; + this.seglen.Margin = new System.Windows.Forms.Padding(3, 0, 0, 0); + this.seglen.Maximum = new decimal(new int[] { + 100, + 0, + 0, + 0}); + this.seglen.Minimum = new decimal(new int[] { + 0, + 0, + 0, + 0}); + this.seglen.Name = "seglen"; + this.seglen.Size = new System.Drawing.Size(56, 20); + this.seglen.Text = "0"; + this.seglen.Value = new decimal(new int[] { + 0, + 0, + 0, + 0}); + this.seglen.ValueChanged += new System.EventHandler(this.seglen_ValueChanged); + // + // reset + // + this.reset.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.reset.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Reset; + this.reset.ImageTransparentColor = System.Drawing.Color.Magenta; + this.reset.Name = "reset"; + this.reset.Size = new System.Drawing.Size(23, 22); + this.reset.Text = "Reset"; + this.reset.Click += new System.EventHandler(this.reset_Click); + // // DrawCurveOptionsPanel // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); @@ -78,6 +105,7 @@ private System.Windows.Forms.ToolStripLabel seglabel; internal CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown seglen; private System.Windows.Forms.ToolStrip toolstrip; + private System.Windows.Forms.ToolStripButton reset; } } diff --git a/Source/Plugins/BuilderModes/Interface/DrawCurveOptionsPanel.cs b/Source/Plugins/BuilderModes/Interface/DrawCurveOptionsPanel.cs index 4edf455c..e6bf38ec 100644 --- a/Source/Plugins/BuilderModes/Interface/DrawCurveOptionsPanel.cs +++ b/Source/Plugins/BuilderModes/Interface/DrawCurveOptionsPanel.cs @@ -22,9 +22,11 @@ namespace CodeImp.DoomBuilder.BuilderModes public void Register() { General.Interface.AddButton(seglabel); General.Interface.AddButton(seglen); + General.Interface.AddButton(reset); } public void Unregister() { + General.Interface.RemoveButton(reset); General.Interface.RemoveButton(seglen); General.Interface.RemoveButton(seglabel); } @@ -32,5 +34,9 @@ namespace CodeImp.DoomBuilder.BuilderModes private void seglen_ValueChanged(object sender, EventArgs e) { if(!blockEvents && OnValueChanged != null) OnValueChanged(this, EventArgs.Empty); } + + private void reset_Click(object sender, EventArgs e) { + seglen.Value = seglen.Minimum; + } } } diff --git a/Source/Plugins/BuilderModes/Interface/DrawEllipseOptionsPanel.Designer.cs b/Source/Plugins/BuilderModes/Interface/DrawEllipseOptionsPanel.Designer.cs index d5276fa9..d823aaf8 100644 --- a/Source/Plugins/BuilderModes/Interface/DrawEllipseOptionsPanel.Designer.cs +++ b/Source/Plugins/BuilderModes/Interface/DrawEllipseOptionsPanel.Designer.cs @@ -77,7 +77,6 @@ 0, 0, 0}); - this.subdivs.ValueChanged += new System.EventHandler(this.ValueChanged); // // spikinesslabel // @@ -107,7 +106,6 @@ 0, 0, 0}); - this.spikiness.ValueChanged += new System.EventHandler(this.ValueChanged); // // reset // @@ -116,7 +114,7 @@ this.reset.ImageTransparentColor = System.Drawing.Color.Magenta; this.reset.Name = "reset"; this.reset.Size = new System.Drawing.Size(23, 22); - this.reset.Text = "toolStripButton1"; + this.reset.Text = "Reset"; this.reset.Click += new System.EventHandler(this.reset_Click); // // DrawEllipseOptionsPanel diff --git a/Source/Plugins/BuilderModes/Interface/DrawEllipseOptionsPanel.cs b/Source/Plugins/BuilderModes/Interface/DrawEllipseOptionsPanel.cs index 280efe44..5952f6eb 100644 --- a/Source/Plugins/BuilderModes/Interface/DrawEllipseOptionsPanel.cs +++ b/Source/Plugins/BuilderModes/Interface/DrawEllipseOptionsPanel.cs @@ -20,14 +20,14 @@ namespace CodeImp.DoomBuilder.BuilderModes public DrawEllipseOptionsPanel() { InitializeComponent(); + } + public void Register() { spikiness.Value = aquityValue; subdivs.Value = subdivsValue; spikiness.ValueChanged += ValueChanged; subdivs.ValueChanged += ValueChanged; - } - public void Register() { General.Interface.AddButton(subdivslabel); General.Interface.AddButton(subdivs); General.Interface.AddButton(spikinesslabel); diff --git a/Source/Plugins/BuilderModes/Interface/DrawGridOptionsPanel.Designer.cs b/Source/Plugins/BuilderModes/Interface/DrawGridOptionsPanel.Designer.cs index 96fe780e..edaa43d0 100644 --- a/Source/Plugins/BuilderModes/Interface/DrawGridOptionsPanel.Designer.cs +++ b/Source/Plugins/BuilderModes/Interface/DrawGridOptionsPanel.Designer.cs @@ -122,7 +122,7 @@ this.reset.ImageTransparentColor = System.Drawing.Color.Magenta; this.reset.Name = "reset"; this.reset.Size = new System.Drawing.Size(23, 22); - this.reset.Text = "toolStripButton1"; + this.reset.Text = "Reset"; // // cbseparator // diff --git a/Source/Plugins/BuilderModes/Interface/DrawRectangleOptionsPanel.Designer.cs b/Source/Plugins/BuilderModes/Interface/DrawRectangleOptionsPanel.Designer.cs index 0d62b99a..14b3ad12 100644 --- a/Source/Plugins/BuilderModes/Interface/DrawRectangleOptionsPanel.Designer.cs +++ b/Source/Plugins/BuilderModes/Interface/DrawRectangleOptionsPanel.Designer.cs @@ -116,7 +116,7 @@ this.reset.ImageTransparentColor = System.Drawing.Color.Magenta; this.reset.Name = "reset"; this.reset.Size = new System.Drawing.Size(23, 22); - this.reset.Text = "toolStripButton1"; + this.reset.Text = "Reset"; this.reset.Click += new System.EventHandler(this.reset_Click); // // DrawRectangleOptionsPanel diff --git a/Source/Plugins/BuilderModes/Interface/DrawRectangleOptionsPanel.cs b/Source/Plugins/BuilderModes/Interface/DrawRectangleOptionsPanel.cs index 5b0fd8f8..c4fbb581 100644 --- a/Source/Plugins/BuilderModes/Interface/DrawRectangleOptionsPanel.cs +++ b/Source/Plugins/BuilderModes/Interface/DrawRectangleOptionsPanel.cs @@ -20,14 +20,14 @@ namespace CodeImp.DoomBuilder.BuilderModes public DrawRectangleOptionsPanel() { InitializeComponent(); + } + public void Register() { radius.Value = radiusValue; subdivs.Value = subdivsValue; radius.ValueChanged += ValueChanged; subdivs.ValueChanged += ValueChanged; - } - public void Register() { General.Interface.AddButton(radiuslabel); General.Interface.AddButton(radius); General.Interface.AddButton(subdivslabel);