From 979e261eb30f4e8e440b5277ccd7868bf1a96850 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Wed, 17 Aug 2022 16:26:08 -0600 Subject: [PATCH] Change out how we set resource settings --- Wabbajack.App.Wpf/Util/UIUtils.cs | 8 ++ .../Settings/PerformanceSettingsView.xaml | 73 +------------------ .../Settings/PerformanceSettingsView.xaml.cs | 40 ++-------- 3 files changed, 18 insertions(+), 103 deletions(-) diff --git a/Wabbajack.App.Wpf/Util/UIUtils.cs b/Wabbajack.App.Wpf/Util/UIUtils.cs index 431a9f92..152de857 100644 --- a/Wabbajack.App.Wpf/Util/UIUtils.cs +++ b/Wabbajack.App.Wpf/Util/UIUtils.cs @@ -172,5 +172,13 @@ namespace Wabbajack return String.Format("{0:0.##} {1}", dblSByte, Suffix[i]); } + + public static void OpenFile(AbsolutePath file) + { + Process.Start(new ProcessStartInfo("cmd.exe", $"/c start \"\" \"{file}\"") + { + CreateNoWindow = true, + }); + } } } diff --git a/Wabbajack.App.Wpf/Views/Settings/PerformanceSettingsView.xaml b/Wabbajack.App.Wpf/Views/Settings/PerformanceSettingsView.xaml index 3f6623d8..7b23be3e 100644 --- a/Wabbajack.App.Wpf/Views/Settings/PerformanceSettingsView.xaml +++ b/Wabbajack.App.Wpf/Views/Settings/PerformanceSettingsView.xaml @@ -41,76 +41,9 @@ FontSize="20" FontWeight="Bold" Text="Performance" /> - - - - - - - - - - - - - - + diff --git a/Wabbajack.App.Wpf/Views/Settings/PerformanceSettingsView.xaml.cs b/Wabbajack.App.Wpf/Views/Settings/PerformanceSettingsView.xaml.cs index 7c672b10..efed2027 100644 --- a/Wabbajack.App.Wpf/Views/Settings/PerformanceSettingsView.xaml.cs +++ b/Wabbajack.App.Wpf/Views/Settings/PerformanceSettingsView.xaml.cs @@ -1,21 +1,6 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive.Disposables; -using System.Reactive.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; using ReactiveUI; -using Wabbajack.Common; +using Wabbajack.Paths.IO; namespace Wabbajack { @@ -30,23 +15,12 @@ namespace Wabbajack this.WhenActivated(disposable => { - // Bind Values - this.BindStrict(this.ViewModel, x => x.DiskThreads, x => x.DiskThreads.Value, - vmToViewConverter: x => x, - viewToVmConverter: x => (int)(x ?? 0)) - .DisposeWith(disposable); - this.BindStrict(this.ViewModel, x => x.DownloadThreads, x => x.DownloadThreads.Value, - vmToViewConverter: x => x, - viewToVmConverter: x => (int)(x ?? 0)) - .DisposeWith(disposable); - this.BindStrict(this.ViewModel, x => x.ReduceHDDThreads, x => x.ReduceHDDThreads.IsChecked) - .DisposeWith(disposable); - this.BindStrict(this.ViewModel, x => x.FavorPerfOverRam, x => x.FavorPerfOverRam.IsChecked) - .DisposeWith(disposable); - this.BindStrict(this.ViewModel, x => x.NetworkWorkaroundMode, x => x.UseNetworkWorkAround.IsChecked) - .DisposeWith(disposable); - this.BindStrict(this.ViewModel, x => x.DisableTextureResizing, x => x.DisableTextureResizing.IsChecked) - .DisposeWith(disposable); + this.EditResourceSettings.Command = ReactiveCommand.Create(() => + { + UIUtils.OpenFile( + KnownFolders.WabbajackAppLocal.Combine("saved_settings", "resource_settings.json")); + Environment.Exit(0); + }); }); } }