Skip to content

Commit

Permalink
Add global.ini detect
Browse files Browse the repository at this point in the history
  • Loading branch information
Laeng committed Oct 24, 2023
1 parent 5db0447 commit f07c7a8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions SCTools/SCTool_Redesigned/Windows/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down Expand Up @@ -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++;
}
Expand Down

0 comments on commit f07c7a8

Please sign in to comment.