Updated zEditIntegration to use the new ACompiler

This commit is contained in:
erri120 2019-11-03 17:46:26 +01:00 committed by Timothy Baldridge
parent 8eb2f34faa
commit 45ba7d4bce

View File

@ -14,9 +14,9 @@ namespace Wabbajack.Lib
{
public class zEditIntegration
{
public static string FindzEditPath(Compiler compiler)
public static string FindzEditPath(ACompiler compiler)
{
var executables = compiler.MO2Ini.customExecutables;
var executables = compiler._mo2Compiler.MO2Ini.customExecutables;
if (executables.size == null) return null;
foreach (var idx in Enumerable.Range(1, int.Parse(executables.size)))
@ -35,7 +35,7 @@ namespace Wabbajack.Lib
{
private Dictionary<string, zEditMerge> _mergesIndexed;
public IncludeZEditPatches(Compiler compiler) : base(compiler)
public IncludeZEditPatches(ACompiler compiler) : base(compiler)
{
var zEditPath = FindzEditPath(compiler);
var havezEdit = zEditPath != null;
@ -63,7 +63,7 @@ namespace Wabbajack.Lib
_mergesIndexed =
merges.ToDictionary(
m => Path.Combine(compiler.MO2Folder, "mods", m.Key.name, m.Key.filename),
m => Path.Combine(compiler._mo2Compiler.MO2Folder, "mods", m.Key.name, m.Key.filename),
m => m.First());
}
@ -89,12 +89,12 @@ namespace Wabbajack.Lib
return new SourcePatch
{
RelativePath = abs_path.RelativeTo(_compiler.MO2Folder),
RelativePath = abs_path.RelativeTo(_compiler._mo2Compiler.MO2Folder),
Hash = _compiler.VFS[abs_path].Hash
};
}).ToList();
var src_data = result.Sources.Select(f => File.ReadAllBytes(Path.Combine(_compiler.MO2Folder, f.RelativePath)))
var src_data = result.Sources.Select(f => File.ReadAllBytes(Path.Combine(_compiler._mo2Compiler.MO2Folder, f.RelativePath)))
.ConcatArrays();
var dst_data = File.ReadAllBytes(source.AbsolutePath);
@ -117,7 +117,7 @@ namespace Wabbajack.Lib
[JsonObject("IncludeZEditPatches")]
public class State : IState
{
public ICompilationStep CreateStep(Compiler compiler)
public ICompilationStep CreateStep(ACompiler compiler)
{
return new IncludeZEditPatches(compiler);
}