Added some sanity check, closes #1896.

This commit is contained in:
OBattler
2021-12-08 21:06:56 +01:00
parent 732399ed42
commit 4a906f0138
2 changed files with 20 additions and 20 deletions

View File

@@ -249,28 +249,28 @@ has_language_changed(uint32_t id)
void void
set_language(uint32_t id) set_language(uint32_t id)
{ {
if (id == 0xFFFF) if (id == 0xFFFF) {
{ set_language(lang_sys);
set_language(lang_sys); lang_id = id;
lang_id = id; return;
return; }
}
if (lang_id != id) { if (lang_id != id) {
/* Set our new language ID. */ /* Set our new language ID. */
lang_id = id; lang_id = id;
SetThreadUILanguage(lang_id); SetThreadUILanguage(lang_id);
/* Load the strings table for this ID. */ /* Load the strings table for this ID. */
LoadCommonStrings(); LoadCommonStrings();
/* Reload main menu */ /* Reload main menu */
menuMain = LoadMenu(hinstance, L"MainMenu"); menuMain = LoadMenu(hinstance, L"MainMenu");
if (hwndMain != NULL)
SetMenu(hwndMain, menuMain); SetMenu(hwndMain, menuMain);
/* Re-init all the menus */ /* Re-init all the menus */
ResetAllMenus(); ResetAllMenus();
media_menu_init(); media_menu_init();
} }
} }

View File

@@ -54,8 +54,8 @@
/* Platform Public data, specific. */ /* Platform Public data, specific. */
HWND hwndMain, /* application main window */ HWND hwndMain = NULL, /* application main window */
hwndRender; /* machine render window */ hwndRender = NULL; /* machine render window */
HMENU menuMain; /* application main menu */ HMENU menuMain; /* application main menu */
RECT oldclip; /* mouse rect */ RECT oldclip; /* mouse rect */
int sbar_height = 23; /* statusbar height */ int sbar_height = 23; /* statusbar height */