1
0
mirror of synced 2024-12-04 03:57:20 +01:00
Switch-Toolbox/Switch_FileFormatsMain/GUI/BFRES/Materials/Presets/MaterialPresetDialog.cs

49 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Switch_Toolbox.Library.Forms;
using Switch_Toolbox.Library;
namespace FirstPlugin.Forms
{
public partial class MaterialPresetDialog : STForm
{
public MaterialPresetDialog()
{
InitializeComponent();
}
private void MaterialPresetDialog_Load(object sender, EventArgs e) {
ReloadMaterials();
}
public void ReloadMaterials()
{
string PresetPath = Path.Combine(Runtime.ExecutableDir, "Presets");
string MaterialPath = Path.Combine(PresetPath, "Materials");
foreach (var directory in Directory.GetDirectories(MaterialPath))
{
TreeNode GameFolder = new TreeNode(Path.GetFileName(directory));
treeViewCustom1.Nodes.Add(GameFolder);
foreach (var file in Directory.GetFiles(directory))
{
TreeNode MaterailPreset = new TreeNode(Path.GetFileName(file));
MaterailPreset.ImageKey = "material";
MaterailPreset.SelectedImageKey = "material";
MaterailPreset.Tag = file;
GameFolder.Nodes.Add(MaterailPreset);
}
}
}
}
}