1
0
mirror of synced 2024-11-12 02:00:50 +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:
Values = $"[ {param.ValueFloat[0]} ]";
Values = $"[ {RoundParam(param.ValueFloat[0])} ]";
break;
case ShaderParamType.Float2:
Values = $"[ {param.ValueFloat[0]} ," +
$" {param.ValueFloat[1]} ]";
Values = $"[ {RoundParam(param.ValueFloat[0])} ," +
$" {RoundParam(param.ValueFloat[1])} ]";
break;
case ShaderParamType.Float3:
Values = $"[ {param.ValueFloat[0]} ," +
$" {param.ValueFloat[1]} ," +
$" {param.ValueFloat[2]} ,]";
Values = $"[ {RoundParam(param.ValueFloat[0])} ," +
$" {RoundParam(param.ValueFloat[1])} ," +
$" {RoundParam(param.ValueFloat[2])} ,]";
break;
case ShaderParamType.Float4:
Values = $"[ {param.ValueFloat[0]} ," +
$" {param.ValueFloat[1]} ," +
$" {param.ValueFloat[2]} ," +
$" {param.ValueFloat[3]} ]";
Values = $"[ {RoundParam(param.ValueFloat[0])} ," +
$" {RoundParam(param.ValueFloat[1])} ," +
$" {RoundParam(param.ValueFloat[2])} ," +
$" {RoundParam(param.ValueFloat[3])} ]";
break;
case ShaderParamType.TexSrt:
Values = $"[ {param.ValueTexSrt.Mode} ," +
$" {param.ValueTexSrt.Scaling.X} ," +
$" {param.ValueTexSrt.Scaling.Y} ," +
$" {param.ValueTexSrt.Rotation}, " +
$" {param.ValueTexSrt.Translation.X}," +
$" {param.ValueTexSrt.Translation.X} ]";
$" {RoundParam(param.ValueTexSrt.Scaling.X)} ," +
$" {RoundParam(param.ValueTexSrt.Scaling.Y)} ," +
$" {RoundParam(param.ValueTexSrt.Rotation)}, " +
$" {RoundParam(param.ValueTexSrt.Translation.X)}," +
$" {RoundParam(param.ValueTexSrt.Translation.X)} ]";
break;
}
@ -187,5 +187,9 @@ namespace FirstPlugin.Forms
return Values;
}
private float RoundParam(float Value) {
return (float)Math.Round(Value, 2);
}
}
}

View File

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