mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-12-18 08:53:08 +00:00
62 lines
1.7 KiB
C#
62 lines
1.7 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.ComponentModel;
|
|||
|
using System.Drawing;
|
|||
|
using System.Data;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using System.Windows.Forms;
|
|||
|
using Bfres.Structs;
|
|||
|
using Syroot.NintenTools.NSW.Bfres;
|
|||
|
using Switch_Toolbox.Library.Forms;
|
|||
|
|
|||
|
namespace FirstPlugin.Forms
|
|||
|
{
|
|||
|
public partial class TexSrtPanel : ParamValueEditorBase
|
|||
|
{
|
|||
|
public TexSrtPanel(TexSrt TexSrt, BfresShaderParam param)
|
|||
|
{
|
|||
|
activeParam = param;
|
|||
|
|
|||
|
InitializeComponent();
|
|||
|
|
|||
|
scalingModeCN.Bind(typeof(TexSrtMode), TexSrt, "Mode");
|
|||
|
scalingModeCN.SelectedItem = TexSrt.Mode;
|
|||
|
|
|||
|
scaXUD.DataType = typeof(float);
|
|||
|
scaYUD.DataType = typeof(float);
|
|||
|
rotXUD.DataType = typeof(float);
|
|||
|
transXUD.DataType = typeof(float);
|
|||
|
transYUD.DataType = typeof(float);
|
|||
|
|
|||
|
scaXUD.Value = TexSrt.Scaling.X;
|
|||
|
scaYUD.Value = TexSrt.Scaling.Y;
|
|||
|
|
|||
|
rotXUD.Value = TexSrt.Rotation;
|
|||
|
|
|||
|
transXUD.Value = TexSrt.Translation.X;
|
|||
|
transYUD.Value = TexSrt.Translation.Y;
|
|||
|
}
|
|||
|
|
|||
|
public void ApplyValues()
|
|||
|
{
|
|||
|
activeParam.ValueTexSrt = new TexSrt
|
|||
|
{
|
|||
|
Mode = (TexSrtMode)scalingModeCN.SelectedItem,
|
|||
|
Scaling = new Syroot.Maths.Vector2F(scaXUD.Value, scaYUD.Value),
|
|||
|
Rotation = rotXUD.Value,
|
|||
|
Translation = new Syroot.Maths.Vector2F(transXUD.Value, transYUD.Value),
|
|||
|
};
|
|||
|
|
|||
|
if (OnPanelChanged != null)
|
|||
|
OnPanelChanged(activeParam, this);
|
|||
|
}
|
|||
|
|
|||
|
private void barSlider_ValueChanged(object sender, EventArgs e)
|
|||
|
{
|
|||
|
ApplyValues();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|