mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 20:32:34 +00:00
9632ecd0d2
Fixed, general interlace: in some cases "Show Editable Vertices in Visual Mode" top toolbar button showed up when using Doom/Hexen map formats. Fixed(?), Classic modes: probably fixed an rare issue when map element dragging was not starting when supposed to.
58 lines
1.8 KiB
C#
58 lines
1.8 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace CodeImp.DoomBuilder.BuilderModes
|
|
{
|
|
internal partial class DrawCurveOptionsPanel : UserControl
|
|
{
|
|
public event EventHandler OnValueChanged;
|
|
public event EventHandler OnContinuousDrawingChanged;
|
|
private bool blockevents;
|
|
|
|
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 DrawCurveOptionsPanel(int minLength, int maxLength)
|
|
{
|
|
InitializeComponent();
|
|
|
|
seglen.Minimum = minLength;
|
|
seglen.Maximum = maxLength;
|
|
}
|
|
|
|
private DrawCurveOptionsPanel() { InitializeComponent(); }
|
|
|
|
public void Register()
|
|
{
|
|
General.Interface.AddButton(continuousdrawing);
|
|
General.Interface.AddButton(toolStripSeparator1);
|
|
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);
|
|
General.Interface.RemoveButton(toolStripSeparator1);
|
|
General.Interface.RemoveButton(continuousdrawing);
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
private void continuousdrawing_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if(OnContinuousDrawingChanged != null) OnContinuousDrawingChanged(continuousdrawing.Checked, EventArgs.Empty);
|
|
}
|
|
}
|
|
}
|