Skip to content

Commit

Permalink
hotfix: fnis parsing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Monitor221hz committed Jul 21, 2024
1 parent ab8b0db commit 4a1b94a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
24 changes: 19 additions & 5 deletions PandoraPlus/MVVM/Model/Patch/Patchers/Skyrim/FNIS/FNISParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public class FNISParser

private HashSet<string> parsedFolders = new HashSet<string>(StringComparer.OrdinalIgnoreCase);

public HashSet<FNISModInfo> ModInfos { get; private set; } = new HashSet<FNISModInfo>();
public HashSet<IModInfo> ModInfos { get; private set; } = new HashSet<IModInfo>();

public FNISParser(ProjectManager manager)
{
Expand All @@ -112,7 +112,14 @@ public void ScanProjectAnimlist(Project project)

foreach (var modFile in modFiles)
{
InjectGraphReference(modFile, project.BehaviorFile);
try
{
InjectGraphReference(modFile, project.BehaviorFile);
}
catch
{
logger.Warn($"FNIS Parser > Inject > Behavior > {modFile.Name} > FAILED");
}
}
if (!animationsFolder.Exists) { return; }
var modAnimationFolders = animationsFolder.GetDirectories();
Expand Down Expand Up @@ -178,10 +185,17 @@ private void ParseAnimlistFolder(DirectoryInfo folder, Project project, ProjectM
List<FNISAnimationList> animLists = new();
foreach (var animlistFile in animlistFiles)
{
animLists.Add(FNISAnimationList.FromFile(animlistFile));
try
{
FNISAnimationList animList = FNISAnimationList.FromFile(animlistFile);
ModInfos.Add(animList.ModInfo);
animLists.Add(animList);
}
catch
{
logger.Warn($"FNIS Parser > Serialize > Animlist > {animlistFile.Name} > FAILED");
}
}
Parallel.ForEach(animLists, animlist => { animlist.BuildPatches(project, projectManager, patchNodeCreator); });
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ public void GetFNISInfo(StringBuilder builder)
foreach(IModInfo modInfo in fnisParser.ModInfos)
{
fnisModCount++;
builder.AppendLine($"FNIS Mod {fnisModCount} : {modInfo.Name}");
Logger.Info($"FNIS Mod {fnisModCount} : {modInfo.Name}");
builder.AppendLine($"FNIS Mod {fnisModCount} : {modInfo.Code}");
Logger.Info($"FNIS Mod {fnisModCount} : {modInfo.Code}");
}
}

Expand Down Expand Up @@ -368,8 +368,6 @@ public bool ApplyPatches()
{
packFileCache.DeletePackFileOutput();



Parallel.ForEach(ActivePackFiles, packFile =>
{
packFile.ApplyChanges();
Expand Down

0 comments on commit 4a1b94a

Please sign in to comment.