From f07c7a8d2a9fb339b764f24d4a7c9170d4463e08 Mon Sep 17 00:00:00 2001 From: Laeng Date: Tue, 24 Oct 2023 11:11:00 +0900 Subject: [PATCH] Add global.ini detect --- .../SCTool_Redesigned/Windows/MainWindow.xaml.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/SCTools/SCTool_Redesigned/Windows/MainWindow.xaml.cs b/SCTools/SCTool_Redesigned/Windows/MainWindow.xaml.cs index 92210e0..083ca41 100644 --- a/SCTools/SCTool_Redesigned/Windows/MainWindow.xaml.cs +++ b/SCTools/SCTool_Redesigned/Windows/MainWindow.xaml.cs @@ -556,9 +556,11 @@ private void SetInstallbtnLabel() ++isNewVersion; } - var userConfigPath = Path.Combine(App.Settings.GameFolder, mode.ToString(), "user.cfg"); + var gameFolder = Path.Combine(App.Settings.GameFolder, mode.ToString()); + var localizationFile = Path.Combine(gameFolder, "data", "Localization", App.Settings.GetOfficialLanauages()[App.Settings.GameLanguage], "global.ini"); + var userConfigPath = Path.Combine(gameFolder, "user.cfg"); - if (patch.IsEnabled == PatchLanguageManager.IsEnabled(userConfigPath)) + if (patch.IsEnabled == PatchLanguageManager.IsEnabled(userConfigPath) && File.Exists(localizationFile)) { installed++; } @@ -627,9 +629,12 @@ private bool IsLocalizationInstalled() if (data.Installations.Count > 0) { var patch = data.Installations.FirstOrDefault(); - var userConfigPath = Path.Combine(App.Settings.GameFolder, mode.ToString(), "user.cfg"); - if (patch.IsEnabled && PatchLanguageManager.IsEnabled(userConfigPath)) + var gameFolder = Path.Combine(App.Settings.GameFolder, mode.ToString()); + var localizationFile = Path.Combine(gameFolder, "data", "Localization", App.Settings.GetOfficialLanauages()[App.Settings.GameLanguage], "global.ini"); + var userConfigPath = Path.Combine(gameFolder, "user.cfg"); + + if (patch.IsEnabled && PatchLanguageManager.IsEnabled(userConfigPath) && File.Exists(localizationFile)) { installed++; }