This commit is contained in:
Timothy Baldridge 2022-08-20 08:26:54 -06:00
parent 40917df822
commit 35cabfa540
7 changed files with 35 additions and 18 deletions

View File

@ -1,7 +1,10 @@
### Changelog ### Changelog
#### Version - 3.0.0.3 - #### Version - 3.0.0.3 - 8/20/2022
* Properly detect the program version * Properly detect the program version
* Fix how the download folder is set in MO2 during installation
* During compilation, output location is now selected as a folder not a file
* Fix several CTD issues inside WJ itself
#### Version - 3.0.0.2 - 8/19/2022 #### Version - 3.0.0.2 - 8/19/2022
* Be more tolerant of bad picture Urls while validating Nexus Downloads (thanks ForgottenGlory) * Be more tolerant of bad picture Urls while validating Nexus Downloads (thanks ForgottenGlory)

View File

@ -9,6 +9,8 @@ using DynamicData.Binding;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using NLog; using NLog;
using NLog.Targets; using NLog.Targets;
using ReactiveUI;
using Wabbajack.Extensions;
using LogLevel = NLog.LogLevel; using LogLevel = NLog.LogLevel;
namespace Wabbajack.Models; namespace Wabbajack.Models;
@ -34,8 +36,14 @@ public class LogStream : TargetWithLayout
.DisposeWith(_disposables); .DisposeWith(_disposables);
Messages Messages
.ObserveOnGuiThread() .Subscribe(m =>
.Subscribe(m => _messageLog.AddOrUpdate(m)) {
RxApp.MainThreadScheduler.Schedule(m, (_, message) =>
{
_messageLog.AddOrUpdate(message);
return Disposable.Empty;
});
})
.DisposeWith(_disposables); .DisposeWith(_disposables);
_messages.DisposeWith(_disposables); _messages.DisposeWith(_disposables);

View File

@ -81,6 +81,7 @@ namespace Wabbajack
this.WhenAny(x => x.TargetPath) this.WhenAny(x => x.TargetPath)
// Dont want to debounce the initial value, because we know it's null // Dont want to debounce the initial value, because we know it's null
.Skip(1) .Skip(1)
.ObserveOnGuiThread()
.Debounce(TimeSpan.FromMilliseconds(200), RxApp.MainThreadScheduler) .Debounce(TimeSpan.FromMilliseconds(200), RxApp.MainThreadScheduler)
.StartWith(default(AbsolutePath)), .StartWith(default(AbsolutePath)),
resultSelector: (existsOption, type, path) => (ExistsOption: existsOption, Type: type, Path: path)) resultSelector: (existsOption, type, path) => (ExistsOption: existsOption, Type: type, Path: path))

View File

@ -147,11 +147,10 @@ namespace Wabbajack
OutputLocation = new FilePickerVM OutputLocation = new FilePickerVM
{ {
ExistCheckOption = FilePickerVM.CheckOptions.Off, ExistCheckOption = FilePickerVM.CheckOptions.Off,
PathType = FilePickerVM.PathTypeOptions.File, PathType = FilePickerVM.PathTypeOptions.Folder,
PromptTitle = "Location where the compiled modlist will be stored" PromptTitle = "Location where the compiled modlist will be stored"
}; };
OutputLocation.Filters.Add(new CommonFileDialogFilter(".wabbajack", "*.wabbajack"));
ModlistLocation.Filters.AddRange(new [] ModlistLocation.Filters.AddRange(new []
{ {
new CommonFileDialogFilter("MO2 Modlist", "*" + Ext.Txt), new CommonFileDialogFilter("MO2 Modlist", "*" + Ext.Txt),
@ -227,6 +226,8 @@ namespace Wabbajack
Source = settings.Source; Source = settings.Source;
DownloadLocation.TargetPath = settings.Downloads; DownloadLocation.TargetPath = settings.Downloads;
if (settings.OutputFile.Extension == Ext.Wabbajack)
settings.OutputFile = settings.OutputFile.Parent;
OutputLocation.TargetPath = settings.OutputFile; OutputLocation.TargetPath = settings.OutputFile;
SelectedProfile = settings.Profile; SelectedProfile = settings.Profile;
PublishUpdate = settings.PublishUpdate; PublishUpdate = settings.PublishUpdate;
@ -251,6 +252,9 @@ namespace Wabbajack
var mo2Settings = GetSettings(); var mo2Settings = GetSettings();
mo2Settings.UseGamePaths = true; mo2Settings.UseGamePaths = true;
if (mo2Settings.OutputFile.DirectoryExists())
mo2Settings.OutputFile = mo2Settings.OutputFile.Combine(mo2Settings.ModListName.ToRelativePath()
.WithExtension(Ext.Wabbajack));
if (PublishUpdate && !await RunPreflightChecks(token)) if (PublishUpdate && !await RunPreflightChecks(token))
{ {
@ -262,8 +266,8 @@ namespace Wabbajack
var events = Observable.FromEventPattern<StatusUpdate>(h => compiler.OnStatusUpdate += h, var events = Observable.FromEventPattern<StatusUpdate>(h => compiler.OnStatusUpdate += h,
h => compiler.OnStatusUpdate -= h) h => compiler.OnStatusUpdate -= h)
.Debounce(TimeSpan.FromSeconds(0.5))
.ObserveOnGuiThread() .ObserveOnGuiThread()
.Debounce(TimeSpan.FromSeconds(0.5))
.Subscribe(update => .Subscribe(update =>
{ {
var s = update.EventArgs; var s = update.EventArgs;
@ -302,12 +306,15 @@ namespace Wabbajack
} }
catch (Exception ex) catch (Exception ex)
{ {
StatusText = "Compilation Failed"; RxApp.MainThreadScheduler.Schedule(_logger, (_, _) =>
StatusProgress = Percent.Zero; {
StatusText = "Compilation Failed";
StatusProgress = Percent.Zero;
State = CompilerState.Errored;
State = CompilerState.Errored; _logger.LogInformation(ex, "Failed Compilation : {Message}", ex.Message);
_logger.LogInformation(ex, "Failed Compilation : {Message}", ex.Message); return Disposable.Empty;
});
} }
}); });

View File

@ -57,7 +57,7 @@ namespace Wabbajack
CompilationComplete.GoToModlistButton.Command = ReactiveCommand.Create(() => CompilationComplete.GoToModlistButton.Command = ReactiveCommand.Create(() =>
{ {
UIUtils.OpenFolder(ViewModel.OutputLocation.TargetPath.Parent); UIUtils.OpenFolder(ViewModel.OutputLocation.TargetPath);
}).DisposeWith(disposables); }).DisposeWith(disposables);
ViewModel.WhenAnyValue(vm => vm.BackCommand) ViewModel.WhenAnyValue(vm => vm.BackCommand)
@ -169,9 +169,7 @@ namespace Wabbajack
this.Bind(ViewModel, vm => vm.MachineUrl, view => view.MachineUrl.Text) this.Bind(ViewModel, vm => vm.MachineUrl, view => view.MachineUrl.Text)
.DisposeWith(disposables); .DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.StatusText, view => view.TopProgressBar.Title)
.DisposeWith(disposables);
ViewModel.WhenAnyValue(vm => vm.StatusText) ViewModel.WhenAnyValue(vm => vm.StatusText)
.BindToStrict(this, view => view.TopProgressBar.Title) .BindToStrict(this, view => view.TopProgressBar.Title)

View File

@ -55,7 +55,7 @@ public class CompilerSettingsInferencer
cs.ModListName = selectedProfile; cs.ModListName = selectedProfile;
cs.Profile = selectedProfile; cs.Profile = selectedProfile;
cs.OutputFile = cs.Source.Parent.Combine(selectedProfile).WithExtension(Ext.Wabbajack); cs.OutputFile = cs.Source.Parent;
var settings = iniData["Settings"]; var settings = iniData["Settings"];
cs.Downloads = settings["download_directory"].FromMO2Ini().ToAbsolutePath(); cs.Downloads = settings["download_directory"].FromMO2Ini().ToAbsolutePath();

View File

@ -162,7 +162,7 @@ public class StandardInstaller : AInstaller<StandardInstaller>
var iniData = iniFile.LoadIniFile(); var iniData = iniFile.LoadIniFile();
var settings = iniData["Settings"]; var settings = iniData["Settings"];
settings["download_directory"] = _configuration.Downloads.ToString(); settings["download_directory"] = _configuration.Downloads.ToString().Replace("\\", "/");
iniData.SaveIniFile(iniFile); iniData.SaveIniFile(iniFile);
} }