1
0
mirror of synced 2024-12-15 09:01:23 +01:00
Switch-Toolbox/Switch_FileFormatsMain/GUI/BFRES/Materials/ShaderParams/booleanPanel.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

60 lines
1.8 KiB
C#

using Syroot.NintenTools.NSW.Bfres;
using Bfres.Structs;
using System.Collections.Generic;
namespace FirstPlugin.Forms
{
public partial class booleanPanel : ParamValueEditorBase
{
public booleanPanel(bool[] values, BfresShaderParam param)
{
InitializeComponent();
activeParam = param;
stTextBox1.Bind(activeParam, "Name");
if (values.Length >= 1)
stCheckBox1.Checked = values[0];
if (values.Length >= 2)
stCheckBox1.Checked = values[1];
if (values.Length >= 3)
stCheckBox1.Checked = values[2];
if (values.Length >= 4)
stCheckBox1.Checked = values[3];
}
private void barSlider1_ValueChanged(object sender, System.EventArgs e)
{
List<bool> values = new List<bool>();
if (activeParam.Type == ShaderParamType.Bool)
{
values.Add(stCheckBox1.Checked);
}
if (activeParam.Type == ShaderParamType.Bool2)
{
values.Add(stCheckBox1.Checked);
values.Add(stCheckBox2.Checked);
}
if (activeParam.Type == ShaderParamType.Bool3)
{
values.Add(stCheckBox1.Checked);
values.Add(stCheckBox2.Checked);
values.Add(stCheckBox3.Checked);
}
if (activeParam.Type == ShaderParamType.Bool4)
{
values.Add(stCheckBox1.Checked);
values.Add(stCheckBox2.Checked);
values.Add(stCheckBox3.Checked);
values.Add(stCheckBox4.Checked);
}
activeParam.ValueBool = values.ToArray();
if (OnPanelChanged != null)
OnPanelChanged(activeParam, this);
}
}
}