Created AddExternalFolder function to index the AdditionalFolders for the game

This commit is contained in:
erri120 2019-11-09 21:35:08 +01:00 committed by Timothy Baldridge
parent 1d35bf5ed1
commit 80068fdd7d

View File

@ -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;
}
/// <summary>
/// Some have mods outside their game folder located
/// </summary>
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}");