1
0
mirror of synced 2024-12-11 07:16:05 +01:00
Switch-Toolbox/Switch_FileFormatsMain/GUI/BFRES/CopyMaterialMenu.cs
2018-11-17 17:33:00 -05:00

54 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Bfres.Structs;
namespace FirstPlugin
{
public partial class CopyMaterialMenu : Form
{
public CopyMaterialMenu()
{
InitializeComponent();
}
private class FmdlTreeTemp : TreeNode
{
public FmdlTreeTemp(string Name)
{
Text = Name;
}
}
public void LoadMaterials(string SelectedMat, List<FMDL> models)
{
foreach (var mdl in models)
{
FmdlTreeTemp model = new FmdlTreeTemp(mdl.Text);
foreach (var mat in mdl.materials.Keys)
{
if (mat != SelectedMat)
model.Nodes.Add(mat);
}
materialTreeView.Nodes.Add(model);
}
}
private void treeView1_AfterCheck(object sender, TreeViewEventArgs e)
{
if (e.Node is FmdlTreeTemp)
{
foreach (TreeNode n in e.Node.Nodes)
{
n.Checked = e.Node.Checked;
}
}
}
}
}