mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-17 01:22:18 +00:00
Fixed base heights for 3D floors
Improved handling of changing input boxes in slope arching form
This commit is contained in:
parent
b04cafd016
commit
f93a13c1f2
3 changed files with 91 additions and 10 deletions
|
@ -62,7 +62,7 @@
|
|||
this.theta.Size = new System.Drawing.Size(63, 24);
|
||||
this.theta.StepValues = null;
|
||||
this.theta.TabIndex = 18;
|
||||
this.theta.WhenTextChanged += new System.EventHandler(this.UpdateArch);
|
||||
this.theta.WhenTextChanged += new System.EventHandler(this.theta_WhenTextChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
|
@ -72,7 +72,6 @@
|
|||
this.label1.Size = new System.Drawing.Size(37, 13);
|
||||
this.label1.TabIndex = 19;
|
||||
this.label1.Text = "Angle:";
|
||||
this.label1.Click += new System.EventHandler(this.label1_Click);
|
||||
//
|
||||
// offset
|
||||
//
|
||||
|
@ -91,7 +90,7 @@
|
|||
this.offset.Size = new System.Drawing.Size(63, 24);
|
||||
this.offset.StepValues = null;
|
||||
this.offset.TabIndex = 20;
|
||||
this.offset.WhenTextChanged += new System.EventHandler(this.UpdateArch);
|
||||
this.offset.WhenTextChanged += new System.EventHandler(this.offset_WhenTextChanged);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
|
@ -133,7 +132,7 @@
|
|||
this.up.TabStop = true;
|
||||
this.up.Text = "Up";
|
||||
this.up.UseVisualStyleBackColor = true;
|
||||
this.up.CheckedChanged += new System.EventHandler(this.UpdateArch);
|
||||
this.up.CheckedChanged += new System.EventHandler(this.up_CheckedChanged);
|
||||
//
|
||||
// down
|
||||
//
|
||||
|
@ -144,7 +143,7 @@
|
|||
this.down.TabIndex = 25;
|
||||
this.down.Text = "Down";
|
||||
this.down.UseVisualStyleBackColor = true;
|
||||
this.down.CheckedChanged += new System.EventHandler(this.UpdateArch);
|
||||
this.down.CheckedChanged += new System.EventHandler(this.down_CheckedChanged);
|
||||
//
|
||||
// scale
|
||||
//
|
||||
|
@ -163,7 +162,7 @@
|
|||
this.scale.Size = new System.Drawing.Size(63, 24);
|
||||
this.scale.StepValues = null;
|
||||
this.scale.TabIndex = 26;
|
||||
this.scale.WhenTextChanged += new System.EventHandler(this.UpdateArch);
|
||||
this.scale.WhenTextChanged += new System.EventHandler(this.scale_WhenTextChanged);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
|
@ -221,7 +220,7 @@
|
|||
this.heightoffset.Size = new System.Drawing.Size(63, 24);
|
||||
this.heightoffset.StepValues = null;
|
||||
this.heightoffset.TabIndex = 31;
|
||||
this.heightoffset.WhenTextChanged += new System.EventHandler(this.UpdateArch);
|
||||
this.heightoffset.WhenTextChanged += new System.EventHandler(this.heightoffset_WhenTextChanged);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
|
|
|
@ -23,6 +23,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
private double originalheightoffset;
|
||||
private SlopeArcher slopearcher;
|
||||
public event EventHandler UpdateChangedObjects;
|
||||
bool updating;
|
||||
|
||||
internal SlopeArchForm(EditMode mode, SlopeArcher slopearcher)
|
||||
{
|
||||
|
@ -40,9 +41,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
offset.Text = originaloffset.ToString();
|
||||
scale.Text = (originalscale * 100.0).ToString();
|
||||
heightoffset.Text = originalheightoffset.ToString();
|
||||
|
||||
updating = false;
|
||||
}
|
||||
|
||||
private void UpdateArch(object sender, EventArgs e)
|
||||
private void UpdateArch()
|
||||
{
|
||||
double t = theta.GetResultFloat(originaltheta);
|
||||
double o = offset.GetResultFloat(originaloffset);
|
||||
|
@ -75,25 +78,99 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
private void halfcircle_Click(object sender, EventArgs e)
|
||||
{
|
||||
updating = true;
|
||||
|
||||
theta.Text = "180";
|
||||
offset.Text = "0";
|
||||
|
||||
UpdateArch();
|
||||
|
||||
updating = false;
|
||||
}
|
||||
|
||||
private void quartercircleleft_Click(object sender, EventArgs e)
|
||||
{
|
||||
updating = true;
|
||||
|
||||
theta.Text = "90";
|
||||
offset.Text = "90";
|
||||
|
||||
UpdateArch();
|
||||
|
||||
updating = false;
|
||||
}
|
||||
|
||||
private void quartercircleright_Click(object sender, EventArgs e)
|
||||
{
|
||||
updating = true;
|
||||
|
||||
theta.Text = "90";
|
||||
offset.Text = "0";
|
||||
|
||||
UpdateArch();
|
||||
|
||||
updating = false;
|
||||
}
|
||||
|
||||
private void label1_Click(object sender, EventArgs e)
|
||||
private void theta_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (updating)
|
||||
return;
|
||||
|
||||
updating = true;
|
||||
|
||||
double t = theta.GetResultFloat(originaltheta);
|
||||
|
||||
if (t > 180.0)
|
||||
t = 180.0;
|
||||
|
||||
double o = (180 - t) / 2.0;
|
||||
|
||||
offset.Text = o.ToString();
|
||||
|
||||
UpdateArch();
|
||||
|
||||
updating = false;
|
||||
}
|
||||
|
||||
private void offset_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (updating)
|
||||
return;
|
||||
|
||||
UpdateArch();
|
||||
}
|
||||
|
||||
private void scale_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (updating)
|
||||
return;
|
||||
|
||||
UpdateArch();
|
||||
}
|
||||
|
||||
private void heightoffset_WhenTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (updating)
|
||||
return;
|
||||
|
||||
UpdateArch();
|
||||
}
|
||||
|
||||
private void up_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (updating)
|
||||
return;
|
||||
|
||||
UpdateArch();
|
||||
}
|
||||
|
||||
private void down_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (updating)
|
||||
return;
|
||||
|
||||
UpdateArch();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
handleline = new Line2D(handle1.GetCenterPoint(), handle2.GetCenterPoint());
|
||||
length = handleline.GetLength();
|
||||
|
||||
baseheight = handle1.Level.type == SectorLevelType.Ceiling ? handle1.Level.sector.CeilHeight : handle1.Level.sector.FloorHeight;
|
||||
if (handle1.Level.type == SectorLevelType.Ceiling)
|
||||
baseheight = handle1.Level.extrafloor ? handle1.Level.sector.FloorHeight : handle1.Level.sector.CeilHeight;
|
||||
else
|
||||
baseheight = handle1.Level.extrafloor ? handle1.Level.sector.CeilHeight : handle1.Level.sector.FloorHeight;
|
||||
|
||||
//baseheight = handle1.Level.type == SectorLevelType.Ceiling ? handle1.Level.sector.CeilHeight : handle1.Level.sector.FloorHeight;
|
||||
baseheightoffset = 0.0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue