Fixes for FO4EE recompilation

This commit is contained in:
Timothy Baldridge 2022-08-12 17:03:35 -06:00
parent ee9b61be12
commit 5d04d1336d
3 changed files with 19 additions and 8 deletions

View File

@ -21,6 +21,7 @@ using Wabbajack.Common;
using Wabbajack.Compiler;
using Wabbajack.DTOs;
using Wabbajack.DTOs.JsonConverters;
using Wabbajack.Installer;
using Wabbajack.Models;
using Wabbajack.Networking.WabbajackClientApi;
using Wabbajack.Paths;
@ -249,17 +250,25 @@ namespace Wabbajack
var compiler = MO2Compiler.Create(_serviceProvider, mo2Settings);
compiler.OnStatusUpdate += (sender, update) =>
var events = Observable.FromEventPattern<StatusUpdate>(h => compiler.OnStatusUpdate += h,
h => compiler.OnStatusUpdate -= h)
.Throttle(TimeSpan.FromSeconds(0.5))
.ObserveOnGuiThread()
.Subscribe(update =>
{
RxApp.MainThreadScheduler.Schedule(update, (scheduler, update) =>
{
StatusText = update.StatusText;
StatusProgress = update.StepsProgress;
return Disposable.Empty;
StatusText = update.EventArgs.StatusText;
StatusProgress = update.EventArgs.StepsProgress;
});
};
try
{
await compiler.Begin(token);
}
finally
{
events.Dispose();
}
if (PublishUpdate)
{

View File

@ -392,6 +392,7 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM, ICpuStatusVM
catch (Exception ex)
{
TaskBarUpdate.Send($"Error during install of {ModList.Name}", TaskbarItemProgressState.Error);
_logger.LogError(ex, ex.Message);
InstallState = InstallState.Failure;
StatusText = $"Error during install of {ModList.Name}";
StatusProgress = Percent.Zero;

View File

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