mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
Draw Grid mode: redone the settings panel as a sidebar panel.
This commit is contained in:
parent
540eb2fda8
commit
7e8fc4c013
4 changed files with 220 additions and 240 deletions
|
@ -6,6 +6,7 @@ using System.Drawing;
|
|||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Actions;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.Editing;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
|
@ -37,7 +38,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
private static InterpolationTools.Mode verticalinterpolation = InterpolationTools.Mode.LINEAR;
|
||||
|
||||
private readonly List<DrawnVertex[]> gridpoints;
|
||||
private HintLabel hintLabel;
|
||||
private HintLabel hintlabel;
|
||||
|
||||
private int width;
|
||||
private int height;
|
||||
|
@ -47,7 +48,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
private Vector2D end;
|
||||
|
||||
//interface
|
||||
private readonly DrawGridOptionsPanel panel;
|
||||
private DrawGridOptionsPanel panel;
|
||||
private Docker docker;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -57,13 +59,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
snaptogrid = true;
|
||||
gridpoints = new List<DrawnVertex[]>();
|
||||
|
||||
//Options docker
|
||||
panel = new DrawGridOptionsPanel();
|
||||
panel.MaxHorizontalSlices = (int)General.Map.FormatInterface.MaxCoordinate;
|
||||
panel.MaxVerticalSlices = (int)General.Map.FormatInterface.MaxCoordinate;
|
||||
panel.OnValueChanged += OptionsPanelOnValueChanged;
|
||||
panel.OnGridLockChanged += OptionsPanelOnOnGridLockChanged;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -74,20 +69,34 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
base.OnEngage();
|
||||
|
||||
//setup settings panel
|
||||
// Create and setup settings panel
|
||||
panel = new DrawGridOptionsPanel();
|
||||
panel.MaxHorizontalSlices = (int)General.Map.FormatInterface.MaxCoordinate;
|
||||
panel.MaxVerticalSlices = (int) General.Map.FormatInterface.MaxCoordinate;
|
||||
panel.Triangulate = triangulate;
|
||||
panel.LockToGrid = gridlock;
|
||||
panel.HorizontalSlices = horizontalSlices - 1;
|
||||
panel.VerticalSlices = verticalSlices - 1;
|
||||
panel.HorizontalInterpolationMode = horizontalinterpolation;
|
||||
panel.VerticalInterpolationMode = verticalinterpolation;
|
||||
panel.Register();
|
||||
|
||||
panel.OnValueChanged += OptionsPanelOnValueChanged;
|
||||
panel.OnGridLockChanged += OptionsPanelOnOnGridLockChanged;
|
||||
|
||||
// Add docker
|
||||
docker = new Docker("drawgrid", "Draw Grid", panel);
|
||||
General.Interface.AddDocker(docker);
|
||||
General.Interface.SelectDocker(docker);
|
||||
}
|
||||
|
||||
public override void OnDisengage()
|
||||
{
|
||||
base.OnDisengage();
|
||||
panel.Unregister();
|
||||
|
||||
// Remove docker
|
||||
General.Interface.RemoveDocker(docker);
|
||||
panel.Dispose();
|
||||
panel = null;
|
||||
}
|
||||
|
||||
override public void OnAccept()
|
||||
|
@ -235,13 +244,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
//render hint
|
||||
if (horizontalSlices > 1 || verticalSlices > 1)
|
||||
{
|
||||
hintLabel.Text = "H: " + (slicesH - 1) + "; V: " + (slicesV - 1);
|
||||
if(width > hintLabel.Text.Length * vsize && height > 16 * vsize)
|
||||
hintlabel.Text = "H: " + (slicesH - 1) + "; V: " + (slicesV - 1);
|
||||
if(width > hintlabel.Text.Length * vsize && height > 16 * vsize)
|
||||
{
|
||||
float vPos = start.y + height / 2.0f;
|
||||
hintLabel.Start = new Vector2D(start.x, vPos);
|
||||
hintLabel.End = new Vector2D(end.x, vPos);
|
||||
renderer.RenderText(hintLabel.TextLabel);
|
||||
hintlabel.Start = new Vector2D(start.x, vPos);
|
||||
hintlabel.End = new Vector2D(end.x, vPos);
|
||||
renderer.RenderText(hintlabel.TextLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -276,7 +285,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Add labels
|
||||
labels.AddRange(new[] { new LineLengthLabel(false), new LineLengthLabel(false), new LineLengthLabel(false), new LineLengthLabel(false) });
|
||||
hintLabel = new HintLabel();
|
||||
hintlabel = new HintLabel();
|
||||
Update();
|
||||
}
|
||||
else if(points[0].pos == points[1].pos)
|
||||
|
|
|
@ -28,200 +28,200 @@
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
|
||||
this.sliceshlabel = new System.Windows.Forms.ToolStripLabel();
|
||||
this.slicesH = new CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown();
|
||||
this.slicesvlabel = new System.Windows.Forms.ToolStripLabel();
|
||||
this.slicesV = new CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown();
|
||||
this.reset = new System.Windows.Forms.ToolStripButton();
|
||||
this.cbseparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.interphlabel = new System.Windows.Forms.ToolStripLabel();
|
||||
this.interphmode = new System.Windows.Forms.ToolStripComboBox();
|
||||
this.interpvlabel = new System.Windows.Forms.ToolStripLabel();
|
||||
this.interpvmode = new System.Windows.Forms.ToolStripComboBox();
|
||||
this.cbseparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.gridlock = new CodeImp.DoomBuilder.Controls.ToolStripCheckBox();
|
||||
this.triangulate = new CodeImp.DoomBuilder.Controls.ToolStripCheckBox();
|
||||
this.toolStrip1.SuspendLayout();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.triangulate = new System.Windows.Forms.CheckBox();
|
||||
this.gridlock = new System.Windows.Forms.CheckBox();
|
||||
this.reset = new System.Windows.Forms.Button();
|
||||
this.slicesV = new System.Windows.Forms.NumericUpDown();
|
||||
this.slicesH = new System.Windows.Forms.NumericUpDown();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.interpvmode = new System.Windows.Forms.ComboBox();
|
||||
this.interphmode = new System.Windows.Forms.ComboBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.slicesV)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.slicesH)).BeginInit();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// toolStrip1
|
||||
// groupBox1
|
||||
//
|
||||
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.sliceshlabel,
|
||||
this.slicesH,
|
||||
this.slicesvlabel,
|
||||
this.slicesV,
|
||||
this.reset,
|
||||
this.cbseparator1,
|
||||
this.interphlabel,
|
||||
this.interphmode,
|
||||
this.interpvlabel,
|
||||
this.interpvmode,
|
||||
this.cbseparator2,
|
||||
this.gridlock,
|
||||
this.triangulate});
|
||||
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.toolStrip1.Name = "toolStrip1";
|
||||
this.toolStrip1.Size = new System.Drawing.Size(1000, 25);
|
||||
this.toolStrip1.TabIndex = 8;
|
||||
this.toolStrip1.Text = "toolStrip1";
|
||||
//
|
||||
// sliceshlabel
|
||||
//
|
||||
this.sliceshlabel.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Gear;
|
||||
this.sliceshlabel.Name = "sliceshlabel";
|
||||
this.sliceshlabel.Size = new System.Drawing.Size(89, 22);
|
||||
this.sliceshlabel.Text = "Horiz. Slices:";
|
||||
//
|
||||
// slicesH
|
||||
//
|
||||
this.slicesH.AutoSize = false;
|
||||
this.slicesH.Margin = new System.Windows.Forms.Padding(3, 0, 6, 0);
|
||||
this.slicesH.Maximum = new decimal(new int[] {
|
||||
100,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.slicesH.Minimum = new decimal(new int[] {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.slicesH.Name = "slicesH";
|
||||
this.slicesH.Size = new System.Drawing.Size(46, 20);
|
||||
this.slicesH.Text = "0";
|
||||
this.slicesH.Value = new decimal(new int[] {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.slicesH.ValueChanged += new System.EventHandler(this.ValueChanged);
|
||||
//
|
||||
// slicesvlabel
|
||||
//
|
||||
this.slicesvlabel.Name = "slicesvlabel";
|
||||
this.slicesvlabel.Size = new System.Drawing.Size(66, 22);
|
||||
this.slicesvlabel.Text = "Vert. Slices:";
|
||||
//
|
||||
// slicesV
|
||||
//
|
||||
this.slicesV.AutoSize = false;
|
||||
this.slicesV.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
|
||||
this.slicesV.Maximum = new decimal(new int[] {
|
||||
100,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.slicesV.Minimum = new decimal(new int[] {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.slicesV.Name = "slicesV";
|
||||
this.slicesV.Size = new System.Drawing.Size(46, 20);
|
||||
this.slicesV.Text = "0";
|
||||
this.slicesV.Value = new decimal(new int[] {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.slicesV.ValueChanged += new System.EventHandler(this.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";
|
||||
//
|
||||
// cbseparator1
|
||||
//
|
||||
this.cbseparator1.Name = "cbseparator1";
|
||||
this.cbseparator1.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// interphlabel
|
||||
//
|
||||
this.interphlabel.Name = "interphlabel";
|
||||
this.interphlabel.Size = new System.Drawing.Size(78, 22);
|
||||
this.interphlabel.Text = "Horiz. Interp.:";
|
||||
//
|
||||
// interphmode
|
||||
//
|
||||
this.interphmode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.interphmode.Name = "interphmode";
|
||||
this.interphmode.Size = new System.Drawing.Size(108, 25);
|
||||
this.interphmode.SelectedIndexChanged += new System.EventHandler(this.ValueChanged);
|
||||
this.interphmode.DropDownClosed += new System.EventHandler(this.interpmode_DropDownClosed);
|
||||
//
|
||||
// interpvlabel
|
||||
//
|
||||
this.interpvlabel.Name = "interpvlabel";
|
||||
this.interpvlabel.Size = new System.Drawing.Size(71, 22);
|
||||
this.interpvlabel.Text = "Vert. Interp.:";
|
||||
//
|
||||
// interpvmode
|
||||
//
|
||||
this.interpvmode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.interpvmode.Name = "interpvmode";
|
||||
this.interpvmode.Size = new System.Drawing.Size(108, 25);
|
||||
this.interpvmode.SelectedIndexChanged += new System.EventHandler(this.ValueChanged);
|
||||
this.interpvmode.DropDownClosed += new System.EventHandler(this.interpmode_DropDownClosed);
|
||||
//
|
||||
// cbseparator2
|
||||
//
|
||||
this.cbseparator2.Name = "cbseparator2";
|
||||
this.cbseparator2.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// gridlock
|
||||
//
|
||||
this.gridlock.Checked = false;
|
||||
this.gridlock.Margin = new System.Windows.Forms.Padding(12, 1, 0, 2);
|
||||
this.gridlock.Name = "gridlock";
|
||||
this.gridlock.Size = new System.Drawing.Size(120, 22);
|
||||
this.gridlock.Text = "Lock slices to grid";
|
||||
this.gridlock.CheckedChanged += new System.EventHandler(this.gridlock_CheckedChanged);
|
||||
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.triangulate);
|
||||
this.groupBox1.Controls.Add(this.gridlock);
|
||||
this.groupBox1.Controls.Add(this.reset);
|
||||
this.groupBox1.Controls.Add(this.slicesV);
|
||||
this.groupBox1.Controls.Add(this.slicesH);
|
||||
this.groupBox1.Controls.Add(this.label2);
|
||||
this.groupBox1.Controls.Add(this.label1);
|
||||
this.groupBox1.Location = new System.Drawing.Point(3, 3);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(200, 128);
|
||||
this.groupBox1.TabIndex = 9;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = " Number of slices: ";
|
||||
//
|
||||
// triangulate
|
||||
//
|
||||
this.triangulate.Checked = false;
|
||||
this.triangulate.Margin = new System.Windows.Forms.Padding(3, 1, 0, 2);
|
||||
this.triangulate.AutoSize = true;
|
||||
this.triangulate.Location = new System.Drawing.Point(20, 103);
|
||||
this.triangulate.Name = "triangulate";
|
||||
this.triangulate.Size = new System.Drawing.Size(86, 22);
|
||||
this.triangulate.Size = new System.Drawing.Size(79, 17);
|
||||
this.triangulate.TabIndex = 14;
|
||||
this.triangulate.Text = "Triangulate";
|
||||
this.triangulate.UseVisualStyleBackColor = true;
|
||||
this.triangulate.CheckedChanged += new System.EventHandler(this.ValueChanged);
|
||||
//
|
||||
// gridlock
|
||||
//
|
||||
this.gridlock.AutoSize = true;
|
||||
this.gridlock.Location = new System.Drawing.Point(20, 80);
|
||||
this.gridlock.Name = "gridlock";
|
||||
this.gridlock.Size = new System.Drawing.Size(111, 17);
|
||||
this.gridlock.TabIndex = 13;
|
||||
this.gridlock.Text = "Lock slices to grid";
|
||||
this.gridlock.UseVisualStyleBackColor = true;
|
||||
this.gridlock.CheckedChanged += new System.EventHandler(this.gridlock_CheckedChanged);
|
||||
//
|
||||
// reset
|
||||
//
|
||||
this.reset.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.Reset;
|
||||
this.reset.Location = new System.Drawing.Point(140, 22);
|
||||
this.reset.Name = "reset";
|
||||
this.reset.Size = new System.Drawing.Size(24, 45);
|
||||
this.reset.TabIndex = 10;
|
||||
this.reset.UseVisualStyleBackColor = true;
|
||||
this.reset.Click += new System.EventHandler(this.reset_Click);
|
||||
//
|
||||
// slicesV
|
||||
//
|
||||
this.slicesV.Location = new System.Drawing.Point(77, 47);
|
||||
this.slicesV.Name = "slicesV";
|
||||
this.slicesV.Size = new System.Drawing.Size(57, 20);
|
||||
this.slicesV.TabIndex = 12;
|
||||
this.slicesV.ValueChanged += new System.EventHandler(this.ValueChanged);
|
||||
//
|
||||
// slicesH
|
||||
//
|
||||
this.slicesH.Location = new System.Drawing.Point(77, 22);
|
||||
this.slicesH.Name = "slicesH";
|
||||
this.slicesH.Size = new System.Drawing.Size(57, 20);
|
||||
this.slicesH.TabIndex = 10;
|
||||
this.slicesH.ValueChanged += new System.EventHandler(this.ValueChanged);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(29, 49);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(42, 13);
|
||||
this.label2.TabIndex = 11;
|
||||
this.label2.Text = "Vertical";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(17, 24);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(54, 13);
|
||||
this.label1.TabIndex = 10;
|
||||
this.label1.Text = "Horizontal";
|
||||
//
|
||||
// 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.interpvmode);
|
||||
this.groupBox2.Controls.Add(this.interphmode);
|
||||
this.groupBox2.Controls.Add(this.label3);
|
||||
this.groupBox2.Controls.Add(this.label4);
|
||||
this.groupBox2.Location = new System.Drawing.Point(3, 137);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(200, 82);
|
||||
this.groupBox2.TabIndex = 10;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = " Slices spacing interpolation: ";
|
||||
//
|
||||
// interpvmode
|
||||
//
|
||||
this.interpvmode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.interpvmode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.interpvmode.FormattingEnabled = true;
|
||||
this.interpvmode.Location = new System.Drawing.Point(77, 46);
|
||||
this.interpvmode.Name = "interpvmode";
|
||||
this.interpvmode.Size = new System.Drawing.Size(117, 21);
|
||||
this.interpvmode.TabIndex = 17;
|
||||
this.interpvmode.SelectedIndexChanged += new System.EventHandler(this.ValueChanged);
|
||||
this.interpvmode.DropDownClosed += new System.EventHandler(this.interpmode_DropDownClosed);
|
||||
//
|
||||
// interphmode
|
||||
//
|
||||
this.interphmode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.interphmode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.interphmode.FormattingEnabled = true;
|
||||
this.interphmode.Location = new System.Drawing.Point(77, 19);
|
||||
this.interphmode.Name = "interphmode";
|
||||
this.interphmode.Size = new System.Drawing.Size(117, 21);
|
||||
this.interphmode.TabIndex = 11;
|
||||
this.interphmode.SelectedIndexChanged += new System.EventHandler(this.ValueChanged);
|
||||
this.interphmode.DropDownClosed += new System.EventHandler(this.interpmode_DropDownClosed);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(29, 49);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(42, 13);
|
||||
this.label3.TabIndex = 16;
|
||||
this.label3.Text = "Vertical";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(17, 24);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(54, 13);
|
||||
this.label4.TabIndex = 15;
|
||||
this.label4.Text = "Horizontal";
|
||||
//
|
||||
// DrawGridOptionsPanel
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.Controls.Add(this.toolStrip1);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Name = "DrawGridOptionsPanel";
|
||||
this.Size = new System.Drawing.Size(1000, 60);
|
||||
this.toolStrip1.ResumeLayout(false);
|
||||
this.toolStrip1.PerformLayout();
|
||||
this.Size = new System.Drawing.Size(206, 299);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.slicesV)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.slicesH)).EndInit();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ToolStrip toolStrip1;
|
||||
private System.Windows.Forms.ToolStripLabel sliceshlabel;
|
||||
private CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown slicesH;
|
||||
private System.Windows.Forms.ToolStripLabel slicesvlabel;
|
||||
private CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown slicesV;
|
||||
private System.Windows.Forms.ToolStripButton reset;
|
||||
private System.Windows.Forms.ToolStripSeparator cbseparator1;
|
||||
private CodeImp.DoomBuilder.Controls.ToolStripCheckBox gridlock;
|
||||
private CodeImp.DoomBuilder.Controls.ToolStripCheckBox triangulate;
|
||||
private System.Windows.Forms.ToolStripSeparator cbseparator2;
|
||||
private System.Windows.Forms.ToolStripLabel interpvlabel;
|
||||
private System.Windows.Forms.ToolStripComboBox interpvmode;
|
||||
private System.Windows.Forms.ToolStripLabel interphlabel;
|
||||
private System.Windows.Forms.ToolStripComboBox interphmode;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.CheckBox triangulate;
|
||||
private System.Windows.Forms.CheckBox gridlock;
|
||||
private System.Windows.Forms.Button reset;
|
||||
private System.Windows.Forms.NumericUpDown slicesV;
|
||||
private System.Windows.Forms.NumericUpDown slicesH;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.ComboBox interpvmode;
|
||||
private System.Windows.Forms.ComboBox interphmode;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,13 +8,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
public event EventHandler OnValueChanged;
|
||||
public event EventHandler OnGridLockChanged;
|
||||
private bool blockEvents;
|
||||
private bool blockevents;
|
||||
|
||||
public bool Triangulate { get { return triangulate.Checked; } set { blockEvents = true; triangulate.Checked = value; blockEvents = false; } }
|
||||
public bool LockToGrid { get { return gridlock.Checked; } set { blockEvents = true; gridlock.Checked = value; blockEvents = false; } }
|
||||
public int HorizontalSlices { get { return (int)slicesH.Value; } set { blockEvents = true; slicesH.Value = value; blockEvents = false; } }
|
||||
public bool Triangulate { get { return triangulate.Checked; } set { blockevents = true; triangulate.Checked = value; blockevents = false; } }
|
||||
public bool LockToGrid { get { return gridlock.Checked; } set { blockevents = true; gridlock.Checked = value; blockevents = false; } }
|
||||
public int HorizontalSlices { get { return (int)slicesH.Value; } set { blockevents = true; slicesH.Value = value; blockevents = false; } }
|
||||
public int MaxHorizontalSlices { get { return (int)slicesH.Maximum; } set { slicesH.Maximum = value; } }
|
||||
public int VerticalSlices { get { return (int)slicesV.Value; } set { blockEvents = true; slicesV.Value = value; blockEvents = false; } }
|
||||
public int VerticalSlices { get { return (int)slicesV.Value; } set { blockevents = true; slicesV.Value = value; blockevents = false; } }
|
||||
public int MaxVerticalSlices { get { return (int)slicesV.Maximum; } set { slicesV.Maximum = value; } }
|
||||
public InterpolationTools.Mode HorizontalInterpolationMode
|
||||
{
|
||||
|
@ -32,49 +32,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
InitializeComponent();
|
||||
|
||||
// Fill them menus
|
||||
interphmode.Items.AddRange(new[] { MenusForm.GradientInterpolationModes.Linear, MenusForm.GradientInterpolationModes.EaseInOutSine, MenusForm.GradientInterpolationModes.EaseInSine, MenusForm.GradientInterpolationModes.EaseOutSine });
|
||||
interphmode.Items.AddRange(new object[] { MenusForm.GradientInterpolationModes.Linear, MenusForm.GradientInterpolationModes.EaseInOutSine, MenusForm.GradientInterpolationModes.EaseInSine, MenusForm.GradientInterpolationModes.EaseOutSine });
|
||||
interphmode.SelectedIndex = 0;
|
||||
interpvmode.Items.AddRange(new[] { MenusForm.GradientInterpolationModes.Linear, MenusForm.GradientInterpolationModes.EaseInOutSine, MenusForm.GradientInterpolationModes.EaseInSine, MenusForm.GradientInterpolationModes.EaseOutSine });
|
||||
interpvmode.Items.AddRange(new object[] { MenusForm.GradientInterpolationModes.Linear, MenusForm.GradientInterpolationModes.EaseInOutSine, MenusForm.GradientInterpolationModes.EaseInSine, MenusForm.GradientInterpolationModes.EaseOutSine });
|
||||
interpvmode.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
public void Register()
|
||||
{
|
||||
General.Interface.AddButton(sliceshlabel);
|
||||
General.Interface.AddButton(slicesH);
|
||||
General.Interface.AddButton(slicesvlabel);
|
||||
General.Interface.AddButton(slicesV);
|
||||
General.Interface.AddButton(reset);
|
||||
General.Interface.AddButton(cbseparator1);
|
||||
General.Interface.AddButton(interphlabel);
|
||||
General.Interface.AddButton(interphmode);
|
||||
General.Interface.AddButton(interpvlabel);
|
||||
General.Interface.AddButton(interpvmode);
|
||||
General.Interface.AddButton(cbseparator2);
|
||||
General.Interface.AddButton(gridlock);
|
||||
General.Interface.AddButton(triangulate);
|
||||
}
|
||||
|
||||
public void Unregister()
|
||||
{
|
||||
General.Interface.RemoveButton(triangulate);
|
||||
General.Interface.RemoveButton(gridlock);
|
||||
General.Interface.RemoveButton(cbseparator2);
|
||||
General.Interface.RemoveButton(interpvmode);
|
||||
General.Interface.RemoveButton(interpvlabel);
|
||||
General.Interface.RemoveButton(interphmode);
|
||||
General.Interface.RemoveButton(interphlabel);
|
||||
General.Interface.RemoveButton(cbseparator1);
|
||||
General.Interface.RemoveButton(reset);
|
||||
General.Interface.RemoveButton(slicesV);
|
||||
General.Interface.RemoveButton(slicesvlabel);
|
||||
General.Interface.RemoveButton(slicesH);
|
||||
General.Interface.RemoveButton(sliceshlabel);
|
||||
}
|
||||
|
||||
private void ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if(!blockEvents && OnValueChanged != null) OnValueChanged(this, EventArgs.Empty);
|
||||
if(!blockevents && OnValueChanged != null) OnValueChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void gridlock_CheckedChanged(object sender, EventArgs e)
|
||||
|
@ -82,11 +48,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
slicesH.Enabled = !gridlock.Checked;
|
||||
slicesV.Enabled = !gridlock.Checked;
|
||||
interpvmode.Enabled = !gridlock.Checked;
|
||||
interpvlabel.Enabled = !gridlock.Checked;
|
||||
interphmode.Enabled = !gridlock.Checked;
|
||||
interphlabel.Enabled = !gridlock.Checked;
|
||||
reset.Enabled = !gridlock.Checked;
|
||||
if(!blockEvents && OnGridLockChanged != null) OnGridLockChanged(this, EventArgs.Empty);
|
||||
|
||||
if(!blockevents && OnGridLockChanged != null) OnGridLockChanged(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void interpmode_DropDownClosed(object sender, EventArgs e)
|
||||
|
@ -94,5 +59,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
General.Interface.FocusDisplay();
|
||||
}
|
||||
|
||||
private void reset_Click(object sender, EventArgs e)
|
||||
{
|
||||
blockevents = true;
|
||||
slicesH.Value = 3;
|
||||
slicesV.Value = 3;
|
||||
blockevents = false;
|
||||
|
||||
if(OnValueChanged != null) OnValueChanged(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,7 +117,4 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
Loading…
Reference in a new issue