From a2d74972d4e0cd3b61dc4deb32566fc385942963 Mon Sep 17 00:00:00 2001 From: goeiecool9999 <7033575+goeiecool9999@users.noreply.github.com> Date: Mon, 11 Mar 2024 00:55:31 +0100 Subject: [PATCH] Prevent changing of console language while a game is running (#1114) --- src/gui/MainWindow.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index d271ca3a..311ddfb7 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -1019,8 +1019,11 @@ void MainWindow::OnConsoleLanguage(wxCommandEvent& event) default: cemu_assert_debug(false); } - m_game_list->DeleteCachedStrings(); - m_game_list->ReloadGameEntries(false); + if (m_game_list) + { + m_game_list->DeleteCachedStrings(); + m_game_list->ReloadGameEntries(false); + } 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_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); + if(IsGameLaunched()) + { + auto items = optionsConsoleLanguageMenu->GetMenuItems(); + for (auto& item : items) + { + item->Enable(false); + } + } // options submenu wxMenu* optionsMenu = new wxMenu();