diff --git a/Wabbajack.Lib/VortexCompiler.cs b/Wabbajack.Lib/VortexCompiler.cs index 0b0c8653..0bb8d99e 100644 --- a/Wabbajack.Lib/VortexCompiler.cs +++ b/Wabbajack.Lib/VortexCompiler.cs @@ -5,6 +5,7 @@ using System.IO.Compression; using System.Linq; using System.Security.Cryptography; using System.Text; +using Microsoft.WindowsAPICodePack.Shell; using VFS; using Wabbajack.Common; using Wabbajack.Lib.CompilationSteps; @@ -111,6 +112,8 @@ namespace Wabbajack.Lib Info($"Indexing {DownloadsFolder}"); VFS.AddRoot(DownloadsFolder); + AddExternalFolder(); + Info("Cleaning output folder"); if (Directory.Exists(ModListOutputFolder)) Directory.Delete(ModListOutputFolder, true); Directory.CreateDirectory(ModListOutputFolder); @@ -223,6 +226,22 @@ namespace Wabbajack.Lib return true; } + /// + /// Some have mods outside their game folder located + /// + private void AddExternalFolder() + { + var currentGame = GameRegistry.Games[Game]; + if (currentGame.AdditionalFolders == null || currentGame.AdditionalFolders.Count == 0) return; + currentGame.AdditionalFolders.Do(f => + { + var path = f.Replace("%documents%", KnownFolders.Documents.Path); + if (!Directory.Exists(path)) return; + Info($"Indexing {path}"); + VFS.AddRoot(path); + }); + } + private void ExportModList() { Utils.Log($"Exporting ModList to: {ModListOutputFolder}");