public static void WriteExternalFiles(ResFile resFile, TreeNode EditorRoot) { resFile.ExternalFiles.Clear(); if (EditorRoot.Nodes.ContainsKey("EXT")) { foreach (TreeNode node in EditorRoot.Nodes["EXT"].Nodes) { ExternalFile ext = new ExternalFile(); if (node is BinaryTextureContainer) { BinaryTextureContainer bntx = (BinaryTextureContainer)node; ext.Data = bntx.Save(); } else if (node is BfshaFileData) { ext.Data = ((BfshaFileData)node).Data; } else { ext.Data = ((ExternalFileData)node).Data; } resFile.ExternalFiles.Add(node.Text, ext); } } }
public byte[] Save() { return(bntx.Save()); }