mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Created AddExternalFolder function to index the AdditionalFolders for the game
This commit is contained in:
parent
1d35bf5ed1
commit
80068fdd7d
@ -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}");
|
||||
|
Loading…
Reference in New Issue
Block a user