Skip to content

Commit

Permalink
Merge pull request #34 from h0useRus/feature/Add-audio-config-by-default
Browse files Browse the repository at this point in the history
- Removed Default program
  • Loading branch information
h0useRus authored Oct 27, 2023
2 parents 9789e76 + af636cc commit b35cfe9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 22 deletions.
21 changes: 0 additions & 21 deletions SCTools/SCTools/Forms/LocalizationForm.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Windows.Forms;
Expand Down Expand Up @@ -69,26 +68,6 @@ private void LocalizationForm_Shown(object sender, EventArgs e)
_setAsDefaultLocalizationAppShown = true;
return;
}
string? defaultLocalizationApp = LocalizationAppRegistry.GetDefaultLocalizationApp();
if (defaultLocalizationApp == null)
{
LocalizationAppRegistry.SetDefaultLocalizationApp(executablePath);
}
else if (!string.Equals(defaultLocalizationApp, executablePath, StringComparison.OrdinalIgnoreCase))
{
_setAsDefaultLocalizationAppShown = true;
var dialogResult = RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentUICulture, Resources.Localization_ChangeDefaultApp_Text, Program.Name),
Resources.Localization_DefaultApp_Text, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (dialogResult != DialogResult.Cancel)
{
Program.Settings.DefaultLocalizationAppChangeShown = true;
Program.SaveAppSettings();
if (dialogResult == DialogResult.Yes)
{
LocalizationAppRegistry.SetDefaultLocalizationApp(executablePath);
}
}
}
}

private void cbRepository_SelectionChangeCommitted(object sender, EventArgs e)
Expand Down
2 changes: 2 additions & 0 deletions SCTools/SCTools/user.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
g_language=korean_(south_korea)
g_languageAudio=english
3 changes: 2 additions & 1 deletion SCTools/SCToolsLib/Global/GameConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ public static class GameConstants
{
public const string BinFolderName = "Bin64";
public const string DataFolderName = "data";
public const string LocalizationFolderName = "localization";
public const string LocalizationFolderName = "localization";
public const string GameFolderName = "StarCitizen";
public const string GameExeName = "StarCitizen.exe";
public const string UserConfigName = "user.cfg";
public const string GlobalIniName = "global.ini";
public const string CurrentLanguageKey = "g_language";
public const string CurrentLanguageAudioKey = "g_languageAudio";
public const string EnglishLocalization = "english";

public static string GetGameModePath(string gamePath, GameMode mode) => Path.Combine(gamePath, mode.ToString());
Expand Down
1 change: 1 addition & 0 deletions SCTools/SCToolsLib/Localization/GameSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public bool SaveCurrentLanguage(string languageName)
var userConfigFile = new CfgFile(GameConstants.GetUserConfigPath(_currentGame.RootFolderPath));
var userConfigData = userConfigFile.Read();
userConfigData.AddOrUpdateRow(GameConstants.CurrentLanguageKey, languageName);
userConfigData.AddOrUpdateRow(GameConstants.CurrentLanguageAudioKey, GameConstants.EnglishLocalization);
if (userConfigFile.Save(userConfigData))
{
LanguageInfo.Current = languageName;
Expand Down

0 comments on commit b35cfe9

Please sign in to comment.