1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Fix importing new materials for wii u

This commit is contained in:
KillzXGaming 2019-06-03 16:56:36 -04:00
parent 4a32ffb3fb
commit 270d6d3089
8 changed files with 21 additions and 5 deletions

Binary file not shown.

View File

@ -1122,16 +1122,32 @@ namespace Bfres.Structs
materials.Clear();
Nodes["FmatFolder"].Nodes.Clear();
}
FMAT mat = new FMAT();
mat.Material = new Material();
mat.Material.Import(FileName);
mat.ReadMaterial(mat.Material);
List<string> keyList = new List<string>(this.materials.Keys);
mat.Material.Name = Utils.RenameDuplicateString(keyList, mat.Material.Name);
if (GetResFileU() != null)
{
mat.MaterialU = new ResU.Material();
mat.MaterialU.Import(FileName, GetResFileU());
mat.MaterialU.Name = Utils.RenameDuplicateString(keyList, mat.MaterialU.Name);
mat.Text = mat.MaterialU.Name;
mat.ReadMaterial(mat.MaterialU);
}
else
{
mat.Material = new Material();
mat.Material.Import(FileName);
mat.Material.Name = Utils.RenameDuplicateString(keyList, mat.Material.Name);
mat.Text = mat.Material.Name;
mat.ReadMaterial(mat.Material);
}
keyList.Clear();
mat.Text = mat.Material.Name;
materials.Add(mat.Text, mat);
Nodes["FmatFolder"].Nodes.Add(mat);