Switch-Toolbox/Switch_FileFormatsMain/GUI/BFRES/BfresShaderParams/BoolValuesPanel.cs
KillzXGaming 716d1c4520 More clean up and additions
- Starting to make all texture classes use STGenericTexture. This will make all functions usable between each one and converting through other classes much easier.
- Many bug fixes to the texture importer like duped texture importing, dds opening the window, index out of range issues, etc.
- Start on titlebar information.
- Start on ASTC texture format support.
- Support TGA images.
- Support FTEX importing and saving properly.
- Export models properly along with textures (with generic classes). Todo, support rigs and bones.
2018-12-10 18:48:51 -05:00

81 lines
2.3 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 Switch_Toolbox.Library;
using Bfres.Structs;
using Syroot.NintenTools.NSW.Bfres;
namespace FirstPlugin
{
public partial class BoolValuesPanel : UserControl
{
public BoolValuesPanel()
{
InitializeComponent();
}
public void SetValues(BfresShaderParam param)
{
switch (param.Type)
{
case ShaderParamType.Bool:
param.ValueBool = new bool[] { bool1.Visible};
break;
case ShaderParamType.Bool2:
param.ValueBool = new bool[] { bool1.Visible, bool2.Visible };
break;
case ShaderParamType.Bool3:
param.ValueBool = new bool[] { bool1.Visible, bool2.Visible,
bool3.Visible };
break;
case ShaderParamType.Bool4:
param.ValueBool = new bool[] { bool1.Visible, bool2.Visible,
bool3.Visible , bool4.Visible };
break;
}
}
public void LoadValues(bool[] values)
{
bool1.Visible = false;
bool2.Visible = false;
bool3.Visible = false;
bool4.Visible = false;
if (values.Length >= 1)
{
bool1.Visible = true;
bool1.Checked = values[0];
}
if (values.Length >= 2)
{
bool2.Visible = true;
bool2.Checked = values[1];
}
if (values.Length >= 3)
{
bool3.Visible = true;
bool3.Checked = values[2];
}
if (values.Length >= 4)
{
bool4.Visible = true;
bool4.Checked = values[3];
}
}
private void BoolValuesPanel_Load(object sender, EventArgs e)
{
}
private void bool_CheckedChanged(object sender, EventArgs e)
{
Viewport.Instance.UpdateViewport();
}
}
}