Fixed nonsensical values being returned when using +++/--- in many fields.

This commit is contained in:
biwa 2020-01-04 23:29:35 +01:00 committed by spherallic
parent 33d55dce7b
commit 71e44108a0
8 changed files with 164 additions and 38 deletions

View file

@ -130,6 +130,12 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
}
}
public void ResetIncrementStep()
{
value1.ResetIncrementStep();
value2.ResetIncrementStep();
}
#endregion
#region ================== Events

View file

@ -122,5 +122,11 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
CheckValues();
}
}
public void ResetIncrementStep()
{
value1.ResetIncrementStep();
value2.ResetIncrementStep();
}
}
}

View file

@ -91,5 +91,11 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls
{
CheckValues();
}
public void ResetIncrementStep()
{
value1.ResetIncrementStep();
value2.ResetIncrementStep();
}
}
}

View file

@ -836,7 +836,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
frontTextureOffset.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Front != null)
{
@ -883,7 +886,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
backTextureOffset.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Back != null)
{

View file

@ -1241,8 +1241,11 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
lightFront.ResetIncrementStep();
//restore values
if(string.IsNullOrEmpty(lightFront.Text))
if (string.IsNullOrEmpty(lightFront.Text))
{
foreach(Linedef l in lines)
{
@ -1477,7 +1480,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
frontTextureOffset.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Front != null)
{
@ -1507,7 +1513,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
backTextureOffset.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Back != null)
{
@ -1541,7 +1550,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
pfcFrontOffsetTop.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Front != null)
{
@ -1563,7 +1575,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
pfcFrontOffsetMid.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Front != null)
{
@ -1586,7 +1601,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
pfcFrontOffsetBottom.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Front != null)
{
@ -1609,7 +1627,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
pfcBackOffsetTop.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Back != null)
{
@ -1632,7 +1653,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
pfcBackOffsetMid.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Back != null)
{
@ -1655,7 +1679,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
pfcBackOffsetBottom.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Back != null)
{
@ -1682,7 +1709,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
pfcFrontScaleTop.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Front != null)
{
@ -1705,7 +1735,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
pfcFrontScaleMid.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Front != null)
{
@ -1728,7 +1761,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
pfcFrontScaleBottom.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Front != null)
{
@ -1751,7 +1787,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
pfcBackScaleTop.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Back != null)
{
@ -1774,7 +1813,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
pfcBackScaleMid.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Back != null)
{
@ -1797,7 +1839,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Linedef l in lines)
// Reset increment steps, otherwise it's just keep counting and counting
pfcBackScaleBottom.ResetIncrementStep();
foreach (Linedef l in lines)
{
if(l.Back != null)
{

View file

@ -888,8 +888,11 @@ namespace CodeImp.DoomBuilder.Windows
if(preventchanges) return;
MakeUndo(); //mxd
// Reset increment steps, otherwise it's just keep counting and counting
brightness.ResetIncrementStep();
//restore values
if(string.IsNullOrEmpty(brightness.Text))
if (string.IsNullOrEmpty(brightness.Text))
{
foreach(Sector s in sectors)
s.Brightness = sectorprops[s].Brightness;
@ -960,8 +963,11 @@ namespace CodeImp.DoomBuilder.Windows
if(preventchanges) return;
MakeUndo(); //mxd
// Reset increment steps, otherwise it's just keep counting and counting
floorRotation.ResetIncrementStep();
//restore values
if(string.IsNullOrEmpty(floorRotation.Text))
if (string.IsNullOrEmpty(floorRotation.Text))
{
floorAngleControl.Angle = GZBuilder.Controls.AngleControl.NO_ANGLE;
@ -991,8 +997,11 @@ namespace CodeImp.DoomBuilder.Windows
if(preventchanges) return;
MakeUndo(); //mxd
// Reset increment steps, otherwise it's just keep counting and counting
ceilRotation.ResetIncrementStep();
//restore values
if(string.IsNullOrEmpty(ceilRotation.Text))
if (string.IsNullOrEmpty(ceilRotation.Text))
{
ceilAngleControl.Angle = GZBuilder.Controls.AngleControl.NO_ANGLE;
@ -1056,7 +1065,10 @@ namespace CodeImp.DoomBuilder.Windows
if(preventchanges) return;
MakeUndo(); //mxd
foreach(Sector s in sectors)
// Reset increment steps, otherwise it's just keep counting and counting
ceilOffsets.ResetIncrementStep();
foreach (Sector s in sectors)
{
ceilOffsets.ApplyTo(s.Fields, General.Map.FormatInterface.MinTextureOffset, General.Map.FormatInterface.MaxTextureOffset, sectorprops[s].CeilOffsetX, sectorprops[s].CeilOffsetY);
s.UpdateNeeded = true;
@ -1072,7 +1084,10 @@ namespace CodeImp.DoomBuilder.Windows
if(preventchanges) return;
MakeUndo(); //mxd
foreach(Sector s in sectors)
// Reset increment steps, otherwise it's just keep counting and counting
floorOffsets.ResetIncrementStep();
foreach (Sector s in sectors)
{
floorOffsets.ApplyTo(s.Fields, General.Map.FormatInterface.MinTextureOffset, General.Map.FormatInterface.MaxTextureOffset, sectorprops[s].FloorOffsetX, sectorprops[s].FloorOffsetY);
s.UpdateNeeded = true;
@ -1088,7 +1103,10 @@ namespace CodeImp.DoomBuilder.Windows
if(preventchanges) return;
MakeUndo(); //mxd
foreach(Sector s in sectors)
// Reset increment steps, otherwise it's just keep counting and counting
ceilScale.ResetIncrementStep();
foreach (Sector s in sectors)
{
ceilScale.ApplyTo(s.Fields, General.Map.FormatInterface.MinTextureOffset, General.Map.FormatInterface.MaxTextureOffset, sectorprops[s].CeilScaleX, sectorprops[s].CeilScaleY);
s.UpdateNeeded = true;
@ -1104,7 +1122,10 @@ namespace CodeImp.DoomBuilder.Windows
if(preventchanges) return;
MakeUndo(); //mxd
foreach(Sector s in sectors)
// Reset increment steps, otherwise it's just keep counting and counting
floorScale.ResetIncrementStep();
foreach (Sector s in sectors)
{
floorScale.ApplyTo(s.Fields, General.Map.FormatInterface.MinTextureOffset, General.Map.FormatInterface.MaxTextureOffset, sectorprops[s].FloorScaleX, sectorprops[s].FloorScaleY);
s.UpdateNeeded = true;
@ -1120,8 +1141,11 @@ namespace CodeImp.DoomBuilder.Windows
if(preventchanges) return;
MakeUndo(); //mxd
// Reset increment steps, otherwise it's just keep counting and counting
ceilBrightness.ResetIncrementStep();
//restore values
if(string.IsNullOrEmpty(ceilBrightness.Text))
if (string.IsNullOrEmpty(ceilBrightness.Text))
{
foreach(Sector s in sectors)
{
@ -1160,8 +1184,11 @@ namespace CodeImp.DoomBuilder.Windows
if(preventchanges) return;
MakeUndo(); //mxd
// Reset increment steps, otherwise it's just keep counting and counting
floorBrightness.ResetIncrementStep();
//restore values
if(string.IsNullOrEmpty(floorBrightness.Text))
if (string.IsNullOrEmpty(floorBrightness.Text))
{
foreach(Sector s in sectors)
{

View file

@ -527,8 +527,11 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
posX.ResetIncrementStep();
// Update values
foreach(Thing t in things)
foreach (Thing t in things)
t.Move(new Vector2D(posX.GetResultFloat(thingprops[i++].X), t.Position.y));
General.Map.IsChanged = true;
@ -541,8 +544,11 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
posY.ResetIncrementStep();
// Update values
foreach(Thing t in things)
foreach (Thing t in things)
t.Move(new Vector2D(t.Position.x, posY.GetResultFloat(thingprops[i++].Y)));
General.Map.IsChanged = true;
@ -555,7 +561,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
if(string.IsNullOrEmpty(posZ.Text))
// Reset increment steps, otherwise it's just keep counting and counting
posZ.ResetIncrementStep();
if (string.IsNullOrEmpty(posZ.Text))
{
// Restore values
foreach(Thing t in things)
@ -655,8 +664,11 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
angle.ResetIncrementStep();
//restore values
if(string.IsNullOrEmpty(angle.Text))
if (string.IsNullOrEmpty(angle.Text))
{
// Apply rotation
foreach(Thing t in things)

View file

@ -610,8 +610,11 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
posX.ResetIncrementStep();
// Update values
foreach(Thing t in things)
foreach (Thing t in things)
t.Move(new Vector2D(posX.GetResultFloat(thingprops[i++].X), t.Position.y));
General.Map.IsChanged = true;
@ -624,8 +627,11 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
posY.ResetIncrementStep();
// Update values
foreach(Thing t in things)
foreach (Thing t in things)
t.Move(new Vector2D(t.Position.x, posY.GetResultFloat(thingprops[i++].Y)));
General.Map.IsChanged = true;
@ -638,7 +644,10 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
if(string.IsNullOrEmpty(posZ.Text))
// Reset increment steps, otherwise it's just keep counting and counting
posZ.ResetIncrementStep();
if (string.IsNullOrEmpty(posZ.Text))
{
// Restore values
foreach(Thing t in things)
@ -666,7 +675,7 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
foreach(Thing t in things)
foreach (Thing t in things)
{
float sx = scale.GetValue1(thingprops[i].ScaleX);
float sy = scale.GetValue2(thingprops[i].ScaleY);
@ -716,8 +725,11 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
angle.ResetIncrementStep();
//restore values
if(string.IsNullOrEmpty(angle.Text))
if (string.IsNullOrEmpty(angle.Text))
{
foreach(Thing t in things) t.Rotate(thingprops[i++].AngleDoom);
}
@ -737,8 +749,11 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
pitch.ResetIncrementStep();
//restore values
if(string.IsNullOrEmpty(pitch.Text))
if (string.IsNullOrEmpty(pitch.Text))
{
foreach(Thing t in things) t.SetPitch(thingprops[i++].Pitch);
}
@ -759,8 +774,11 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
roll.ResetIncrementStep();
//restore values
if(string.IsNullOrEmpty(roll.Text))
if (string.IsNullOrEmpty(roll.Text))
{
foreach(Thing t in things) t.SetRoll(thingprops[i++].Roll);
}