2012-06-19 13:12:28 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using CodeImp.DoomBuilder.BuilderModes.ClassicModes;
|
2014-10-22 13:07:17 +00:00
|
|
|
|
using CodeImp.DoomBuilder.Windows;
|
2012-06-19 13:12:28 +00:00
|
|
|
|
|
2014-12-10 08:21:15 +00:00
|
|
|
|
namespace CodeImp.DoomBuilder.BuilderModes.Interface
|
|
|
|
|
{
|
|
|
|
|
internal struct BridgeInterpolationMode
|
|
|
|
|
{
|
2013-09-11 09:47:53 +00:00
|
|
|
|
public const string BRIGHTNESS_HIGHEST = "Use highest";
|
|
|
|
|
public const string BRIGHTNESS_LOWEST = "Use lowest";
|
|
|
|
|
|
|
|
|
|
public const string HIGHEST = "Highest ceiling";
|
|
|
|
|
public const string LOWEST = "Lowest floor";
|
|
|
|
|
public const string LINEAR = "Linear interpolation";
|
|
|
|
|
public const string IN_SINE = "EaseInSine interpolation";
|
|
|
|
|
public const string OUT_SINE = "EaseOutSine interpolation";
|
|
|
|
|
public const string IN_OUT_SINE = "EaseInOutSine interpolation";
|
|
|
|
|
|
2014-12-10 08:21:15 +00:00
|
|
|
|
public static readonly string[] CEILING_INTERPOLATION_MODES = { LINEAR, HIGHEST, IN_SINE, OUT_SINE, IN_OUT_SINE/*, IN_OUT_CUBIC, OUT_IN_CUBIC*/ };
|
|
|
|
|
public static readonly string[] FLOOR_INTERPOLATION_MODES = { LINEAR, LOWEST, IN_SINE, OUT_SINE, IN_OUT_SINE/*, IN_OUT_CUBIC, OUT_IN_CUBIC*/ };
|
|
|
|
|
public static readonly string[] BRIGHTNESS_INTERPOLATION_MODES = { LINEAR, BRIGHTNESS_HIGHEST, BRIGHTNESS_LOWEST };
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-12-10 08:21:15 +00:00
|
|
|
|
public partial class BridgeModeForm : DelayedForm
|
|
|
|
|
{
|
2014-12-03 23:15:26 +00:00
|
|
|
|
internal int Subdivisions { get { return (int)nudSubdivisions.Value; } set { nudSubdivisions.Value = value; } }
|
2013-09-11 09:47:53 +00:00
|
|
|
|
internal string FloorAlignMode { get { return (string)cbFloorAlign.SelectedItem; } }
|
|
|
|
|
internal string CeilingAlignMode { get { return (string)cbCeilingAlign.SelectedItem; } }
|
|
|
|
|
internal string BrightnessMode { get { return (string)cbBrightness.SelectedItem; } }
|
|
|
|
|
|
|
|
|
|
internal bool MirrorMode { get { return cbMirror.Checked; } }
|
|
|
|
|
internal bool CopyMode { get { return cbCopy.Checked; } }
|
|
|
|
|
|
|
|
|
|
internal event EventHandler OnSubdivisionChanged;
|
|
|
|
|
internal event EventHandler OnOkClick;
|
|
|
|
|
internal event EventHandler OnCancelClick;
|
|
|
|
|
internal event EventHandler OnFlipClick;
|
|
|
|
|
|
2014-12-03 23:15:26 +00:00
|
|
|
|
public BridgeModeForm()
|
|
|
|
|
{
|
2013-09-11 09:47:53 +00:00
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
cbBrightness.Items.AddRange(BridgeInterpolationMode.BRIGHTNESS_INTERPOLATION_MODES);
|
|
|
|
|
cbCeilingAlign.Items.AddRange(BridgeInterpolationMode.CEILING_INTERPOLATION_MODES);
|
|
|
|
|
cbFloorAlign.Items.AddRange(BridgeInterpolationMode.FLOOR_INTERPOLATION_MODES);
|
|
|
|
|
|
|
|
|
|
cbBrightness.SelectedIndex = 0;
|
|
|
|
|
cbCeilingAlign.SelectedIndex = 0;
|
|
|
|
|
cbFloorAlign.SelectedIndex = 0;
|
|
|
|
|
|
|
|
|
|
nudSubdivisions.Minimum = BridgeMode.MIN_SUBDIVISIONS;
|
|
|
|
|
nudSubdivisions.Maximum = BridgeMode.MAX_SUBDIVISIONS;
|
|
|
|
|
}
|
2012-06-19 13:12:28 +00:00
|
|
|
|
|
|
|
|
|
//events
|
2014-12-03 23:15:26 +00:00
|
|
|
|
private void BezierPathForm_FormClosed(object sender, FormClosedEventArgs e)
|
|
|
|
|
{
|
2015-12-28 15:01:53 +00:00
|
|
|
|
if(OnCancelClick != null) OnCancelClick(this, EventArgs.Empty);
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-12-03 23:15:26 +00:00
|
|
|
|
private void buttonCancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-12-28 15:01:53 +00:00
|
|
|
|
if(OnCancelClick != null) OnCancelClick(this, EventArgs.Empty);
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-12-03 23:15:26 +00:00
|
|
|
|
private void buttonOK_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-12-28 15:01:53 +00:00
|
|
|
|
if(OnOkClick != null) OnOkClick(this, EventArgs.Empty);
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-12-03 23:15:26 +00:00
|
|
|
|
private void nudSubdivisions_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-12-28 15:01:53 +00:00
|
|
|
|
if(OnSubdivisionChanged != null) OnSubdivisionChanged(this, EventArgs.Empty);
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-12-03 23:15:26 +00:00
|
|
|
|
private void BezierPathForm_MouseLeave(object sender, EventArgs e)
|
|
|
|
|
{
|
2013-09-11 09:47:53 +00:00
|
|
|
|
General.Interface.FocusDisplay();
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-03 23:15:26 +00:00
|
|
|
|
private void buttonFlip_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-12-28 15:01:53 +00:00
|
|
|
|
if(OnFlipClick != null) OnFlipClick(this, EventArgs.Empty);
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-12-03 23:15:26 +00:00
|
|
|
|
private void cbCopy_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-12-28 15:01:53 +00:00
|
|
|
|
if(cbMirror.Checked && cbCopy.Checked) cbMirror.Checked = false;
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-12-03 23:15:26 +00:00
|
|
|
|
private void cbMirror_CheckStateChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-12-28 15:01:53 +00:00
|
|
|
|
if(cbMirror.Checked && cbCopy.Checked) cbCopy.Checked = false;
|
2013-09-11 09:47:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-06-19 13:12:28 +00:00
|
|
|
|
}
|