(e6b42e134) Display the "language changed, restart required" message box using the default font for the selected language

This commit is contained in:
Joonas Rikkonen
2019-05-07 16:21:15 +03:00
parent d6c05ab062
commit 02236f65c5
2 changed files with 32 additions and 3 deletions
@@ -139,12 +139,16 @@ namespace Barotrauma
{
string newLanguage = obj as string;
if (newLanguage == Language) return true;
UnsavedSettings = true;
Language = newLanguage;
ApplySettings();
new GUIMessageBox(TextManager.Get("RestartRequiredLabel"), TextManager.Get("RestartRequiredLanguage"));
var msgBox = new GUIMessageBox(TextManager.Get("RestartRequiredLabel"), TextManager.Get("RestartRequiredLanguage"));
//change fonts to the default font of the new language to make sure
//they can be displayed when for example changing from English to Chinese
var defaultFont = GUI.Style.LoadCurrentDefaultFont();
msgBox.Header.Font = defaultFont;
msgBox.Text.Font = defaultFont;
return true;
};