Prevent changing of console language while a game is running (#1114)

This commit is contained in:
goeiecool9999 2024-03-11 00:55:31 +01:00 committed by GitHub
parent f69fddc6e5
commit a2d74972d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1019,8 +1019,11 @@ void MainWindow::OnConsoleLanguage(wxCommandEvent& event)
default: default:
cemu_assert_debug(false); cemu_assert_debug(false);
} }
if (m_game_list)
{
m_game_list->DeleteCachedStrings(); m_game_list->DeleteCachedStrings();
m_game_list->ReloadGameEntries(false); m_game_list->ReloadGameEntries(false);
}
g_config.Save(); g_config.Save();
} }
@ -2159,6 +2162,14 @@ void MainWindow::RecreateMenu()
optionsConsoleLanguageMenu->AppendRadioItem(MAINFRAME_MENU_ID_OPTIONS_LANGUAGE_PORTUGUESE, _("&Portuguese"), wxEmptyString)->Check(config.console_language == CafeConsoleLanguage::PT); optionsConsoleLanguageMenu->AppendRadioItem(MAINFRAME_MENU_ID_OPTIONS_LANGUAGE_PORTUGUESE, _("&Portuguese"), wxEmptyString)->Check(config.console_language == CafeConsoleLanguage::PT);
optionsConsoleLanguageMenu->AppendRadioItem(MAINFRAME_MENU_ID_OPTIONS_LANGUAGE_RUSSIAN, _("&Russian"), wxEmptyString)->Check(config.console_language == CafeConsoleLanguage::RU); optionsConsoleLanguageMenu->AppendRadioItem(MAINFRAME_MENU_ID_OPTIONS_LANGUAGE_RUSSIAN, _("&Russian"), wxEmptyString)->Check(config.console_language == CafeConsoleLanguage::RU);
optionsConsoleLanguageMenu->AppendRadioItem(MAINFRAME_MENU_ID_OPTIONS_LANGUAGE_TAIWANESE, _("&Taiwanese"), wxEmptyString)->Check(config.console_language == CafeConsoleLanguage::TW); optionsConsoleLanguageMenu->AppendRadioItem(MAINFRAME_MENU_ID_OPTIONS_LANGUAGE_TAIWANESE, _("&Taiwanese"), wxEmptyString)->Check(config.console_language == CafeConsoleLanguage::TW);
if(IsGameLaunched())
{
auto items = optionsConsoleLanguageMenu->GetMenuItems();
for (auto& item : items)
{
item->Enable(false);
}
}
// options submenu // options submenu
wxMenu* optionsMenu = new wxMenu(); wxMenu* optionsMenu = new wxMenu();