Unstable 0.17.6.0

This commit is contained in:
Markus Isberg
2022-04-04 16:46:08 +09:00
parent 44ded0225a
commit 95764d1fa8
78 changed files with 1265 additions and 703 deletions
@@ -57,6 +57,20 @@ namespace Barotrauma
return isCJK.IsMatch(text);
}
/// <summary>
/// Check if the currently selected language is available, and switch to English if not
/// </summary>
public static void VerifyLanguageAvailable()
{
if (!TextPacks.ContainsKey(GameSettings.CurrentConfig.Language))
{
DebugConsole.ThrowError($"Could not find the language \"{GameSettings.CurrentConfig.Language}\". Trying to switch to English...");
var config = GameSettings.CurrentConfig;
config.Language = "English".ToLanguageIdentifier();;
GameSettings.SetCurrentConfig(config);
}
}
public static bool ContainsTag(string tag)
{
return ContainsTag(tag.ToIdentifier());