Fixed some stuff

This commit is contained in:
erri120 2019-11-04 13:30:02 +01:00 committed by Timothy Baldridge
parent 45ba7d4bce
commit 8d650fcbd9
2 changed files with 74 additions and 46 deletions

View File

@ -100,15 +100,18 @@ namespace Wabbajack.Lib
IEnumerable<RawSourceFile> game_files = Directory.EnumerateFiles(GamePath, "*", SearchOption.AllDirectories) IEnumerable<RawSourceFile> game_files = Directory.EnumerateFiles(GamePath, "*", SearchOption.AllDirectories)
.Where(p => p.FileExists()) .Where(p => p.FileExists())
.Select(p => new RawSourceFile(VFS.Lookup(p)) .Select(p => new RawSourceFile(VFS.Lookup(p))
{ Path = Alphaleonis.Win32.Filesystem.Path.Combine(Consts.GameFolderFilesDir, p.RelativeTo(GamePath)) }); { Path = Path.Combine(Consts.GameFolderFilesDir, p.RelativeTo(GamePath)) });
Info("Indexing Archives"); Info("Indexing Archives");
IndexedArchives = Directory.EnumerateFiles(DownloadsFolder) IndexedArchives = Directory.EnumerateFiles(DownloadsFolder)
//.Where(f => File.Exists(f+".meta"))
.Where(File.Exists) .Where(File.Exists)
.Select(f => new IndexedArchive .Select(f => new IndexedArchive
{ {
File = VFS.Lookup(f), File = VFS.Lookup(f),
Name = Path.GetFileName(f) Name = Path.GetFileName(f),
//IniData = (f+"meta").LoadIniFile(),
//Meta = File.ReadAllText(f+".meta")
}) })
.ToList(); .ToList();
@ -131,7 +134,7 @@ namespace Wabbajack.Lib
.Where(fs => fs.Count() > 1) .Where(fs => fs.Count() > 1)
.Select(fs => .Select(fs =>
{ {
Utils.Log($"Duplicate files installed to {fs.Key} from : {String.Join(", ", fs.Select(f => f.AbsolutePath))}"); Utils.Log($"Duplicate files installed to {fs.Key} from : {string.Join(", ", fs.Select(f => f.AbsolutePath))}");
return fs; return fs;
}).ToList(); }).ToList();
@ -205,7 +208,7 @@ namespace Wabbajack.Lib
using (var za = new ZipArchive(fs, ZipArchiveMode.Create)) using (var za = new ZipArchive(fs, ZipArchiveMode.Create))
{ {
Directory.EnumerateFiles(ModListOutputFolder, "*.*") Directory.EnumerateFiles(ModListOutputFolder, "*.*")
.DoProgress("Compressing Modlist", .DoProgress("Compressing ModList",
f => f =>
{ {
var ze = za.CreateEntry(Path.GetFileName(f)); var ze = za.CreateEntry(Path.GetFileName(f));
@ -218,7 +221,7 @@ namespace Wabbajack.Lib
} }
} }
Utils.Log("Removing ModList staging folder"); Utils.Log("Removing ModList staging folder");
Directory.Delete(ModListOutputFolder, true); //Directory.Delete(ModListOutputFolder, true);
} }
private void GatherArchives() private void GatherArchives()
@ -289,11 +292,12 @@ namespace Wabbajack.Lib
//new IncludePropertyFiles(this), //new IncludePropertyFiles(this),
new IgnoreGameFiles(this), new IgnoreGameFiles(this),
new IncludeRegex(this, @".*\.zip?$"),
new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Data")), //new IncludeRegex(this, "*.zip"),
new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Papyrus Compiler")), //new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Data")),
new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Skyrim")), //new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Papyrus Compiler")),
new IgnoreRegex(this, Consts.GameFolderFilesDir + "\\\\.*\\.bsa"), //new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Skyrim")),
//new IgnoreRegex(this, Consts.GameFolderFilesDir + "\\\\.*\\.bsa"),
new DirectMatch(this), new DirectMatch(this),

View File

@ -196,9 +196,31 @@ namespace Wabbajack
private async Task ExecuteBegin() private async Task ExecuteBegin()
{ {
Compiler compiler; if (true)
{
var compiler = new VortexCompiler("darkestdungeon", "S:\\SteamLibrary\\steamapps\\common\\DarkestDungeon");
await Task.Run(() =>
{
UIReady = false;
try try
{ {
compiler.Compile();
}
catch (Exception ex)
{
while (ex.InnerException != null) ex = ex.InnerException;
this.Log().Warn(ex, "Can't continue");
}
finally
{
UIReady = true;
}
});
}else{
if (this.Mo2Folder != null)
{
Compiler compiler;
try {
compiler = new Compiler(this.Mo2Folder) compiler = new Compiler(this.Mo2Folder)
{ {
MO2Profile = this.MOProfile, MO2Profile = this.MOProfile,
@ -239,4 +261,6 @@ namespace Wabbajack
}); });
} }
} }
}
}
} }