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

View File

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

View File

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