| 926 | } |
| 927 | |
| 928 | void GeneralSettings2::StoreConfig() |
| 929 | { |
| 930 | auto* app = (CemuApp*)wxTheApp; |
| 931 | auto& config = GetConfig(); |
| 932 | |
| 933 | config.use_discord_presence = m_discord_presence->IsChecked(); |
| 934 | config.fullscreen_menubar = m_fullscreen_menubar->IsChecked(); |
| 935 | config.check_update = m_auto_update->IsChecked(); |
| 936 | config.save_screenshot = m_save_screenshot->IsChecked(); |
| 937 | config.receive_untested_updates = m_receive_untested_releases->IsChecked(); |
| 938 | #if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE) |
| 939 | config.feral_gamemode = m_feral_gamemode->IsChecked(); |
| 940 | #endif |
| 941 | config.play_boot_sound = m_play_boot_sound->IsChecked(); |
| 942 | config.disable_screensaver = m_disable_screensaver->IsChecked(); |
| 943 | // Toggle while a game is running |
| 944 | if (CafeSystem::IsTitleRunning()) |
| 945 | { |
| 946 | ScreenSaver::SetInhibit(config.disable_screensaver); |
| 947 | } |
| 948 | |
| 949 | |
| 950 | // -1 is default wx widget value -> set to dummy 0 so mainwindow and padwindow will update it |
| 951 | config.window_position = m_save_window_position_size->IsChecked() ? Vector2i{ 0,0 } : Vector2i{-1,-1}; |
| 952 | config.window_size = m_save_window_position_size->IsChecked() ? Vector2i{ 0,0 } : Vector2i{-1,-1}; |
| 953 | config.pad_position = m_save_padwindow_position_size->IsChecked() ? Vector2i{ 0,0 } : Vector2i{-1,-1}; |
| 954 | config.pad_size = m_save_padwindow_position_size->IsChecked() ? Vector2i{ 0,0 } : Vector2i{-1,-1}; |
| 955 | |
| 956 | config.game_paths.clear(); |
| 957 | for (auto& path : m_game_paths->GetStrings()) |
| 958 | config.game_paths.emplace_back(path.utf8_string()); |
| 959 | |
| 960 | auto selection = m_language->GetSelection(); |
| 961 | if (selection == 0) |
| 962 | GetConfig().language = wxLANGUAGE_DEFAULT; |
| 963 | else |
| 964 | { |
| 965 | const auto language = m_language->GetStringSelection(); |
| 966 | for (const auto& lang : app->GetLanguages()) |
| 967 | { |
| 968 | if (lang->DescriptionNative == language) |
| 969 | { |
| 970 | GetConfig().language = lang->Language; |
| 971 | break; |
| 972 | } |
| 973 | } |
| 974 | } |
| 975 | |
| 976 | // audio |
| 977 | if (m_audio_api->GetStringSelection() == kDirectSound) |
| 978 | config.audio_api = IAudioAPI::DirectSound; |
| 979 | else if (m_audio_api->GetStringSelection() == kXAudio27) |
| 980 | config.audio_api = IAudioAPI::XAudio27; |
| 981 | else if (m_audio_api->GetStringSelection() == kXAudio2) |
| 982 | config.audio_api = IAudioAPI::XAudio2; |
| 983 | else if (m_audio_api->GetStringSelection() == kCubeb) |
| 984 | config.audio_api = IAudioAPI::Cubeb; |
| 985 |
nothing calls this directly
no test coverage detected