Merge pull request #201 from alexguirre/frame-filters

Support YFD XML import/export
This commit is contained in:
dexyfex
2023-08-21 14:27:20 +10:00
committed by GitHub
Unverified
7 changed files with 472 additions and 39 deletions
+3 -3
View File
@@ -281,7 +281,7 @@ namespace CodeWalker
InitFileType(".fxc", "Compiled Shaders", 9, FileTypeAction.ViewFxc, true);
InitFileType(".yed", "Expression Dictionary", 9, FileTypeAction.ViewYed, true);
InitFileType(".yld", "Cloth Dictionary", 9, FileTypeAction.ViewYld, true);
InitFileType(".yfd", "Frame Filter Dictionary", 9, FileTypeAction.ViewYfd);
InitFileType(".yfd", "Frame Filter Dictionary", 9, FileTypeAction.ViewYfd, true);
InitFileType(".asi", "ASI Plugin", 9);
InitFileType(".dll", "Dynamic Link Library", 9);
InitFileType(".exe", "Executable", 10);
@@ -1772,9 +1772,9 @@ namespace CodeWalker
private void ViewYfd(string name, string path, byte[] data, RpfFileEntry e)
{
var yfd = RpfFile.GetFile<YfdFile>(e, data);
GenericForm f = new GenericForm(this);
MetaForm f = new MetaForm(this);
f.Show();
f.LoadFile(yfd, yfd.RpfFileEntry);
f.LoadMeta(yfd);
}
private void ViewCacheDat(string name, string path, byte[] data, RpfFileEntry e)
{
+14
View File
@@ -388,6 +388,20 @@ namespace CodeWalker.Forms
metaFormat = MetaFormat.Ypdb;
}
}
public void LoadMeta(YfdFile yfd)
{
var fn = ((yfd?.RpfFileEntry?.Name) ?? "") + ".xml";
Xml = MetaXml.GetXml(yfd, out fn);
FileName = fn;
RawPropertyGrid.SelectedObject = yfd;
rpfFileEntry = yfd?.RpfFileEntry;
modified = false;
metaFormat = MetaFormat.XML;
if (yfd?.RpfFileEntry != null)
{
metaFormat = MetaFormat.Yfd;
}
}
public void LoadMeta(MrfFile mrf)
{
var fn = ((mrf?.RpfFileEntry?.Name) ?? "") + ".xml";