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

This commit is contained in:
biwa 2020-01-04 23:29:35 +01:00
parent 0e7875e0ad
commit b415046694
9 changed files with 724 additions and 595 deletions

View file

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

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

@ -743,7 +743,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)
{
@ -772,7 +775,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

@ -1247,8 +1247,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)
{
@ -1483,7 +1486,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)
{
@ -1512,7 +1518,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)
{
@ -1545,7 +1554,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)
{
@ -1566,7 +1578,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)
{
@ -1588,7 +1603,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)
{
@ -1610,7 +1628,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)
{
@ -1654,7 +1678,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)
{
@ -1680,7 +1707,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)
{
@ -1702,7 +1732,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)
{
@ -1724,7 +1757,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)
{
@ -1746,7 +1782,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)
{
@ -1768,7 +1807,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)
{
@ -1790,7 +1832,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

@ -1173,8 +1173,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;
@ -1245,8 +1248,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 = AngleControlEx.NO_ANGLE;
@ -1276,8 +1282,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 = AngleControlEx.NO_ANGLE;
@ -1341,7 +1350,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;
@ -1356,7 +1368,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;
@ -1371,7 +1386,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;
@ -1386,7 +1404,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;
@ -1401,8 +1422,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)
{
@ -1441,8 +1465,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)
{
@ -1619,8 +1646,11 @@ namespace CodeImp.DoomBuilder.Windows
if(preventchanges) return;
MakeUndo();
// Reset increment steps, otherwise it's just keep counting and counting
fogdensity.ResetIncrementStep();
// Restore values
if(string.IsNullOrEmpty(fogdensity.Text))
if (string.IsNullOrEmpty(fogdensity.Text))
{
foreach(Sector s in sectors)
{

View file

@ -535,8 +535,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;
@ -549,8 +552,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;
@ -563,7 +569,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)
@ -624,8 +633,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

@ -670,8 +670,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;
@ -684,8 +687,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;
@ -698,7 +704,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)
@ -726,7 +735,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);
@ -777,8 +786,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);
}
@ -798,8 +810,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);
}
@ -820,8 +835,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);
}