From 6ae9a1ec04c0f976245c0f458aba73a7480184e0 Mon Sep 17 00:00:00 2001 From: shananas Date: Wed, 6 Dec 2023 01:13:49 -0500 Subject: [PATCH] Remove leftover Lua Engine vardiables --- .../ViewModels/MainViewModel.cs | 26 +++++++++---------- .../ViewModels/SetupWizardViewModel.cs | 17 ++---------- 2 files changed, 14 insertions(+), 29 deletions(-) diff --git a/OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs b/OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs index 5ee487c27..73c850c14 100644 --- a/OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs +++ b/OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs @@ -1,4 +1,3 @@ -using Octokit; using OpenKh.Common; using OpenKh.Tools.Common.Wpf; using OpenKh.Tools.ModsManager.Models; @@ -29,7 +28,7 @@ public class MainViewModel : BaseNotifyPropertyChanged, IChangeModEnableState private static Version _version = Assembly.GetEntryAssembly()?.GetName()?.Version; private static string ApplicationName = Utilities.GetApplicationName(); private static string ApplicationVersion = Utilities.GetApplicationVersion(); - private Window Window => System.Windows.Application.Current.Windows.OfType().FirstOrDefault(x => x.IsActive); + private Window Window => Application.Current.Windows.OfType().FirstOrDefault(x => x.IsActive); private DebuggingWindow _debuggingWindow = new DebuggingWindow(); private ModViewModel _selectedValue; @@ -68,8 +67,7 @@ public class MainViewModel : BaseNotifyPropertyChanged, IChangeModEnableState public static bool overwriteMod = false; public string Title => ApplicationName; - public string CurrentVersion => ApplicationVersion; - public static Release releases = new GitHubClient(new ProductHeaderValue("LuaEngine.exe")).Repository.Release.GetLatest(owner: "TopazTK", name: "LuaEngine").Result; + public string CurrentVersion => ApplicationVersion; public ObservableCollection ModsList { get; set; } public ObservableCollection PresetList { get; set; } public RelayCommand ExitCommand { get; set; } @@ -269,7 +267,7 @@ public bool IsBuilding set { _isBuilding = value; - System.Windows.Application.Current.Dispatcher.Invoke(() => + Application.Current.Dispatcher.Invoke(() => { OnPropertyChanged(nameof(BuildCommand)); OnPropertyChanged(nameof(BuildAndRunCommand)); @@ -322,7 +320,7 @@ public MainViewModel() var name = view.RepositoryName; var isZipFile = view.IsZipFile; var isLuaFile = view.IsLuaFile; - progressWindow = System.Windows.Application.Current.Dispatcher.Invoke(() => + progressWindow = Application.Current.Dispatcher.Invoke(() => { var progressWindow = new InstallModProgressWindow { @@ -335,14 +333,14 @@ public MainViewModel() }); await ModsService.InstallMod(name, isZipFile, isLuaFile, progress => { - System.Windows.Application.Current.Dispatcher.Invoke(() => progressWindow.ProgressText = progress); + Application.Current.Dispatcher.Invoke(() => progressWindow.ProgressText = progress); }, nProgress => { - System.Windows.Application.Current.Dispatcher.Invoke(() => progressWindow.ProgressValue = nProgress); + Application.Current.Dispatcher.Invoke(() => progressWindow.ProgressValue = nProgress); }); var actualName = isZipFile || isLuaFile ? Path.GetFileNameWithoutExtension(name) : name; var mod = ModsService.GetMods(new string[] { actualName }).First(); - System.Windows.Application.Current.Dispatcher.Invoke(() => + Application.Current.Dispatcher.Invoke(() => { progressWindow.Close(); if (overwriteMod) @@ -362,7 +360,7 @@ await ModsService.InstallMod(name, isZipFile, isLuaFile, progress => } finally { - System.Windows.Application.Current.Dispatcher.Invoke(() => progressWindow?.Close()); + Application.Current.Dispatcher.Invoke(() => progressWindow?.Close()); } }); }, _ => true); @@ -514,7 +512,7 @@ await ModsService.InstallMod(name, isZipFile, isLuaFile, progress => public void CloseAllWindows() { CloseRunningProcess(); - System.Windows.Application.Current.Dispatcher.Invoke(_debuggingWindow.Close); + Application.Current.Dispatcher.Invoke(_debuggingWindow.Close); } public void CloseRunningProcess() @@ -533,9 +531,9 @@ public void CloseRunningProcess() private void ResetLogWindow() { if (_debuggingWindow != null) - System.Windows.Application.Current.Dispatcher.Invoke(_debuggingWindow.Close); + Application.Current.Dispatcher.Invoke(_debuggingWindow.Close); _debuggingWindow = new DebuggingWindow(); - System.Windows.Application.Current.Dispatcher.Invoke(_debuggingWindow.Show); + Application.Current.Dispatcher.Invoke(_debuggingWindow.Show); _debuggingWindow.ClearLogs(); } @@ -936,7 +934,7 @@ private async Task FetchUpdates() if (mod == null) continue; - System.Windows.Application.Current.Dispatcher.Invoke(() => + Application.Current.Dispatcher.Invoke(() => mod.UpdateCount = modUpdate.UpdateCount); } if (AutoUpdateMods) diff --git a/OpenKh.Tools.ModsManager/ViewModels/SetupWizardViewModel.cs b/OpenKh.Tools.ModsManager/ViewModels/SetupWizardViewModel.cs index 946932d17..96e1e3916 100644 --- a/OpenKh.Tools.ModsManager/ViewModels/SetupWizardViewModel.cs +++ b/OpenKh.Tools.ModsManager/ViewModels/SetupWizardViewModel.cs @@ -46,7 +46,6 @@ public class SetupWizardViewModel : BaseNotifyPropertyChanged private string _pcReleaseLocation; private string _pcReleaseLanguage; private string _gameDataLocation; - private string _luaEngineLocation; private bool _isEGSVersion; private bool _Extractkh2 = ConfigurationService.Extractkh2; private bool _Extractkh1 = ConfigurationService.Extractkh1; @@ -77,7 +76,7 @@ private set public Xceed.Wpf.Toolkit.WizardPage PageIsoSelection { get; internal set; } public Xceed.Wpf.Toolkit.WizardPage PageEosInstall { get; internal set; } public Xceed.Wpf.Toolkit.WizardPage PageEosConfig { get; internal set; } - public Xceed.Wpf.Toolkit.WizardPage PageLuaEngineInstall { get; internal set; } + public Xceed.Wpf.Toolkit.WizardPage PageLuaBackendInstall { get; internal set; } public Xceed.Wpf.Toolkit.WizardPage PageRegion { get; internal set; } public Xceed.Wpf.Toolkit.WizardPage PCLaunchOption { get; internal set; } public Xceed.Wpf.Toolkit.WizardPage LastPage { get; internal set; } @@ -361,18 +360,6 @@ public string GameDataLocation public RelayCommand ExtractGameDataCommand { get; set; } public float ExtractionProgress { get; set; } public int RegionId { get; set; } - public RelayCommand SelectLuaEngineLocationCommand { get; } - public string LuaBackendLocation - { - get => _luaEngineLocation; - set - { - _luaEngineLocation = value; - OnPropertyChanged(); - OnPropertyChanged(nameof(LuaBackendFoundVisibility)); - OnPropertyChanged(nameof(LuaBackendNotFoundVisibility)); - } - } public bool IsLuaBackendInstalled { get => File.Exists(Path.Combine(PcReleaseLocation, "LuaBackend.dll")) && @@ -450,7 +437,7 @@ bool IsEqual(byte[] left, byte[] right) return false; } } - } + } public SetupWizardViewModel() {