diff options
Diffstat (limited to 'src/yuzu_cmd/config.cpp')
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 334038ef9..e1adbbf2b 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -228,24 +228,24 @@ static const std::array<int, 8> keyboard_mods{ | |||
| 228 | 228 | ||
| 229 | void Config::ReadValues() { | 229 | void Config::ReadValues() { |
| 230 | // Controls | 230 | // Controls |
| 231 | for (std::size_t p = 0; p < Settings::values.players.size(); ++p) { | 231 | for (std::size_t p = 0; p < Settings::values.players.GetValue().size(); ++p) { |
| 232 | const auto group = fmt::format("ControlsP{}", p); | 232 | const auto group = fmt::format("ControlsP{}", p); |
| 233 | for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) { | 233 | for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) { |
| 234 | std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]); | 234 | std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]); |
| 235 | Settings::values.players[p].buttons[i] = | 235 | Settings::values.players.GetValue()[p].buttons[i] = |
| 236 | sdl2_config->Get(group, Settings::NativeButton::mapping[i], default_param); | 236 | sdl2_config->Get(group, Settings::NativeButton::mapping[i], default_param); |
| 237 | if (Settings::values.players[p].buttons[i].empty()) | 237 | if (Settings::values.players.GetValue()[p].buttons[i].empty()) |
| 238 | Settings::values.players[p].buttons[i] = default_param; | 238 | Settings::values.players.GetValue()[p].buttons[i] = default_param; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { | 241 | for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { |
| 242 | std::string default_param = InputCommon::GenerateAnalogParamFromKeys( | 242 | std::string default_param = InputCommon::GenerateAnalogParamFromKeys( |
| 243 | default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], | 243 | default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], |
| 244 | default_analogs[i][3], default_analogs[i][4], 0.5f); | 244 | default_analogs[i][3], default_analogs[i][4], 0.5f); |
| 245 | Settings::values.players[p].analogs[i] = | 245 | Settings::values.players.GetValue()[p].analogs[i] = |
| 246 | sdl2_config->Get(group, Settings::NativeAnalog::mapping[i], default_param); | 246 | sdl2_config->Get(group, Settings::NativeAnalog::mapping[i], default_param); |
| 247 | if (Settings::values.players[p].analogs[i].empty()) | 247 | if (Settings::values.players.GetValue()[p].analogs[i].empty()) |
| 248 | Settings::values.players[p].analogs[i] = default_param; | 248 | Settings::values.players.GetValue()[p].analogs[i] = default_param; |
| 249 | } | 249 | } |
| 250 | } | 250 | } |
| 251 | 251 | ||
| @@ -288,10 +288,12 @@ void Config::ReadValues() { | |||
| 288 | Settings::values.debug_pad_analogs[i] = default_param; | 288 | Settings::values.debug_pad_analogs[i] = default_param; |
| 289 | } | 289 | } |
| 290 | 290 | ||
| 291 | Settings::values.vibration_enabled = | 291 | Settings::values.vibration_enabled.SetValue( |
| 292 | sdl2_config->GetBoolean("ControlsGeneral", "vibration_enabled", true); | 292 | sdl2_config->GetBoolean("ControlsGeneral", "vibration_enabled", true)); |
| 293 | Settings::values.motion_enabled = | 293 | Settings::values.enable_accurate_vibrations.SetValue( |
| 294 | sdl2_config->GetBoolean("ControlsGeneral", "motion_enabled", true); | 294 | sdl2_config->GetBoolean("ControlsGeneral", "enable_accurate_vibrations", false)); |
| 295 | Settings::values.motion_enabled.SetValue( | ||
| 296 | sdl2_config->GetBoolean("ControlsGeneral", "motion_enabled", true)); | ||
| 295 | Settings::values.touchscreen.enabled = | 297 | Settings::values.touchscreen.enabled = |
| 296 | sdl2_config->GetBoolean("ControlsGeneral", "touch_enabled", true); | 298 | sdl2_config->GetBoolean("ControlsGeneral", "touch_enabled", true); |
| 297 | Settings::values.touchscreen.device = | 299 | Settings::values.touchscreen.device = |
| @@ -343,7 +345,8 @@ void Config::ReadValues() { | |||
| 343 | Settings::values.gamecard_path = sdl2_config->Get("Data Storage", "gamecard_path", ""); | 345 | Settings::values.gamecard_path = sdl2_config->Get("Data Storage", "gamecard_path", ""); |
| 344 | 346 | ||
| 345 | // System | 347 | // System |
| 346 | Settings::values.use_docked_mode = sdl2_config->GetBoolean("System", "use_docked_mode", false); | 348 | Settings::values.use_docked_mode.SetValue( |
| 349 | sdl2_config->GetBoolean("System", "use_docked_mode", false)); | ||
| 347 | const auto size = sdl2_config->GetInteger("System", "users_size", 0); | 350 | const auto size = sdl2_config->GetInteger("System", "users_size", 0); |
| 348 | 351 | ||
| 349 | Settings::values.current_user = std::clamp<int>( | 352 | Settings::values.current_user = std::clamp<int>( |