Added OMODFramework as normal package dependency

This commit is contained in:
erri120 2020-02-14 19:19:51 +01:00
parent 8b916ce7ba
commit bc163590c2
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135
2 changed files with 29 additions and 5 deletions

View File

@ -10,7 +10,7 @@ using Alphaleonis.Win32.Filesystem;
using Compression.BSA;
using ICSharpCode.SharpZipLib.GZip;
using Newtonsoft.Json;
using OMODExtraction;
using OMODFramework;
using Wabbajack.Common.StatusFeed;
using Wabbajack.Common.StatusFeed.Errors;
@ -96,13 +96,36 @@ namespace Wabbajack.Common
Utils.Log($"Extraction error extracting {source}");
}
private static string ExtractAllWithOMOD(string source, string dest)
private class OMODProgress : ICodeProgress
{
private long _total;
public void SetProgress(long inSize, long outSize)
{
Utils.Status("Extracting OMOD", Percent.FactoryPutInRange(inSize, _total));
}
public void Init(long totalSize, bool compressing)
{
_total = totalSize;
}
public void Dispose()
{
//
}
}
private static void ExtractAllWithOMOD(string source, string dest)
{
Utils.Log($"Extracting {Path.GetFileName(source)}");
Framework.Settings.TempPath = dest;
Framework.Settings.CodeProgress = new OMODProgress();
var omod = new OMOD(source);
omod.ExtractDataFiles();
omod.ExtractPlugins();
return dest;
omod.GetDataFiles();
omod.GetPlugins();
}

View File

@ -36,6 +36,7 @@
<PackageReference Include="ini-parser-netstandard" Version="2.5.2" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="OMODFramework" Version="2.0.0" />
<PackageReference Include="ReactiveUI" Version="11.1.23" />
<PackageReference Include="SharpZipLib" Version="1.2.0" />
<PackageReference Include="System.Data.HashFunction.xxHash" Version="2.0.0" />