mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-23 04:11:41 +00:00
Add "Place Things" option to curve, ellipse and rectangle drawing modes
This commit is contained in:
parent
925c50bfd3
commit
5f408e2c6e
10 changed files with 128 additions and 11 deletions
|
@ -237,7 +237,27 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the drawing
|
// Make the drawing
|
||||||
if(Tools.DrawLines(verts, true, BuilderPlug.Me.AutoAlignTextureOffsetsOnCreate)) //mxd
|
if (drawthingsatvertices)
|
||||||
|
{
|
||||||
|
List<Vector2D> points = new List<Vector2D>();
|
||||||
|
for (int i = 0; i < verts.Count; i++)
|
||||||
|
if (!points.Contains(verts[i].pos)) points.Add(verts[i].pos);
|
||||||
|
|
||||||
|
PlaceThingsAtPositions(points);
|
||||||
|
|
||||||
|
// Snap to map format accuracy
|
||||||
|
General.Map.Map.SnapAllToAccuracy();
|
||||||
|
|
||||||
|
// Clear selection
|
||||||
|
General.Map.Map.ClearAllSelected();
|
||||||
|
|
||||||
|
// Update cached values
|
||||||
|
General.Map.Map.Update();
|
||||||
|
|
||||||
|
// Map is changed
|
||||||
|
General.Map.IsChanged = true;
|
||||||
|
}
|
||||||
|
else if (Tools.DrawLines(verts, true, BuilderPlug.Me.AutoAlignTextureOffsetsOnCreate)) //mxd
|
||||||
{
|
{
|
||||||
// Snap to map format accuracy
|
// Snap to map format accuracy
|
||||||
General.Map.Map.SnapAllToAccuracy();
|
General.Map.Map.SnapAllToAccuracy();
|
||||||
|
|
|
@ -69,11 +69,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
panel.OnContinuousDrawingChanged += OnContinuousDrawingChanged;
|
panel.OnContinuousDrawingChanged += OnContinuousDrawingChanged;
|
||||||
panel.OnShowGuidelinesChanged += OnShowGuidelinesChanged;
|
panel.OnShowGuidelinesChanged += OnShowGuidelinesChanged;
|
||||||
panel.OnRadialDrawingChanged += OnRadialDrawingChanged;
|
panel.OnRadialDrawingChanged += OnRadialDrawingChanged;
|
||||||
|
panel.OnDrawThingsAtVerticesChanged += OnDrawThingsAtVerticesChanged;
|
||||||
|
|
||||||
// Needs to be set after adding the OnContinuousDrawingChanged event...
|
// Needs to be set after adding the OnContinuousDrawingChanged event...
|
||||||
panel.ContinuousDrawing = General.Settings.ReadPluginSetting("drawellipsemode.continuousdrawing", false);
|
panel.ContinuousDrawing = General.Settings.ReadPluginSetting("drawellipsemode.continuousdrawing", false);
|
||||||
panel.ShowGuidelines = General.Settings.ReadPluginSetting("drawellipsemode.showguidelines", false);
|
panel.ShowGuidelines = General.Settings.ReadPluginSetting("drawellipsemode.showguidelines", false);
|
||||||
panel.RadialDrawing = General.Settings.ReadPluginSetting("drawellipsemode.radialdrawing", false);
|
panel.RadialDrawing = General.Settings.ReadPluginSetting("drawellipsemode.radialdrawing", false);
|
||||||
|
panel.DrawThingsAtVertices = General.Settings.ReadPluginSetting("drawthingsatvertices.drawthingsatvertices", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
override protected void AddInterface()
|
override protected void AddInterface()
|
||||||
|
|
|
@ -65,6 +65,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
protected bool autoclosedrawing; //mxd. Finish drawing when new points and existing geometry form a closed shape
|
protected bool autoclosedrawing; //mxd. Finish drawing when new points and existing geometry form a closed shape
|
||||||
protected bool drawingautoclosed; //mxd
|
protected bool drawingautoclosed; //mxd
|
||||||
protected bool showguidelines; //mxd
|
protected bool showguidelines; //mxd
|
||||||
|
protected bool drawthingsatvertices; //sphere: place things at vertices?
|
||||||
|
|
||||||
//mxd. Map area bounds
|
//mxd. Map area bounds
|
||||||
private Line2D top, bottom, left, right;
|
private Line2D top, bottom, left, right;
|
||||||
|
@ -953,6 +954,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
General.Interface.RedrawDisplay();
|
General.Interface.RedrawDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void OnDrawThingsAtVerticesChanged(object value, EventArgs e)
|
||||||
|
{
|
||||||
|
drawthingsatvertices = (bool)value;
|
||||||
|
General.Interface.RedrawDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ================== Actions
|
#region ================== Actions
|
||||||
|
|
|
@ -104,11 +104,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
panel.OnContinuousDrawingChanged += OnContinuousDrawingChanged;
|
panel.OnContinuousDrawingChanged += OnContinuousDrawingChanged;
|
||||||
panel.OnShowGuidelinesChanged += OnShowGuidelinesChanged;
|
panel.OnShowGuidelinesChanged += OnShowGuidelinesChanged;
|
||||||
panel.OnRadialDrawingChanged += OnRadialDrawingChanged;
|
panel.OnRadialDrawingChanged += OnRadialDrawingChanged;
|
||||||
|
panel.OnDrawThingsAtVerticesChanged += OnDrawThingsAtVerticesChanged;
|
||||||
|
|
||||||
// Needs to be set after adding the OnContinuousDrawingChanged event...
|
// Needs to be set after adding the OnContinuousDrawingChanged event...
|
||||||
panel.ContinuousDrawing = General.Settings.ReadPluginSetting("drawrectanglemode.continuousdrawing", false);
|
panel.ContinuousDrawing = General.Settings.ReadPluginSetting("drawrectanglemode.continuousdrawing", false);
|
||||||
panel.ShowGuidelines = General.Settings.ReadPluginSetting("drawrectanglemode.showguidelines", false);
|
panel.ShowGuidelines = General.Settings.ReadPluginSetting("drawrectanglemode.showguidelines", false);
|
||||||
panel.RadialDrawing = General.Settings.ReadPluginSetting("drawrectanglemode.radialdrawing", false);
|
panel.RadialDrawing = General.Settings.ReadPluginSetting("drawrectanglemode.radialdrawing", false);
|
||||||
|
panel.DrawThingsAtVertices = General.Settings.ReadPluginSetting("drawthingsatvertices.drawthingsatvertices", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void AddInterface()
|
protected override void AddInterface()
|
||||||
|
@ -124,6 +126,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
General.Settings.WritePluginSetting("drawrectanglemode.continuousdrawing", panel.ContinuousDrawing);
|
General.Settings.WritePluginSetting("drawrectanglemode.continuousdrawing", panel.ContinuousDrawing);
|
||||||
General.Settings.WritePluginSetting("drawrectanglemode.showguidelines", panel.ShowGuidelines);
|
General.Settings.WritePluginSetting("drawrectanglemode.showguidelines", panel.ShowGuidelines);
|
||||||
General.Settings.WritePluginSetting("drawrectanglemode.radialdrawing", panel.RadialDrawing);
|
General.Settings.WritePluginSetting("drawrectanglemode.radialdrawing", panel.RadialDrawing);
|
||||||
|
General.Settings.WritePluginSetting("drawrectanglemode.drawthingsatvertices", panel.DrawThingsAtVertices);
|
||||||
|
|
||||||
// Remove the buttons
|
// Remove the buttons
|
||||||
panel.Unregister();
|
panel.Unregister();
|
||||||
|
@ -440,7 +443,27 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
General.Interface.DisplayStatus(StatusType.Action, "Created " + a + word + " " + shapename + ".");
|
General.Interface.DisplayStatus(StatusType.Action, "Created " + a + word + " " + shapename + ".");
|
||||||
|
|
||||||
// Make the drawing
|
// Make the drawing
|
||||||
if(Tools.DrawLines(points, true, BuilderPlug.Me.AutoAlignTextureOffsetsOnCreate))
|
if (drawthingsatvertices)
|
||||||
|
{
|
||||||
|
List<Vector2D> verts = new List<Vector2D>();
|
||||||
|
for (int i = 0; i < points.Count; i++)
|
||||||
|
if (!verts.Contains(new Vector2D(points[i].pos.x, points[i].pos.y))) verts.Add(new Vector2D(points[i].pos.x, points[i].pos.y));
|
||||||
|
|
||||||
|
PlaceThingsAtPositions(verts);
|
||||||
|
|
||||||
|
// Snap to map format accuracy
|
||||||
|
General.Map.Map.SnapAllToAccuracy();
|
||||||
|
|
||||||
|
// Clear selection
|
||||||
|
General.Map.Map.ClearAllSelected();
|
||||||
|
|
||||||
|
// Update cached values
|
||||||
|
General.Map.Map.Update();
|
||||||
|
|
||||||
|
// Map is changed
|
||||||
|
General.Map.IsChanged = true;
|
||||||
|
}
|
||||||
|
else if (Tools.DrawLines(points, true, BuilderPlug.Me.AutoAlignTextureOffsetsOnCreate))
|
||||||
{
|
{
|
||||||
// Snap to map format accuracy
|
// Snap to map format accuracy
|
||||||
General.Map.Map.SnapAllToAccuracy();
|
General.Map.Map.SnapAllToAccuracy();
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
this.toolstrip = new System.Windows.Forms.ToolStrip();
|
this.toolstrip = new System.Windows.Forms.ToolStrip();
|
||||||
this.continuousdrawing = new System.Windows.Forms.ToolStripButton();
|
this.continuousdrawing = new System.Windows.Forms.ToolStripButton();
|
||||||
this.autoclosedrawing = new System.Windows.Forms.ToolStripButton();
|
this.autoclosedrawing = new System.Windows.Forms.ToolStripButton();
|
||||||
|
this.drawthingsatvertices = new System.Windows.Forms.ToolStripButton();
|
||||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.seglabel = new System.Windows.Forms.ToolStripLabel();
|
this.seglabel = new System.Windows.Forms.ToolStripLabel();
|
||||||
this.seglen = new CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown();
|
this.seglen = new CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown();
|
||||||
|
@ -43,6 +44,7 @@
|
||||||
this.toolstrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.toolstrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.continuousdrawing,
|
this.continuousdrawing,
|
||||||
this.autoclosedrawing,
|
this.autoclosedrawing,
|
||||||
|
this.drawthingsatvertices,
|
||||||
this.toolStripSeparator1,
|
this.toolStripSeparator1,
|
||||||
this.seglabel,
|
this.seglabel,
|
||||||
this.seglen,
|
this.seglen,
|
||||||
|
@ -74,6 +76,16 @@
|
||||||
this.autoclosedrawing.Text = "Auto-close drawing";
|
this.autoclosedrawing.Text = "Auto-close drawing";
|
||||||
this.autoclosedrawing.CheckedChanged += new System.EventHandler(this.autoclosedrawing_CheckedChanged);
|
this.autoclosedrawing.CheckedChanged += new System.EventHandler(this.autoclosedrawing_CheckedChanged);
|
||||||
//
|
//
|
||||||
|
// drawthingsatvertices
|
||||||
|
//
|
||||||
|
this.drawthingsatvertices.CheckOnClick = true;
|
||||||
|
this.drawthingsatvertices.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.PlaceThings;
|
||||||
|
this.drawthingsatvertices.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||||
|
this.drawthingsatvertices.Name = "drawthingsatvertices";
|
||||||
|
this.drawthingsatvertices.Size = new System.Drawing.Size(135, 22);
|
||||||
|
this.drawthingsatvertices.Text = "Place things";
|
||||||
|
this.drawthingsatvertices.CheckedChanged += new System.EventHandler(this.drawthingsatvertices_CheckedChanged);
|
||||||
|
//
|
||||||
// toolStripSeparator1
|
// toolStripSeparator1
|
||||||
//
|
//
|
||||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||||
|
@ -142,6 +154,6 @@
|
||||||
private System.Windows.Forms.ToolStripButton continuousdrawing;
|
private System.Windows.Forms.ToolStripButton continuousdrawing;
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||||
private System.Windows.Forms.ToolStripButton autoclosedrawing;
|
private System.Windows.Forms.ToolStripButton autoclosedrawing;
|
||||||
|
private System.Windows.Forms.ToolStripButton drawthingsatvertices;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,11 +8,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public event EventHandler OnValueChanged;
|
public event EventHandler OnValueChanged;
|
||||||
public event EventHandler OnContinuousDrawingChanged;
|
public event EventHandler OnContinuousDrawingChanged;
|
||||||
public event EventHandler OnAutoCloseDrawingChanged;
|
public event EventHandler OnAutoCloseDrawingChanged;
|
||||||
|
public event EventHandler OnDrawThingsAtVerticesChanged;
|
||||||
private bool blockevents;
|
private bool blockevents;
|
||||||
|
|
||||||
public int SegmentLength { get { return (int)seglen.Value; } set { blockevents = true; seglen.Value = value; blockevents = false; } }
|
public int SegmentLength { get { return (int)seglen.Value; } set { blockevents = true; seglen.Value = value; blockevents = false; } }
|
||||||
public bool ContinuousDrawing { get { return continuousdrawing.Checked; } set { continuousdrawing.Checked = value; } }
|
public bool ContinuousDrawing { get { return continuousdrawing.Checked; } set { continuousdrawing.Checked = value; } }
|
||||||
public bool AutoCloseDrawing { get { return autoclosedrawing.Checked; } set { autoclosedrawing.Checked = value; } }
|
public bool AutoCloseDrawing { get { return autoclosedrawing.Checked; } set { autoclosedrawing.Checked = value; } }
|
||||||
|
public bool DrawThingsAtVertices { get { return drawthingsatvertices.Checked; } set { drawthingsatvertices.Checked = value; } }
|
||||||
|
|
||||||
public DrawCurveOptionsPanel(int minLength, int maxLength)
|
public DrawCurveOptionsPanel(int minLength, int maxLength)
|
||||||
{
|
{
|
||||||
|
@ -29,6 +31,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
General.Interface.BeginToolbarUpdate();
|
General.Interface.BeginToolbarUpdate();
|
||||||
General.Interface.AddButton(continuousdrawing);
|
General.Interface.AddButton(continuousdrawing);
|
||||||
General.Interface.AddButton(autoclosedrawing);
|
General.Interface.AddButton(autoclosedrawing);
|
||||||
|
General.Interface.AddButton(drawthingsatvertices);
|
||||||
General.Interface.AddButton(toolStripSeparator1);
|
General.Interface.AddButton(toolStripSeparator1);
|
||||||
General.Interface.AddButton(seglabel);
|
General.Interface.AddButton(seglabel);
|
||||||
General.Interface.AddButton(seglen);
|
General.Interface.AddButton(seglen);
|
||||||
|
@ -43,6 +46,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
General.Interface.RemoveButton(seglen);
|
General.Interface.RemoveButton(seglen);
|
||||||
General.Interface.RemoveButton(seglabel);
|
General.Interface.RemoveButton(seglabel);
|
||||||
General.Interface.RemoveButton(toolStripSeparator1);
|
General.Interface.RemoveButton(toolStripSeparator1);
|
||||||
|
General.Interface.RemoveButton(drawthingsatvertices);
|
||||||
General.Interface.RemoveButton(autoclosedrawing);
|
General.Interface.RemoveButton(autoclosedrawing);
|
||||||
General.Interface.RemoveButton(continuousdrawing);
|
General.Interface.RemoveButton(continuousdrawing);
|
||||||
General.Interface.EndToolbarUpdate();
|
General.Interface.EndToolbarUpdate();
|
||||||
|
@ -67,5 +71,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
{
|
{
|
||||||
if(OnAutoCloseDrawingChanged != null) OnAutoCloseDrawingChanged(autoclosedrawing.Checked, EventArgs.Empty);
|
if(OnAutoCloseDrawingChanged != null) OnAutoCloseDrawingChanged(autoclosedrawing.Checked, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void drawthingsatvertices_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (OnDrawThingsAtVerticesChanged != null) OnDrawThingsAtVerticesChanged(drawthingsatvertices.Checked, EventArgs.Empty);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
|
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
|
||||||
this.continuousdrawing = new System.Windows.Forms.ToolStripButton();
|
this.continuousdrawing = new System.Windows.Forms.ToolStripButton();
|
||||||
this.radialdrawing = new System.Windows.Forms.ToolStripButton();
|
this.radialdrawing = new System.Windows.Forms.ToolStripButton();
|
||||||
|
this.drawthingsatvertices = new System.Windows.Forms.ToolStripButton();
|
||||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.subdivslabel = new System.Windows.Forms.ToolStripLabel();
|
this.subdivslabel = new System.Windows.Forms.ToolStripLabel();
|
||||||
this.subdivs = new CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown();
|
this.subdivs = new CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown();
|
||||||
|
@ -49,6 +50,7 @@
|
||||||
this.continuousdrawing,
|
this.continuousdrawing,
|
||||||
this.showguidelines,
|
this.showguidelines,
|
||||||
this.radialdrawing,
|
this.radialdrawing,
|
||||||
|
this.drawthingsatvertices,
|
||||||
this.toolStripSeparator1,
|
this.toolStripSeparator1,
|
||||||
this.subdivslabel,
|
this.subdivslabel,
|
||||||
this.subdivs,
|
this.subdivs,
|
||||||
|
@ -73,6 +75,16 @@
|
||||||
this.continuousdrawing.Text = "Continuous drawing";
|
this.continuousdrawing.Text = "Continuous drawing";
|
||||||
this.continuousdrawing.CheckedChanged += new System.EventHandler(this.continuousdrawing_CheckedChanged);
|
this.continuousdrawing.CheckedChanged += new System.EventHandler(this.continuousdrawing_CheckedChanged);
|
||||||
//
|
//
|
||||||
|
// drawthingsatvertices
|
||||||
|
//
|
||||||
|
this.drawthingsatvertices.CheckOnClick = true;
|
||||||
|
this.drawthingsatvertices.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.PlaceThings;
|
||||||
|
this.drawthingsatvertices.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||||
|
this.drawthingsatvertices.Name = "drawthingsatvertices";
|
||||||
|
this.drawthingsatvertices.Size = new System.Drawing.Size(135, 22);
|
||||||
|
this.drawthingsatvertices.Text = "Place things";
|
||||||
|
this.drawthingsatvertices.CheckedChanged += new System.EventHandler(this.drawthingsatvertices_CheckedChanged);
|
||||||
|
//
|
||||||
// toolStripSeparator1
|
// toolStripSeparator1
|
||||||
//
|
//
|
||||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||||
|
@ -225,5 +237,6 @@
|
||||||
private System.Windows.Forms.ToolStripLabel anglelabel;
|
private System.Windows.Forms.ToolStripLabel anglelabel;
|
||||||
private CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown angle;
|
private CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown angle;
|
||||||
private System.Windows.Forms.ToolStripButton showguidelines;
|
private System.Windows.Forms.ToolStripButton showguidelines;
|
||||||
|
private System.Windows.Forms.ToolStripButton drawthingsatvertices;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public event EventHandler OnContinuousDrawingChanged;
|
public event EventHandler OnContinuousDrawingChanged;
|
||||||
public event EventHandler OnShowGuidelinesChanged;
|
public event EventHandler OnShowGuidelinesChanged;
|
||||||
public event EventHandler OnRadialDrawingChanged;
|
public event EventHandler OnRadialDrawingChanged;
|
||||||
|
public event EventHandler OnDrawThingsAtVerticesChanged;
|
||||||
|
|
||||||
private bool blockevents;
|
private bool blockevents;
|
||||||
|
|
||||||
|
@ -22,6 +23,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public bool ContinuousDrawing { get { return continuousdrawing.Checked; } set { continuousdrawing.Checked = value; } }
|
public bool ContinuousDrawing { get { return continuousdrawing.Checked; } set { continuousdrawing.Checked = value; } }
|
||||||
public bool ShowGuidelines { get { return showguidelines.Checked; } set { showguidelines.Checked = value; } }
|
public bool ShowGuidelines { get { return showguidelines.Checked; } set { showguidelines.Checked = value; } }
|
||||||
public bool RadialDrawing { get { return radialdrawing.Checked; } set { radialdrawing.Checked = value; } }
|
public bool RadialDrawing { get { return radialdrawing.Checked; } set { radialdrawing.Checked = value; } }
|
||||||
|
public bool DrawThingsAtVertices { get { return drawthingsatvertices.Checked; } set { drawthingsatvertices.Checked = value; } }
|
||||||
|
|
||||||
public DrawEllipseOptionsPanel()
|
public DrawEllipseOptionsPanel()
|
||||||
{
|
{
|
||||||
|
@ -38,6 +40,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
General.Interface.AddButton(continuousdrawing);
|
General.Interface.AddButton(continuousdrawing);
|
||||||
General.Interface.AddButton(showguidelines);
|
General.Interface.AddButton(showguidelines);
|
||||||
General.Interface.AddButton(radialdrawing);
|
General.Interface.AddButton(radialdrawing);
|
||||||
|
General.Interface.AddButton(drawthingsatvertices);
|
||||||
General.Interface.AddButton(toolStripSeparator1);
|
General.Interface.AddButton(toolStripSeparator1);
|
||||||
General.Interface.AddButton(subdivslabel);
|
General.Interface.AddButton(subdivslabel);
|
||||||
General.Interface.AddButton(subdivs);
|
General.Interface.AddButton(subdivs);
|
||||||
|
@ -63,6 +66,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
General.Interface.RemoveButton(showguidelines);
|
General.Interface.RemoveButton(showguidelines);
|
||||||
General.Interface.RemoveButton(continuousdrawing);
|
General.Interface.RemoveButton(continuousdrawing);
|
||||||
General.Interface.RemoveButton(radialdrawing);
|
General.Interface.RemoveButton(radialdrawing);
|
||||||
|
General.Interface.RemoveButton(drawthingsatvertices);
|
||||||
General.Interface.EndToolbarUpdate();
|
General.Interface.EndToolbarUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,5 +102,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
{
|
{
|
||||||
if(OnRadialDrawingChanged != null) OnRadialDrawingChanged(radialdrawing.Checked, EventArgs.Empty);
|
if(OnRadialDrawingChanged != null) OnRadialDrawingChanged(radialdrawing.Checked, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void drawthingsatvertices_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (OnDrawThingsAtVerticesChanged != null) OnDrawThingsAtVerticesChanged(drawthingsatvertices.Checked, EventArgs.Empty);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
this.continuousdrawing = new System.Windows.Forms.ToolStripButton();
|
this.continuousdrawing = new System.Windows.Forms.ToolStripButton();
|
||||||
this.showguidelines = new System.Windows.Forms.ToolStripButton();
|
this.showguidelines = new System.Windows.Forms.ToolStripButton();
|
||||||
this.radialdrawing = new System.Windows.Forms.ToolStripButton();
|
this.radialdrawing = new System.Windows.Forms.ToolStripButton();
|
||||||
|
this.drawthingsatvertices = new System.Windows.Forms.ToolStripButton();
|
||||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.radiuslabel = new System.Windows.Forms.ToolStripLabel();
|
this.radiuslabel = new System.Windows.Forms.ToolStripLabel();
|
||||||
this.radius = new CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown();
|
this.radius = new CodeImp.DoomBuilder.Controls.ToolStripNumericUpDown();
|
||||||
|
@ -47,6 +48,7 @@
|
||||||
this.continuousdrawing,
|
this.continuousdrawing,
|
||||||
this.showguidelines,
|
this.showguidelines,
|
||||||
this.radialdrawing,
|
this.radialdrawing,
|
||||||
|
this.drawthingsatvertices,
|
||||||
this.toolStripSeparator1,
|
this.toolStripSeparator1,
|
||||||
this.radiuslabel,
|
this.radiuslabel,
|
||||||
this.radius,
|
this.radius,
|
||||||
|
@ -69,6 +71,16 @@
|
||||||
this.continuousdrawing.Text = "Continuous drawing";
|
this.continuousdrawing.Text = "Continuous drawing";
|
||||||
this.continuousdrawing.CheckedChanged += new System.EventHandler(this.continuousdrawing_CheckedChanged);
|
this.continuousdrawing.CheckedChanged += new System.EventHandler(this.continuousdrawing_CheckedChanged);
|
||||||
//
|
//
|
||||||
|
// drawthingsatvertices
|
||||||
|
//
|
||||||
|
this.drawthingsatvertices.CheckOnClick = true;
|
||||||
|
this.drawthingsatvertices.Image = global::CodeImp.DoomBuilder.BuilderModes.Properties.Resources.PlaceThings;
|
||||||
|
this.drawthingsatvertices.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||||
|
this.drawthingsatvertices.Name = "drawthingsatvertices";
|
||||||
|
this.drawthingsatvertices.Size = new System.Drawing.Size(135, 22);
|
||||||
|
this.drawthingsatvertices.Text = "Place things";
|
||||||
|
this.drawthingsatvertices.CheckedChanged += new System.EventHandler(this.drawthingsatvertices_CheckedChanged);
|
||||||
|
//
|
||||||
// showguidelines
|
// showguidelines
|
||||||
//
|
//
|
||||||
this.showguidelines.CheckOnClick = true;
|
this.showguidelines.CheckOnClick = true;
|
||||||
|
@ -190,5 +202,6 @@
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||||
private System.Windows.Forms.ToolStripButton showguidelines;
|
private System.Windows.Forms.ToolStripButton showguidelines;
|
||||||
private System.Windows.Forms.ToolStripButton radialdrawing;
|
private System.Windows.Forms.ToolStripButton radialdrawing;
|
||||||
|
private System.Windows.Forms.ToolStripButton drawthingsatvertices;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public event EventHandler OnContinuousDrawingChanged;
|
public event EventHandler OnContinuousDrawingChanged;
|
||||||
public event EventHandler OnShowGuidelinesChanged;
|
public event EventHandler OnShowGuidelinesChanged;
|
||||||
public event EventHandler OnRadialDrawingChanged;
|
public event EventHandler OnRadialDrawingChanged;
|
||||||
|
public event EventHandler OnDrawThingsAtVerticesChanged;
|
||||||
|
|
||||||
private bool blockevents;
|
private bool blockevents;
|
||||||
|
|
||||||
|
@ -21,6 +22,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public bool ContinuousDrawing { get { return continuousdrawing.Checked; } set { continuousdrawing.Checked = value; } }
|
public bool ContinuousDrawing { get { return continuousdrawing.Checked; } set { continuousdrawing.Checked = value; } }
|
||||||
public bool ShowGuidelines { get { return showguidelines.Checked; } set { showguidelines.Checked = value; } }
|
public bool ShowGuidelines { get { return showguidelines.Checked; } set { showguidelines.Checked = value; } }
|
||||||
public bool RadialDrawing { get { return radialdrawing.Checked; } set { radialdrawing.Checked = value; } }
|
public bool RadialDrawing { get { return radialdrawing.Checked; } set { radialdrawing.Checked = value; } }
|
||||||
|
public bool DrawThingsAtVertices { get { return drawthingsatvertices.Checked; } set { drawthingsatvertices.Checked = value; } }
|
||||||
|
|
||||||
public DrawRectangleOptionsPanel()
|
public DrawRectangleOptionsPanel()
|
||||||
{
|
{
|
||||||
|
@ -36,6 +38,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
General.Interface.AddButton(continuousdrawing);
|
General.Interface.AddButton(continuousdrawing);
|
||||||
General.Interface.AddButton(showguidelines);
|
General.Interface.AddButton(showguidelines);
|
||||||
General.Interface.AddButton(radialdrawing);
|
General.Interface.AddButton(radialdrawing);
|
||||||
|
General.Interface.AddButton(drawthingsatvertices);
|
||||||
General.Interface.AddButton(toolStripSeparator1);
|
General.Interface.AddButton(toolStripSeparator1);
|
||||||
General.Interface.AddButton(radiuslabel);
|
General.Interface.AddButton(radiuslabel);
|
||||||
General.Interface.AddButton(radius);
|
General.Interface.AddButton(radius);
|
||||||
|
@ -55,6 +58,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
General.Interface.RemoveButton(radiuslabel);
|
General.Interface.RemoveButton(radiuslabel);
|
||||||
General.Interface.RemoveButton(toolStripSeparator1);
|
General.Interface.RemoveButton(toolStripSeparator1);
|
||||||
General.Interface.RemoveButton(showguidelines);
|
General.Interface.RemoveButton(showguidelines);
|
||||||
|
General.Interface.RemoveButton(drawthingsatvertices);
|
||||||
General.Interface.RemoveButton(continuousdrawing);
|
General.Interface.RemoveButton(continuousdrawing);
|
||||||
General.Interface.RemoveButton(radialdrawing);
|
General.Interface.RemoveButton(radialdrawing);
|
||||||
General.Interface.EndToolbarUpdate();
|
General.Interface.EndToolbarUpdate();
|
||||||
|
@ -91,5 +95,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
{
|
{
|
||||||
if(OnRadialDrawingChanged != null) OnRadialDrawingChanged(radialdrawing.Checked, EventArgs.Empty);
|
if(OnRadialDrawingChanged != null) OnRadialDrawingChanged(radialdrawing.Checked, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void drawthingsatvertices_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (OnDrawThingsAtVerticesChanged != null) OnDrawThingsAtVerticesChanged(drawthingsatvertices.Checked, EventArgs.Empty);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue