Fixes for Wildlander

This commit is contained in:
Timothy Baldridge 2022-08-09 05:54:21 -06:00
parent e28536513c
commit c62a2a9979
5 changed files with 30 additions and 18 deletions

View File

@ -45,6 +45,7 @@ public class ResourceMonitor : IDisposable
.DisposeWith(_compositeDisposable);
_tasks.Connect()
.Filter(x => x.IsWorking)
.Bind(out _tasksFiltered)
.Subscribe()
.DisposeWith(_compositeDisposable);
@ -64,7 +65,7 @@ public class ResourceMonitor : IDisposable
var used = new HashSet<ulong>();
foreach (var resource in _resources)
{
foreach (var job in resource.Jobs)
foreach (var job in resource.Jobs.Where(j => j.Current > 0))
{
used.Add(job.ID);
var tsk = l.Lookup(job.ID);

View File

@ -270,10 +270,15 @@ namespace Wabbajack
}
_logger.LogInformation("Compiler Finished");
StatusText = "Compilation Completed";
StatusProgress = Percent.Zero;
RxApp.MainThreadScheduler.Schedule(_logger, (_, _) =>
{
StatusText = "Compilation Completed";
StatusProgress = Percent.Zero;
State = CompilerState.Completed;
return Disposable.Empty;
});
State = CompilerState.Completed;
}
catch (Exception ex)
{

View File

@ -64,10 +64,14 @@ public class CompilerSettingsInferencer
cs.Downloads = cs.Source.Combine("downloads");
cs.NoMatchInclude = Array.Empty<RelativePath>();
cs.Include = Array.Empty<RelativePath>();
foreach (var file in mo2Folder.EnumerateFiles())
{
if (file.FileName == Consts.WABBAJACK_NOMATCH_INCLUDE_FILES)
cs.NoMatchInclude = cs.NoMatchInclude.Add(file.Parent.RelativeTo(mo2Folder));
if (file.FileName.WithoutExtension().ToString() == Consts.WABBAJACK_INCLUDE)
cs.Include = cs.Include.Add(file.Parent.RelativeTo(mo2Folder));
}
_logger.LogInformation("Finding Always Enabled mods");

View File

@ -105,6 +105,7 @@ public class ImageLoader
DXGI_FORMAT.BC4_UNORM => CompressionFormat.Bc4,
DXGI_FORMAT.BC5_UNORM => CompressionFormat.Bc5,
DXGI_FORMAT.BC7_UNORM => CompressionFormat.Bc7,
DXGI_FORMAT.B8G8R8A8_UNORM => CompressionFormat.Bgra,
_ => throw new Exception($"Cannot re-encode texture with {dx} format, encoding not supported")
};
}

View File

@ -486,24 +486,25 @@ public abstract class AInstaller<T>
var savePath = (RelativePath) "saves";
NextStep(Consts.StepPreparing, "Looking for files to delete", 0);
foreach (var f in _configuration.Install.EnumerateFiles())
{
var relativeTo = f.RelativeTo(_configuration.Install);
if (indexed.ContainsKey(relativeTo) || f.InFolder(_configuration.Downloads))
return;
await _configuration.Install.EnumerateFiles()
.PDoAll(_limiter, async f =>
{
var relativeTo = f.RelativeTo(_configuration.Install);
if (indexed.ContainsKey(relativeTo) || f.InFolder(_configuration.Downloads))
return ;
if (f.InFolder(profileFolder) && f.Parent.FileName == savePath) return;
if (f.InFolder(profileFolder) && f.Parent.FileName == savePath) return;
if (NoDeleteRegex.IsMatch(f.ToString()))
return;
if (NoDeleteRegex.IsMatch(f.ToString()))
return ;
if (bsaPathsToNotBuild.Contains(f))
return;
if (bsaPathsToNotBuild.Contains(f))
return ;
_logger.LogInformation("Deleting {RelativePath} it's not part of this ModList", relativeTo);
f.Delete();
});
_logger.LogInformation("Deleting {RelativePath} it's not part of this ModList", relativeTo);
f.Delete();
}
_logger.LogInformation("Cleaning empty folders");
var expectedFolders = indexed.Keys
.Select(f => f.RelativeTo(_configuration.Install))