1
0
mirror of synced 2024-12-14 08:32:59 +01:00
Switch-Toolbox/Switch_FileFormatsMain/GUI/BFRES/Materials/ShaderParams/TexSrtPanel.cs
KillzXGaming dd15ef59c5 Many more improvements and additions
Added NUT support (viewing GX2 and DDS texture data)
Fixed importing uncompressed dds using the mask data.
Add EFE support from smash 4 wii u and 3ds.
Redo the shader param editor. Uses a list again for faster access and viewing. I will have items drop down from a floating window next to the item soon.
2019-04-24 21:17:29 -04:00

63 lines
1.8 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)
{
InitializeComponent();
activeParam = param;
stTextBox1.Bind(activeParam, "Name");
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();
}
}
}