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

View File

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