فهرست منبع

Add cancel option to analog stick configuration

Co-Authored-By: Vitor K <vitor-k@users.noreply.github.com>
fearlessTobi 6 سال پیش
والد
کامیت
22fd208e8d
1فایلهای تغییر یافته به همراه10 افزوده شده و 7 حذف شده
  1. 10 7
      src/yuzu/configuration/configure_input_player.cpp

+ 10 - 7
src/yuzu/configuration/configure_input_player.cpp

@@ -301,13 +301,16 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
                     });
         }
         connect(analog_map_stick[analog_id], &QPushButton::clicked, [=] {
-            QMessageBox::information(this, tr("Information"),
-                                     tr("After pressing OK, first move your joystick horizontally, "
-                                        "and then vertically."));
-            HandleClick(
-                analog_map_stick[analog_id],
-                [=](const Common::ParamPackage& params) { analogs_param[analog_id] = params; },
-                InputCommon::Polling::DeviceType::Analog);
+            if (QMessageBox::information(
+                    this, tr("Information"),
+                    tr("After pressing OK, first move your joystick horizontally, "
+                       "and then vertically."),
+                    QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
+                HandleClick(
+                    analog_map_stick[analog_id],
+                    [=](const Common::ParamPackage& params) { analogs_param[analog_id] = params; },
+                    InputCommon::Polling::DeviceType::Analog);
+            }
         });
     }