diff options
| author | 2021-05-15 22:59:38 -0400 | |
|---|---|---|
| committer | 2021-05-15 22:59:38 -0400 | |
| commit | 4aac1ae4b1c39a8341cad7134c4bd356aeb83a3f (patch) | |
| tree | 84b211c9f51182b892935ddd06f55e6e6b35c444 /src | |
| parent | configuration_shared: Add some comments (diff) | |
| download | yuzu-4aac1ae4b1c39a8341cad7134c4bd356aeb83a3f.tar.gz yuzu-4aac1ae4b1c39a8341cad7134c4bd356aeb83a3f.tar.xz yuzu-4aac1ae4b1c39a8341cad7134c4bd356aeb83a3f.zip | |
configuration: Simplify applying per-game settings
Originally, every time we add a per-game setting, we'd have to guard for
it when setting it on the global config, and use a specific function to
do it for the per-game config.
This moves the global check into the ApplyPerGameSetting function so
that we can use it for changing both the global and per-game states.
Less work for the programmer.
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/configuration/configuration_shared.cpp | 42 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_audio.cpp | 11 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_general.cpp | 12 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 42 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics_advanced.cpp | 47 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_system.cpp | 27 |
6 files changed, 69 insertions, 112 deletions
diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp index 89be4a62d..be6e0b668 100644 --- a/src/yuzu/configuration/configuration_shared.cpp +++ b/src/yuzu/configuration/configuration_shared.cpp | |||
| @@ -13,32 +13,44 @@ | |||
| 13 | void ConfigurationShared::ApplyPerGameSetting(Settings::Setting<bool>* setting, | 13 | void ConfigurationShared::ApplyPerGameSetting(Settings::Setting<bool>* setting, |
| 14 | const QCheckBox* checkbox, | 14 | const QCheckBox* checkbox, |
| 15 | const CheckState& tracker) { | 15 | const CheckState& tracker) { |
| 16 | if (tracker == CheckState::Global) { | 16 | if (Settings::IsConfiguringGlobal() && setting->UsingGlobal()) { |
| 17 | setting->SetGlobal(true); | ||
| 18 | } else { | ||
| 19 | setting->SetGlobal(false); | ||
| 20 | setting->SetValue(checkbox->checkState()); | 17 | setting->SetValue(checkbox->checkState()); |
| 18 | } else if (!Settings::IsConfiguringGlobal()) { | ||
| 19 | if (tracker == CheckState::Global) { | ||
| 20 | setting->SetGlobal(true); | ||
| 21 | } else { | ||
| 22 | setting->SetGlobal(false); | ||
| 23 | setting->SetValue(checkbox->checkState()); | ||
| 24 | } | ||
| 21 | } | 25 | } |
| 22 | } | 26 | } |
| 23 | 27 | ||
| 24 | void ConfigurationShared::ApplyPerGameSetting(Settings::Setting<int>* setting, | 28 | void ConfigurationShared::ApplyPerGameSetting(Settings::Setting<int>* setting, |
| 25 | const QComboBox* combobox) { | 29 | const QComboBox* combobox) { |
| 26 | if (combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { | 30 | if (Settings::IsConfiguringGlobal() && setting->UsingGlobal()) { |
| 27 | setting->SetGlobal(true); | 31 | setting->SetValue(combobox->currentIndex()); |
| 28 | } else { | 32 | } else if (!Settings::IsConfiguringGlobal()) { |
| 29 | setting->SetGlobal(false); | 33 | if (combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { |
| 30 | setting->SetValue(combobox->currentIndex() - ConfigurationShared::USE_GLOBAL_OFFSET); | 34 | setting->SetGlobal(true); |
| 35 | } else { | ||
| 36 | setting->SetGlobal(false); | ||
| 37 | setting->SetValue(combobox->currentIndex() - ConfigurationShared::USE_GLOBAL_OFFSET); | ||
| 38 | } | ||
| 31 | } | 39 | } |
| 32 | } | 40 | } |
| 33 | 41 | ||
| 34 | void ConfigurationShared::ApplyPerGameSetting(Settings::Setting<Settings::RendererBackend>* setting, | 42 | void ConfigurationShared::ApplyPerGameSetting(Settings::Setting<Settings::RendererBackend>* setting, |
| 35 | const QComboBox* combobox) { | 43 | const QComboBox* combobox) { |
| 36 | if (combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { | 44 | if (Settings::IsConfiguringGlobal() && setting->UsingGlobal()) { |
| 37 | setting->SetGlobal(true); | 45 | setting->SetValue(static_cast<Settings::RendererBackend>(combobox->currentIndex())); |
| 38 | } else { | 46 | } else if (!Settings::IsConfiguringGlobal()) { |
| 39 | setting->SetGlobal(false); | 47 | if (combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { |
| 40 | setting->SetValue(static_cast<Settings::RendererBackend>( | 48 | setting->SetGlobal(true); |
| 41 | combobox->currentIndex() - ConfigurationShared::USE_GLOBAL_OFFSET)); | 49 | } else { |
| 50 | setting->SetGlobal(false); | ||
| 51 | setting->SetValue(static_cast<Settings::RendererBackend>( | ||
| 52 | combobox->currentIndex() - ConfigurationShared::USE_GLOBAL_OFFSET)); | ||
| 53 | } | ||
| 42 | } | 54 | } |
| 43 | } | 55 | } |
| 44 | 56 | ||
diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp index f9507e228..6c18e9131 100644 --- a/src/yuzu/configuration/configure_audio.cpp +++ b/src/yuzu/configuration/configure_audio.cpp | |||
| @@ -99,6 +99,10 @@ void ConfigureAudio::SetVolumeIndicatorText(int percentage) { | |||
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | void ConfigureAudio::ApplyConfiguration() { | 101 | void ConfigureAudio::ApplyConfiguration() { |
| 102 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.enable_audio_stretching, | ||
| 103 | ui->toggle_audio_stretching, | ||
| 104 | enable_audio_stretching); | ||
| 105 | |||
| 102 | if (Settings::IsConfiguringGlobal()) { | 106 | if (Settings::IsConfiguringGlobal()) { |
| 103 | Settings::values.sink_id = | 107 | Settings::values.sink_id = |
| 104 | ui->output_sink_combo_box->itemText(ui->output_sink_combo_box->currentIndex()) | 108 | ui->output_sink_combo_box->itemText(ui->output_sink_combo_box->currentIndex()) |
| @@ -108,19 +112,12 @@ void ConfigureAudio::ApplyConfiguration() { | |||
| 108 | .toStdString(); | 112 | .toStdString(); |
| 109 | 113 | ||
| 110 | // Guard if during game and set to game-specific value | 114 | // Guard if during game and set to game-specific value |
| 111 | if (Settings::values.enable_audio_stretching.UsingGlobal()) { | ||
| 112 | Settings::values.enable_audio_stretching.SetValue( | ||
| 113 | ui->toggle_audio_stretching->isChecked()); | ||
| 114 | } | ||
| 115 | if (Settings::values.volume.UsingGlobal()) { | 115 | if (Settings::values.volume.UsingGlobal()) { |
| 116 | Settings::values.volume.SetValue( | 116 | Settings::values.volume.SetValue( |
| 117 | static_cast<float>(ui->volume_slider->sliderPosition()) / | 117 | static_cast<float>(ui->volume_slider->sliderPosition()) / |
| 118 | ui->volume_slider->maximum()); | 118 | ui->volume_slider->maximum()); |
| 119 | } | 119 | } |
| 120 | } else { | 120 | } else { |
| 121 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.enable_audio_stretching, | ||
| 122 | ui->toggle_audio_stretching, | ||
| 123 | enable_audio_stretching); | ||
| 124 | if (ui->volume_combo_box->currentIndex() == 0) { | 121 | if (ui->volume_combo_box->currentIndex() == 0) { |
| 125 | Settings::values.volume.SetGlobal(true); | 122 | Settings::values.volume.SetGlobal(true); |
| 126 | } else { | 123 | } else { |
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 2fa88dcec..68c8aeb19 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -50,6 +50,9 @@ void ConfigureGeneral::SetConfiguration() { | |||
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | void ConfigureGeneral::ApplyConfiguration() { | 52 | void ConfigureGeneral::ApplyConfiguration() { |
| 53 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_multi_core, | ||
| 54 | ui->use_multi_core, use_multi_core); | ||
| 55 | |||
| 53 | if (Settings::IsConfiguringGlobal()) { | 56 | if (Settings::IsConfiguringGlobal()) { |
| 54 | UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked(); | 57 | UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked(); |
| 55 | UISettings::values.select_user_on_boot = ui->toggle_user_on_boot->isChecked(); | 58 | UISettings::values.select_user_on_boot = ui->toggle_user_on_boot->isChecked(); |
| @@ -62,13 +65,7 @@ void ConfigureGeneral::ApplyConfiguration() { | |||
| 62 | Qt::Checked); | 65 | Qt::Checked); |
| 63 | Settings::values.frame_limit.SetValue(ui->frame_limit->value()); | 66 | Settings::values.frame_limit.SetValue(ui->frame_limit->value()); |
| 64 | } | 67 | } |
| 65 | if (Settings::values.use_multi_core.UsingGlobal()) { | ||
| 66 | Settings::values.use_multi_core.SetValue(ui->use_multi_core->isChecked()); | ||
| 67 | } | ||
| 68 | } else { | 68 | } else { |
| 69 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_multi_core, | ||
| 70 | ui->use_multi_core, use_multi_core); | ||
| 71 | |||
| 72 | bool global_frame_limit = use_frame_limit == ConfigurationShared::CheckState::Global; | 69 | bool global_frame_limit = use_frame_limit == ConfigurationShared::CheckState::Global; |
| 73 | Settings::values.use_frame_limit.SetGlobal(global_frame_limit); | 70 | Settings::values.use_frame_limit.SetGlobal(global_frame_limit); |
| 74 | Settings::values.frame_limit.SetGlobal(global_frame_limit); | 71 | Settings::values.frame_limit.SetGlobal(global_frame_limit); |
| @@ -94,6 +91,9 @@ void ConfigureGeneral::RetranslateUI() { | |||
| 94 | 91 | ||
| 95 | void ConfigureGeneral::SetupPerGameUI() { | 92 | void ConfigureGeneral::SetupPerGameUI() { |
| 96 | if (Settings::IsConfiguringGlobal()) { | 93 | if (Settings::IsConfiguringGlobal()) { |
| 94 | // Disables each setting if: | ||
| 95 | // - A game is running (thus settings in use), and | ||
| 96 | // - A non-global setting is applied. | ||
| 97 | ui->toggle_frame_limit->setEnabled(Settings::values.use_frame_limit.UsingGlobal()); | 97 | ui->toggle_frame_limit->setEnabled(Settings::values.use_frame_limit.UsingGlobal()); |
| 98 | ui->frame_limit->setEnabled(Settings::values.frame_limit.UsingGlobal()); | 98 | ui->frame_limit->setEnabled(Settings::values.frame_limit.UsingGlobal()); |
| 99 | 99 | ||
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 0a7536617..fb9ec093c 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -106,6 +106,19 @@ void ConfigureGraphics::SetConfiguration() { | |||
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | void ConfigureGraphics::ApplyConfiguration() { | 108 | void ConfigureGraphics::ApplyConfiguration() { |
| 109 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.fullscreen_mode, | ||
| 110 | ui->fullscreen_mode_combobox); | ||
| 111 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.aspect_ratio, | ||
| 112 | ui->aspect_ratio_combobox); | ||
| 113 | |||
| 114 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_disk_shader_cache, | ||
| 115 | ui->use_disk_shader_cache, use_disk_shader_cache); | ||
| 116 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_gpu_emulation, | ||
| 117 | ui->use_asynchronous_gpu_emulation, | ||
| 118 | use_asynchronous_gpu_emulation); | ||
| 119 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_nvdec_emulation, | ||
| 120 | ui->use_nvdec_emulation, use_nvdec_emulation); | ||
| 121 | |||
| 109 | if (Settings::IsConfiguringGlobal()) { | 122 | if (Settings::IsConfiguringGlobal()) { |
| 110 | // Guard if during game and set to game-specific value | 123 | // Guard if during game and set to game-specific value |
| 111 | if (Settings::values.renderer_backend.UsingGlobal()) { | 124 | if (Settings::values.renderer_backend.UsingGlobal()) { |
| @@ -114,22 +127,6 @@ void ConfigureGraphics::ApplyConfiguration() { | |||
| 114 | if (Settings::values.vulkan_device.UsingGlobal()) { | 127 | if (Settings::values.vulkan_device.UsingGlobal()) { |
| 115 | Settings::values.vulkan_device.SetValue(vulkan_device); | 128 | Settings::values.vulkan_device.SetValue(vulkan_device); |
| 116 | } | 129 | } |
| 117 | if (Settings::values.fullscreen_mode.UsingGlobal()) { | ||
| 118 | Settings::values.fullscreen_mode.SetValue(ui->fullscreen_mode_combobox->currentIndex()); | ||
| 119 | } | ||
| 120 | if (Settings::values.aspect_ratio.UsingGlobal()) { | ||
| 121 | Settings::values.aspect_ratio.SetValue(ui->aspect_ratio_combobox->currentIndex()); | ||
| 122 | } | ||
| 123 | if (Settings::values.use_disk_shader_cache.UsingGlobal()) { | ||
| 124 | Settings::values.use_disk_shader_cache.SetValue(ui->use_disk_shader_cache->isChecked()); | ||
| 125 | } | ||
| 126 | if (Settings::values.use_asynchronous_gpu_emulation.UsingGlobal()) { | ||
| 127 | Settings::values.use_asynchronous_gpu_emulation.SetValue( | ||
| 128 | ui->use_asynchronous_gpu_emulation->isChecked()); | ||
| 129 | } | ||
| 130 | if (Settings::values.use_nvdec_emulation.UsingGlobal()) { | ||
| 131 | Settings::values.use_nvdec_emulation.SetValue(ui->use_nvdec_emulation->isChecked()); | ||
| 132 | } | ||
| 133 | if (Settings::values.bg_red.UsingGlobal()) { | 130 | if (Settings::values.bg_red.UsingGlobal()) { |
| 134 | Settings::values.bg_red.SetValue(static_cast<float>(bg_color.redF())); | 131 | Settings::values.bg_red.SetValue(static_cast<float>(bg_color.redF())); |
| 135 | Settings::values.bg_green.SetValue(static_cast<float>(bg_color.greenF())); | 132 | Settings::values.bg_green.SetValue(static_cast<float>(bg_color.greenF())); |
| @@ -150,19 +147,6 @@ void ConfigureGraphics::ApplyConfiguration() { | |||
| 150 | } | 147 | } |
| 151 | } | 148 | } |
| 152 | 149 | ||
| 153 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.fullscreen_mode, | ||
| 154 | ui->fullscreen_mode_combobox); | ||
| 155 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.aspect_ratio, | ||
| 156 | ui->aspect_ratio_combobox); | ||
| 157 | |||
| 158 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_disk_shader_cache, | ||
| 159 | ui->use_disk_shader_cache, use_disk_shader_cache); | ||
| 160 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_gpu_emulation, | ||
| 161 | ui->use_asynchronous_gpu_emulation, | ||
| 162 | use_asynchronous_gpu_emulation); | ||
| 163 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_nvdec_emulation, | ||
| 164 | ui->use_nvdec_emulation, use_nvdec_emulation); | ||
| 165 | |||
| 166 | if (ui->bg_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { | 150 | if (ui->bg_combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { |
| 167 | Settings::values.bg_red.SetGlobal(true); | 151 | Settings::values.bg_red.SetGlobal(true); |
| 168 | Settings::values.bg_green.SetGlobal(true); | 152 | Settings::values.bg_green.SetGlobal(true); |
diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index c67609b0e..94e634986 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp | |||
| @@ -54,47 +54,24 @@ void ConfigureGraphicsAdvanced::ApplyConfiguration() { | |||
| 54 | ui->gpu_accuracy->currentIndex() - | 54 | ui->gpu_accuracy->currentIndex() - |
| 55 | ((Settings::IsConfiguringGlobal()) ? 0 : ConfigurationShared::USE_GLOBAL_OFFSET)); | 55 | ((Settings::IsConfiguringGlobal()) ? 0 : ConfigurationShared::USE_GLOBAL_OFFSET)); |
| 56 | 56 | ||
| 57 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy, | ||
| 58 | ui->anisotropic_filtering_combobox); | ||
| 59 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vsync, ui->use_vsync, | ||
| 60 | use_vsync); | ||
| 61 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_assembly_shaders, | ||
| 62 | ui->use_assembly_shaders, use_assembly_shaders); | ||
| 63 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_shaders, | ||
| 64 | ui->use_asynchronous_shaders, | ||
| 65 | use_asynchronous_shaders); | ||
| 66 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_fast_gpu_time, | ||
| 67 | ui->use_fast_gpu_time, use_fast_gpu_time); | ||
| 68 | |||
| 57 | if (Settings::IsConfiguringGlobal()) { | 69 | if (Settings::IsConfiguringGlobal()) { |
| 58 | // Must guard in case of a during-game configuration when set to be game-specific. | 70 | // Must guard in case of a during-game configuration when set to be game-specific. |
| 59 | if (Settings::values.gpu_accuracy.UsingGlobal()) { | 71 | if (Settings::values.gpu_accuracy.UsingGlobal()) { |
| 60 | Settings::values.gpu_accuracy.SetValue(gpu_accuracy); | 72 | Settings::values.gpu_accuracy.SetValue(gpu_accuracy); |
| 61 | } | 73 | } |
| 62 | if (Settings::values.use_vsync.UsingGlobal()) { | ||
| 63 | Settings::values.use_vsync.SetValue(ui->use_vsync->isChecked()); | ||
| 64 | } | ||
| 65 | if (Settings::values.use_assembly_shaders.UsingGlobal()) { | ||
| 66 | Settings::values.use_assembly_shaders.SetValue(ui->use_assembly_shaders->isChecked()); | ||
| 67 | } | ||
| 68 | if (Settings::values.use_asynchronous_shaders.UsingGlobal()) { | ||
| 69 | Settings::values.use_asynchronous_shaders.SetValue( | ||
| 70 | ui->use_asynchronous_shaders->isChecked()); | ||
| 71 | } | ||
| 72 | if (Settings::values.use_asynchronous_shaders.UsingGlobal()) { | ||
| 73 | Settings::values.use_asynchronous_shaders.SetValue( | ||
| 74 | ui->use_asynchronous_shaders->isChecked()); | ||
| 75 | } | ||
| 76 | if (Settings::values.use_fast_gpu_time.UsingGlobal()) { | ||
| 77 | Settings::values.use_fast_gpu_time.SetValue(ui->use_fast_gpu_time->isChecked()); | ||
| 78 | } | ||
| 79 | if (Settings::values.max_anisotropy.UsingGlobal()) { | ||
| 80 | Settings::values.max_anisotropy.SetValue( | ||
| 81 | ui->anisotropic_filtering_combobox->currentIndex()); | ||
| 82 | } | ||
| 83 | } else { | 74 | } else { |
| 84 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy, | ||
| 85 | ui->anisotropic_filtering_combobox); | ||
| 86 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vsync, ui->use_vsync, | ||
| 87 | use_vsync); | ||
| 88 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_assembly_shaders, | ||
| 89 | ui->use_assembly_shaders, use_assembly_shaders); | ||
| 90 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_shaders, | ||
| 91 | ui->use_asynchronous_shaders, | ||
| 92 | use_asynchronous_shaders); | ||
| 93 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_fast_gpu_time, | ||
| 94 | ui->use_fast_gpu_time, use_fast_gpu_time); | ||
| 95 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy, | ||
| 96 | ui->anisotropic_filtering_combobox); | ||
| 97 | |||
| 98 | if (ui->gpu_accuracy->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { | 75 | if (ui->gpu_accuracy->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { |
| 99 | Settings::values.gpu_accuracy.SetGlobal(true); | 76 | Settings::values.gpu_accuracy.SetGlobal(true); |
| 100 | } else { | 77 | } else { |
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index 268ed44c3..26505956a 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp | |||
| @@ -127,21 +127,15 @@ void ConfigureSystem::ApplyConfiguration() { | |||
| 127 | return; | 127 | return; |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.language_index, | ||
| 131 | ui->combo_language); | ||
| 132 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.region_index, ui->combo_region); | ||
| 133 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.time_zone_index, | ||
| 134 | ui->combo_time_zone); | ||
| 135 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.sound_index, ui->combo_sound); | ||
| 136 | |||
| 130 | if (Settings::IsConfiguringGlobal()) { | 137 | if (Settings::IsConfiguringGlobal()) { |
| 131 | // Guard if during game and set to game-specific value | 138 | // Guard if during game and set to game-specific value |
| 132 | if (Settings::values.language_index.UsingGlobal()) { | ||
| 133 | Settings::values.language_index.SetValue(ui->combo_language->currentIndex()); | ||
| 134 | } | ||
| 135 | if (Settings::values.region_index.UsingGlobal()) { | ||
| 136 | Settings::values.region_index.SetValue(ui->combo_region->currentIndex()); | ||
| 137 | } | ||
| 138 | if (Settings::values.time_zone_index.UsingGlobal()) { | ||
| 139 | Settings::values.time_zone_index.SetValue(ui->combo_time_zone->currentIndex()); | ||
| 140 | } | ||
| 141 | if (Settings::values.sound_index.UsingGlobal()) { | ||
| 142 | Settings::values.sound_index.SetValue(ui->combo_sound->currentIndex()); | ||
| 143 | } | ||
| 144 | |||
| 145 | if (Settings::values.rng_seed.UsingGlobal()) { | 139 | if (Settings::values.rng_seed.UsingGlobal()) { |
| 146 | if (ui->rng_seed_checkbox->isChecked()) { | 140 | if (ui->rng_seed_checkbox->isChecked()) { |
| 147 | Settings::values.rng_seed.SetValue( | 141 | Settings::values.rng_seed.SetValue( |
| @@ -151,13 +145,6 @@ void ConfigureSystem::ApplyConfiguration() { | |||
| 151 | } | 145 | } |
| 152 | } | 146 | } |
| 153 | } else { | 147 | } else { |
| 154 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.language_index, | ||
| 155 | ui->combo_language); | ||
| 156 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.region_index, ui->combo_region); | ||
| 157 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.time_zone_index, | ||
| 158 | ui->combo_time_zone); | ||
| 159 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.sound_index, ui->combo_sound); | ||
| 160 | |||
| 161 | switch (use_rng_seed) { | 148 | switch (use_rng_seed) { |
| 162 | case ConfigurationShared::CheckState::On: | 149 | case ConfigurationShared::CheckState::On: |
| 163 | case ConfigurationShared::CheckState::Off: | 150 | case ConfigurationShared::CheckState::Off: |