diff options
| -rw-r--r-- | src/input_common/sdl/sdl_impl.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.ui | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index 20a658a26..1853f535d 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp | |||
| @@ -461,7 +461,7 @@ public: | |||
| 461 | const int axis_x = params.Get("axis_x", 0); | 461 | const int axis_x = params.Get("axis_x", 0); |
| 462 | const int axis_y = params.Get("axis_y", 1); | 462 | const int axis_y = params.Get("axis_y", 1); |
| 463 | const float deadzone = std::clamp(params.Get("deadzone", 0.0f), 0.0f, .99f); | 463 | const float deadzone = std::clamp(params.Get("deadzone", 0.0f), 0.0f, .99f); |
| 464 | const float range = std::clamp(params.Get("range", 0.0f), 0.0f, .99f) + 0.50f; | 464 | const float range = std::clamp(params.Get("range", 0.0f), 0.50f, 1.50f); |
| 465 | auto joystick = state.GetSDLJoystickByGUID(guid, port); | 465 | auto joystick = state.GetSDLJoystickByGUID(guid, port); |
| 466 | 466 | ||
| 467 | // This is necessary so accessing GetAxis with axis_x and axis_y won't crash | 467 | // This is necessary so accessing GetAxis with axis_x and axis_y won't crash |
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 2ef952b67..8bc86b706 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp | |||
| @@ -272,6 +272,8 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i | |||
| 272 | ui->sliderRStickDeadzoneAndModifier}; | 272 | ui->sliderRStickDeadzoneAndModifier}; |
| 273 | analog_map_deadzone_and_modifier_slider_label = {ui->labelLStickDeadzoneAndModifier, | 273 | analog_map_deadzone_and_modifier_slider_label = {ui->labelLStickDeadzoneAndModifier, |
| 274 | ui->labelRStickDeadzoneAndModifier}; | 274 | ui->labelRStickDeadzoneAndModifier}; |
| 275 | ui->sliderLStickRange->setRange(50, 150); | ||
| 276 | ui->sliderRStickRange->setRange(50, 150); | ||
| 275 | analog_map_range_slider = {ui->sliderLStickRange, ui->sliderRStickRange}; | 277 | analog_map_range_slider = {ui->sliderLStickRange, ui->sliderRStickRange}; |
| 276 | analog_map_range_slider_label = {ui->labelLStickRange, ui->labelRStickRange}; | 278 | analog_map_range_slider_label = {ui->labelLStickRange, ui->labelRStickRange}; |
| 277 | 279 | ||
| @@ -386,7 +388,7 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i | |||
| 386 | const auto engine = analogs_param[analog_id].Get("engine", ""); | 388 | const auto engine = analogs_param[analog_id].Get("engine", ""); |
| 387 | if (engine == "sdl" || engine == "gcpad") { | 389 | if (engine == "sdl" || engine == "gcpad") { |
| 388 | analog_map_range_slider_label[analog_id]->setText( | 390 | analog_map_range_slider_label[analog_id]->setText( |
| 389 | tr("Range: %1%").arg(slider_value + 50.0f)); | 391 | tr("Range: %1%").arg(slider_value)); |
| 390 | analogs_param[analog_id].Set("range", slider_value / 100.0f); | 392 | analogs_param[analog_id].Set("range", slider_value / 100.0f); |
| 391 | } | 393 | } |
| 392 | }); | 394 | }); |
| @@ -613,7 +615,7 @@ void ConfigureInputPlayer::UpdateButtonLabels() { | |||
| 613 | } | 615 | } |
| 614 | // QtSlider returns values from 0.0-0.99. We want range to be from 50% to 150% | 616 | // QtSlider returns values from 0.0-0.99. We want range to be from 50% to 150% |
| 615 | analog_stick_range->setValue(static_cast<int>(param.Get("range", 0.1f) * 100)); | 617 | analog_stick_range->setValue(static_cast<int>(param.Get("range", 0.1f) * 100)); |
| 616 | if (analog_stick_range->value() == 0) { | 618 | if (analog_stick_range->value() == 50) { |
| 617 | analog_stick_range_label->setText(tr("Range: 50%")); | 619 | analog_stick_range_label->setText(tr("Range: 50%")); |
| 618 | } | 620 | } |
| 619 | } else { | 621 | } else { |
diff --git a/src/yuzu/configuration/configure_input_player.ui b/src/yuzu/configuration/configure_input_player.ui index c68c9228b..91065dcde 100644 --- a/src/yuzu/configuration/configure_input_player.ui +++ b/src/yuzu/configuration/configure_input_player.ui | |||
| @@ -222,7 +222,6 @@ | |||
| 222 | </widget> | 222 | </widget> |
| 223 | </item> | 223 | </item> |
| 224 | </layout> | 224 | </layout> |
| 225 | |||
| 226 | </item> | 225 | </item> |
| 227 | <item row="6" column="0"> | 226 | <item row="6" column="0"> |
| 228 | <spacer name="RStick_verticalSpacer"> | 227 | <spacer name="RStick_verticalSpacer"> |
| @@ -840,7 +839,6 @@ | |||
| 840 | </item> | 839 | </item> |
| 841 | </layout> | 840 | </layout> |
| 842 | </item> | 841 | </item> |
| 843 | |||
| 844 | <item row="6" column="1" colspan="2"> | 842 | <item row="6" column="1" colspan="2"> |
| 845 | <layout class="QVBoxLayout" name="sliderLStickRangeVerticalLayout"> | 843 | <layout class="QVBoxLayout" name="sliderLStickRangeVerticalLayout"> |
| 846 | <property name="sizeConstraint"> | 844 | <property name="sizeConstraint"> |
| @@ -868,7 +866,6 @@ | |||
| 868 | </widget> | 866 | </widget> |
| 869 | </item> | 867 | </item> |
| 870 | </layout> | 868 | </layout> |
| 871 | |||
| 872 | </item> | 869 | </item> |
| 873 | <item row="7" column="1"> | 870 | <item row="7" column="1"> |
| 874 | <spacer name="LStick_verticalSpacer"> | 871 | <spacer name="LStick_verticalSpacer"> |