1
0
mirror of synced 2024-12-02 19:17:24 +01:00

Fix bntx corrupting textures on save and round params for displaying.

This commit is contained in:
KillzXGaming 2019-03-24 13:56:09 -04:00
parent b30072d100
commit c0328e3b82
7 changed files with 21 additions and 18 deletions

Binary file not shown.

View File

@ -156,30 +156,30 @@ namespace FirstPlugin.Forms
{ {
case ShaderParamType.Float: case ShaderParamType.Float:
Values = $"[ {param.ValueFloat[0]} ]"; Values = $"[ {RoundParam(param.ValueFloat[0])} ]";
break; break;
case ShaderParamType.Float2: case ShaderParamType.Float2:
Values = $"[ {param.ValueFloat[0]} ," + Values = $"[ {RoundParam(param.ValueFloat[0])} ," +
$" {param.ValueFloat[1]} ]"; $" {RoundParam(param.ValueFloat[1])} ]";
break; break;
case ShaderParamType.Float3: case ShaderParamType.Float3:
Values = $"[ {param.ValueFloat[0]} ," + Values = $"[ {RoundParam(param.ValueFloat[0])} ," +
$" {param.ValueFloat[1]} ," + $" {RoundParam(param.ValueFloat[1])} ," +
$" {param.ValueFloat[2]} ,]"; $" {RoundParam(param.ValueFloat[2])} ,]";
break; break;
case ShaderParamType.Float4: case ShaderParamType.Float4:
Values = $"[ {param.ValueFloat[0]} ," + Values = $"[ {RoundParam(param.ValueFloat[0])} ," +
$" {param.ValueFloat[1]} ," + $" {RoundParam(param.ValueFloat[1])} ," +
$" {param.ValueFloat[2]} ," + $" {RoundParam(param.ValueFloat[2])} ," +
$" {param.ValueFloat[3]} ]"; $" {RoundParam(param.ValueFloat[3])} ]";
break; break;
case ShaderParamType.TexSrt: case ShaderParamType.TexSrt:
Values = $"[ {param.ValueTexSrt.Mode} ," + Values = $"[ {param.ValueTexSrt.Mode} ," +
$" {param.ValueTexSrt.Scaling.X} ," + $" {RoundParam(param.ValueTexSrt.Scaling.X)} ," +
$" {param.ValueTexSrt.Scaling.Y} ," + $" {RoundParam(param.ValueTexSrt.Scaling.Y)} ," +
$" {param.ValueTexSrt.Rotation}, " + $" {RoundParam(param.ValueTexSrt.Rotation)}, " +
$" {param.ValueTexSrt.Translation.X}," + $" {RoundParam(param.ValueTexSrt.Translation.X)}," +
$" {param.ValueTexSrt.Translation.X} ]"; $" {RoundParam(param.ValueTexSrt.Translation.X)} ]";
break; break;
} }
@ -187,5 +187,9 @@ namespace FirstPlugin.Forms
return Values; return Values;
} }
private float RoundParam(float Value) {
return (float)Math.Round(Value, 2);
}
} }
} }

View File

@ -166,9 +166,8 @@ namespace BarSlider
{ {
TextEditorActive = true; TextEditorActive = true;
prevPos = Cursor.Position;
Cursor.Show(); Cursor.Show();
prevPos = Cursor.Position;
textBox.Location = new Point(30, ClientSize.Height / 2 - 5); textBox.Location = new Point(30, ClientSize.Height / 2 - 5);
textBox.Text = Value.ToString(); textBox.Text = Value.ToString();
@ -1578,7 +1577,7 @@ namespace BarSlider
Cursor.Hide(); Cursor.Hide();
base.OnMouseDown(e); base.OnMouseDown(e);
if (e.Button == MouseButtons.Left) if (e.Button == MouseButtons.Left)
{ {
/* Capture = true; /* Capture = true;
if (Scroll != null) Scroll(this, new ScrollEventArgs(ScrollEventType.ThumbTrack, _trackerValue)); if (Scroll != null) Scroll(this, new ScrollEventArgs(ScrollEventType.ThumbTrack, _trackerValue));