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 #endregion
#region ================== Events #region ================== Events

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -610,6 +610,9 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd MakeUndo(); //mxd
int i = 0; int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
posX.ResetIncrementStep();
// Update values // Update values
foreach (Thing t in things) foreach (Thing t in things)
t.Move(new Vector2D(posX.GetResultFloat(thingprops[i++].X), t.Position.y)); t.Move(new Vector2D(posX.GetResultFloat(thingprops[i++].X), t.Position.y));
@ -624,6 +627,9 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd MakeUndo(); //mxd
int i = 0; int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
posY.ResetIncrementStep();
// Update values // Update values
foreach (Thing t in things) foreach (Thing t in things)
t.Move(new Vector2D(t.Position.x, posY.GetResultFloat(thingprops[i++].Y))); t.Move(new Vector2D(t.Position.x, posY.GetResultFloat(thingprops[i++].Y)));
@ -638,6 +644,9 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd MakeUndo(); //mxd
int i = 0; int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
posZ.ResetIncrementStep();
if (string.IsNullOrEmpty(posZ.Text)) if (string.IsNullOrEmpty(posZ.Text))
{ {
// Restore values // Restore values
@ -716,6 +725,9 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd MakeUndo(); //mxd
int i = 0; int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
angle.ResetIncrementStep();
//restore values //restore values
if (string.IsNullOrEmpty(angle.Text)) if (string.IsNullOrEmpty(angle.Text))
{ {
@ -737,6 +749,9 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd MakeUndo(); //mxd
int i = 0; int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
pitch.ResetIncrementStep();
//restore values //restore values
if (string.IsNullOrEmpty(pitch.Text)) if (string.IsNullOrEmpty(pitch.Text))
{ {
@ -759,6 +774,9 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd MakeUndo(); //mxd
int i = 0; int i = 0;
// Reset increment steps, otherwise it's just keep counting and counting
roll.ResetIncrementStep();
//restore values //restore values
if (string.IsNullOrEmpty(roll.Text)) if (string.IsNullOrEmpty(roll.Text))
{ {