mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-30 07:31:36 +00:00
23d2a27dec
Added, Draw Line and Draw Curve modes: added "Auto-finish drawing" setting. When enabled, the modes will automatically finish drawing when currently drawn lines and already existing level geometry form a closed shape. Changed: sector-wise linedef flipping is now done using the new "Align Linedefs" action. "Flip Linedefs" action works the same as in DB2 again. Changed: when a map was already loaded, using "Open Map" action will use that map's directory as the starting directory. Changed: official IWADs can no longer be saved. Changed: disabled lump ranges/duplicate entries checks for official IWADs. Changed: wad type is now preserved when saving a map (previously all wads were saved as PWADs). Changed: moved Updater.exe launch much closer to the editor termination point to avoid any chance of it closing the editor before it properly closes itself. Updated ZDoom_DECORATE.cfg (A_Blast). Updated documentation.
67 lines
2.2 KiB
C#
67 lines
2.2 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;
|
|
public event EventHandler OnAutoCloseDrawingChanged;
|
|
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 bool AutoCloseDrawing { get { return autoclosedrawing.Checked; } set { autoclosedrawing.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(autoclosedrawing);
|
|
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(autoclosedrawing);
|
|
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);
|
|
}
|
|
|
|
private void autoclosedrawing_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
if(OnAutoCloseDrawingChanged != null) OnAutoCloseDrawingChanged(autoclosedrawing.Checked, EventArgs.Empty);
|
|
}
|
|
}
|
|
}
|