mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Can extract .fomod files (again)
This commit is contained in:
@ -168,6 +168,21 @@ namespace Wabbajack.VirtualFileSystem.Test
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task CanExtractFOMODFiles()
|
||||||
|
{
|
||||||
|
var tmpFolder = await TempFolder.Create();
|
||||||
|
var src = await DownloadMod(Game.FalloutNewVegas, 52510);
|
||||||
|
var newName = src.FileName.RelativeTo(tmpFolder.Dir);
|
||||||
|
await src.CopyToAsync(newName);
|
||||||
|
|
||||||
|
var ctx = new Context(_queue);
|
||||||
|
await ctx.AddRoot(tmpFolder.Dir);
|
||||||
|
|
||||||
|
Assert.NotEmpty(ctx.Index.ByName.Where(f => f.Key.FileName == (RelativePath)"Alternative Repairing.esp"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task SmallZipNoLongerCrashes()
|
public async Task SmallZipNoLongerCrashes()
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,8 @@ namespace Wabbajack.VirtualFileSystem
|
|||||||
Definitions.FileType._7Z);
|
Definitions.FileType._7Z);
|
||||||
|
|
||||||
private static Extension OMODExtension = new Extension(".omod");
|
private static Extension OMODExtension = new Extension(".omod");
|
||||||
|
private static Extension FOMODExtension = new Extension(".fomod");
|
||||||
|
|
||||||
private static Extension BSAExtension = new Extension(".bsa");
|
private static Extension BSAExtension = new Extension(".bsa");
|
||||||
|
|
||||||
public static readonly HashSet<Extension> ExtractableExtensions = new HashSet<Extension>
|
public static readonly HashSet<Extension> ExtractableExtensions = new HashSet<Extension>
|
||||||
@ -37,7 +39,8 @@ namespace Wabbajack.VirtualFileSystem
|
|||||||
new Extension(".7zip"),
|
new Extension(".7zip"),
|
||||||
new Extension(".rar"),
|
new Extension(".rar"),
|
||||||
new Extension(".zip"),
|
new Extension(".zip"),
|
||||||
OMODExtension
|
OMODExtension,
|
||||||
|
FOMODExtension
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -109,7 +112,7 @@ namespace Wabbajack.VirtualFileSystem
|
|||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<Dictionary<RelativePath,T>> GatheringExtractWithOMOD<T>(Stream archive, Predicate<RelativePath> shouldExtract, Func<RelativePath,IExtractedFile,ValueTask<T>> mapfn)
|
private static async Task<Dictionary<RelativePath,T>> GatheringExtractWithOMOD<T>(Stream archive, Predicate<RelativePath> shouldExtract, Func<RelativePath,IExtractedFile,ValueTask<T>> mapfn)
|
||||||
{
|
{
|
||||||
var tmpFile = new TempFile();
|
var tmpFile = new TempFile();
|
||||||
@ -119,7 +122,7 @@ namespace Wabbajack.VirtualFileSystem
|
|||||||
|
|
||||||
Framework.Settings.TempPath = (string)dest.Dir;
|
Framework.Settings.TempPath = (string)dest.Dir;
|
||||||
Framework.Settings.CodeProgress = new OMODProgress();
|
Framework.Settings.CodeProgress = new OMODProgress();
|
||||||
|
|
||||||
var omod = new OMOD((string)tmpFile.Path);
|
var omod = new OMOD((string)tmpFile.Path);
|
||||||
omod.GetDataFiles();
|
omod.GetDataFiles();
|
||||||
omod.GetPlugins();
|
omod.GetPlugins();
|
||||||
|
Reference in New Issue
Block a user