2014-02-10 09:26:13 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using CodeImp.DoomBuilder.Geometry;
|
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Windows
|
|
|
|
|
{
|
2014-10-22 13:07:17 +00:00
|
|
|
|
public partial class CenterOnCoordinatesForm : DelayedForm
|
2014-02-10 09:26:13 +00:00
|
|
|
|
{
|
|
|
|
|
private static Vector2D coordinates;
|
|
|
|
|
public Vector2D Coordinates { get { return coordinates; } }
|
|
|
|
|
|
2014-10-22 13:07:17 +00:00
|
|
|
|
public CenterOnCoordinatesForm()
|
|
|
|
|
{
|
2014-02-10 09:26:13 +00:00
|
|
|
|
InitializeComponent();
|
|
|
|
|
gotox.Text = coordinates.x.ToString();
|
|
|
|
|
gotoy.Text = coordinates.y.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-22 13:07:17 +00:00
|
|
|
|
private void accept_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2020-05-22 20:30:32 +00:00
|
|
|
|
coordinates.x = Math.Round(General.Clamp(gotox.GetResult((int)coordinates.x), General.Map.FormatInterface.MinCoordinate, General.Map.FormatInterface.MaxCoordinate));
|
|
|
|
|
coordinates.y = Math.Round(General.Clamp(gotoy.GetResult((int)coordinates.y), General.Map.FormatInterface.MinCoordinate, General.Map.FormatInterface.MaxCoordinate));
|
2014-02-10 09:26:13 +00:00
|
|
|
|
|
|
|
|
|
this.DialogResult = DialogResult.OK;
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-22 13:07:17 +00:00
|
|
|
|
private void cancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2014-02-10 09:26:13 +00:00
|
|
|
|
this.DialogResult = DialogResult.Cancel;
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|