summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar german772021-11-04 13:08:30 -0600
committerGravatar Narr the Reg2021-11-24 20:30:27 -0600
commitd14e74132ceaa8b5efef8a7d543cb50429cb4fb3 (patch)
treeb59b5034ac0262d84da6dbeb7496c83e282b80f8 /src
parentcore/hid: Rename NpadType to NpadStyleIndex (diff)
downloadyuzu-d14e74132ceaa8b5efef8a7d543cb50429cb4fb3.tar.gz
yuzu-d14e74132ceaa8b5efef8a7d543cb50429cb4fb3.tar.xz
yuzu-d14e74132ceaa8b5efef8a7d543cb50429cb4fb3.zip
settings: Fix controller preview not displaying the correct controller
Diffstat (limited to 'src')
-rw-r--r--src/core/hid/emulated_controller.cpp4
-rw-r--r--src/yuzu/configuration/configure_input_player_widget.cpp4
-rw-r--r--src/yuzu/main.cpp3
3 files changed, 7 insertions, 4 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index a200992f2..a9038e06f 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -880,7 +880,7 @@ void EmulatedController::Disconnect() {
880} 880}
881 881
882bool EmulatedController::IsConnected(bool get_temporary_value) const { 882bool EmulatedController::IsConnected(bool get_temporary_value) const {
883 if (get_temporary_value) { 883 if (get_temporary_value && is_configuring) {
884 return tmp_is_connected; 884 return tmp_is_connected;
885 } 885 }
886 return is_connected; 886 return is_connected;
@@ -897,7 +897,7 @@ NpadIdType EmulatedController::GetNpadIdType() const {
897} 897}
898 898
899NpadStyleIndex EmulatedController::GetNpadStyleIndex(bool get_temporary_value) const { 899NpadStyleIndex EmulatedController::GetNpadStyleIndex(bool get_temporary_value) const {
900 if (get_temporary_value) { 900 if (get_temporary_value && is_configuring) {
901 return tmp_npad_type; 901 return tmp_npad_type;
902 } 902 }
903 return npad_type; 903 return npad_type;
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp
index e63c25e70..af65cf64c 100644
--- a/src/yuzu/configuration/configure_input_player_widget.cpp
+++ b/src/yuzu/configuration/configure_input_player_widget.cpp
@@ -2394,7 +2394,7 @@ void PlayerControlPreview::DrawGCJoystick(QPainter& p, const QPointF center,
2394 2394
2395void PlayerControlPreview::DrawRawJoystick(QPainter& p, QPointF center_left, QPointF center_right) { 2395void PlayerControlPreview::DrawRawJoystick(QPainter& p, QPointF center_left, QPointF center_right) {
2396 using namespace Settings::NativeAnalog; 2396 using namespace Settings::NativeAnalog;
2397 if (controller_type != Core::HID::NpadStyleIndex::JoyconLeft) { 2397 if (center_right != QPointF(0, 0)) {
2398 DrawJoystickProperties(p, center_right, stick_values[RStick].x.properties); 2398 DrawJoystickProperties(p, center_right, stick_values[RStick].x.properties);
2399 p.setPen(colors.indicator); 2399 p.setPen(colors.indicator);
2400 p.setBrush(colors.indicator); 2400 p.setBrush(colors.indicator);
@@ -2404,7 +2404,7 @@ void PlayerControlPreview::DrawRawJoystick(QPainter& p, QPointF center_left, QPo
2404 DrawJoystickDot(p, center_right, stick_values[RStick], false); 2404 DrawJoystickDot(p, center_right, stick_values[RStick], false);
2405 } 2405 }
2406 2406
2407 if (controller_type != Core::HID::NpadStyleIndex::JoyconRight) { 2407 if (center_left != QPointF(0, 0)) {
2408 DrawJoystickProperties(p, center_left, stick_values[LStick].x.properties); 2408 DrawJoystickProperties(p, center_left, stick_values[LStick].x.properties);
2409 p.setPen(colors.indicator); 2409 p.setPen(colors.indicator);
2410 p.setBrush(colors.indicator); 2410 p.setBrush(colors.indicator);
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index a10522f5f..baf7b38b4 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -230,6 +230,7 @@ GMainWindow::GMainWindow()
230 ConnectWidgetEvents(); 230 ConnectWidgetEvents();
231 231
232 system->HIDCore().ReloadInputDevices(); 232 system->HIDCore().ReloadInputDevices();
233 controller_dialog->refreshConfiguration();
233 234
234 const auto branch_name = std::string(Common::g_scm_branch); 235 const auto branch_name = std::string(Common::g_scm_branch);
235 const auto description = std::string(Common::g_scm_desc); 236 const auto description = std::string(Common::g_scm_desc);
@@ -843,6 +844,7 @@ void GMainWindow::InitializeWidgets() {
843 handheld->Disconnect(); 844 handheld->Disconnect();
844 player_1->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController); 845 player_1->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController);
845 player_1->Connect(); 846 player_1->Connect();
847 controller_dialog->refreshConfiguration();
846 } 848 }
847 849
848 Settings::values.use_docked_mode.SetValue(!is_docked); 850 Settings::values.use_docked_mode.SetValue(!is_docked);
@@ -2744,6 +2746,7 @@ void GMainWindow::OnConfigure() {
2744 } 2746 }
2745 2747
2746 UpdateStatusButtons(); 2748 UpdateStatusButtons();
2749 controller_dialog->refreshConfiguration();
2747} 2750}
2748 2751
2749void GMainWindow::OnConfigureTas() { 2752void GMainWindow::OnConfigureTas() {