From 5db044734d828fd3fc909d2e0f1af745798dd07f Mon Sep 17 00:00:00 2001 From: Laeng Date: Tue, 24 Oct 2023 10:50:23 +0900 Subject: [PATCH] Fix install infomation mismatch check --- .../Windows/MainWindow.xaml.cs | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/SCTools/SCTool_Redesigned/Windows/MainWindow.xaml.cs b/SCTools/SCTool_Redesigned/Windows/MainWindow.xaml.cs index fafa426..92210e0 100644 --- a/SCTools/SCTool_Redesigned/Windows/MainWindow.xaml.cs +++ b/SCTools/SCTool_Redesigned/Windows/MainWindow.xaml.cs @@ -538,6 +538,7 @@ private void SetInstallbtnLabel() { var installed = 0; var isNewVersion = 0; + var mismatch = 0; var release = RepositoryManager.GetInfos(false); foreach (GameMode mode in Enum.GetValues(typeof(GameMode))) @@ -557,32 +558,38 @@ private void SetInstallbtnLabel() var userConfigPath = Path.Combine(App.Settings.GameFolder, mode.ToString(), "user.cfg"); - if (patch.IsEnabled && PatchLanguageManager.IsEnabled(userConfigPath)) + if (patch.IsEnabled == PatchLanguageManager.IsEnabled(userConfigPath)) { installed++; } + else + { + mismatch++; + } } } _MainBtnState = MainBtnMode.install; - if (isNewVersion > 0) + if (installed > 0) { - _MainBtnState = MainBtnMode.update; - } - else - { - if (installed > 0) + if (isNewVersion > 0) { - _MainBtnState = MainBtnMode.launch; + _MainBtnState = MainBtnMode.update; } else + { + _MainBtnState = MainBtnMode.launch; + } + } + else + { + if (mismatch > 0) { _MainBtnState = MainBtnMode.reinstall; } } - Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(delegate { switch (_MainBtnState)