diff --git a/rpcs3/Json/pad_settings.json b/rpcs3/Json/pad_settings.json new file mode 100644 index 0000000000..f222db6052 --- /dev/null +++ b/rpcs3/Json/pad_settings.json @@ -0,0 +1,15 @@ +{ + "handlers": { + "null": "This controller is disabled and will appear as disconnected to software. Choose another handler to enable it.", + "keyboard": "While it is possible to use a keyboard as a pad in RPCS3, the use of an actual controller is strongly recommended. To bind mouse movement to a button or joystick, click on the desired button to activate it, then click and hold while dragging the mouse to a direction", + "ds3_windows": "In order to use the DualShock 3 handler, you need to install the official DualShock 3 driver first.\nSee the RPCS3 Wiki for instructions.", + "ds3_linux": "In order to use the DualShock 3 handler, you might need to add udev rules to let RPCS3 access the controller.\nSee the RPCS3 Wiki for instructions.", + "ds3_other": "The DualShock 3 handler is recommended for official DualShock 3 controllers.", + "ds4_windows": "If you have any issues with the DualShock 4 handler, it might be caused by third-party tools such as DS4Windows. It's recommended that you disable them while using this handler.", + "ds4_linux": "In order to use the DualShock 4 handler, you might need to add udev rules to let RPCS3 access the controller.\nSee the RPCS3 Wiki for instructions.", + "ds4_other": "The DualShock 4 handler is recommended for official DualShock 4 controllers.", + "xinput": "The XInput handler will work with Xbox controllers and many third-party PC-compatible controllers.", + "evdev": "The evdev handler should work with any controller that has linux support.\nIf your joystick is not being centered properly, read the RPCS3 Wiki for instructions.", + "mmjoy": "The MMJoystick handler should work with almost any controller recognized by Windows. However, it is recommended that you use the more specific handlers if you have a controller that supports them." + } +} diff --git a/rpcs3/resources.qrc b/rpcs3/resources.qrc index 14a3a0d619..d14201e213 100644 --- a/rpcs3/resources.qrc +++ b/rpcs3/resources.qrc @@ -14,6 +14,7 @@ Icons/list.png Icons/refresh.png Json/tooltips.json + Json/pad_settings.json Icons/exit_fullscreen.png Icons/open.png Icons/custom_config.png diff --git a/rpcs3/rpcs3qt/pad_settings_dialog.cpp b/rpcs3/rpcs3qt/pad_settings_dialog.cpp index 26b62a4fc2..36bc580938 100644 --- a/rpcs3/rpcs3qt/pad_settings_dialog.cpp +++ b/rpcs3/rpcs3qt/pad_settings_dialog.cpp @@ -68,6 +68,14 @@ pad_settings_dialog::pad_settings_dialog(QWidget *parent, const GameInfo *game) setWindowTitle(tr("Gamepads Settings")); } + // Load tooltips + QFile json_file(":/Json/pad_settings.json"); + json_file.open(QIODevice::ReadOnly | QIODevice::Text); + QJsonObject json_obj = QJsonDocument::fromJson(json_file.readAll()).object(); + json_file.close(); + + m_json_handlers = json_obj.value("handlers").toObject(); + // Create tab widget for 7 players m_tabs = new QTabWidget; for (int i = 1; i < 8; i++) @@ -928,6 +936,43 @@ void pad_settings_dialog::ChangeInputType() m_handler = GetHandler(g_cfg_input.player[player]->handler); const auto device_list = m_handler->ListDevices(); + // Change the description + QString description; + switch (m_handler->m_type) + { + case pad_handler::null: + description = m_json_handlers["null"].toString(); break; + case pad_handler::keyboard: + description = m_json_handlers["keyboard"].toString(); break; +#ifdef _WIN32 + case pad_handler::xinput: + description = m_json_handlers["xinput"].toString(); break; + case pad_handler::mm: + description = m_json_handlers["mmjoy"].toString(); break; + case pad_handler::ds3: + description = m_json_handlers["ds3_windows"].toString(); break; + case pad_handler::ds4: + description = m_json_handlers["ds4_windows"].toString(); break; +#elif __linux__ + case pad_handler::ds3: + description = m_json_handlers["ds3_linux"].toString(); break; + case pad_handler::ds4: + description = m_json_handlers["ds4_linux"].toString(); break; +#else + case pad_handler::ds3: + description = m_json_handlers["ds3_other"].toString(); break; + case pad_handler::ds4: + description = m_json_handlers["ds4_other"].toString(); break; +#endif +#ifdef HAVE_LIBEVDEV + case pad_handler::evdev: + description = (m_json_handlers["evdev"].toString()); break; +#endif + default: + description = ""; + } + ui->l_description->setText(description); + // change our contextual widgets ui->left_stack->setCurrentIndex((m_handler->m_type == pad_handler::keyboard) ? 1 : 0); ui->right_stack->setCurrentIndex((m_handler->m_type == pad_handler::keyboard) ? 1 : 0); diff --git a/rpcs3/rpcs3qt/pad_settings_dialog.h b/rpcs3/rpcs3qt/pad_settings_dialog.h index fa587ae867..2ba12231a8 100644 --- a/rpcs3/rpcs3qt/pad_settings_dialog.h +++ b/rpcs3/rpcs3qt/pad_settings_dialog.h @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -103,6 +104,9 @@ private: Ui::pad_settings_dialog *ui; std::string m_title_id; + // Tooltip things + QJsonObject m_json_handlers; + // TabWidget QTabWidget* m_tabs = nullptr; diff --git a/rpcs3/rpcs3qt/pad_settings_dialog.ui b/rpcs3/rpcs3qt/pad_settings_dialog.ui index b5b9de5500..7680f340d9 100644 --- a/rpcs3/rpcs3qt/pad_settings_dialog.ui +++ b/rpcs3/rpcs3qt/pad_settings_dialog.ui @@ -997,7 +997,7 @@ - + 0 @@ -1540,10 +1540,10 @@ - To use a DualShock 3 controller on Windows you can now use Sony's official drivers. To get them you'll have to install PlayStation Now, since the drivers are bundled with it. + This text should be replaced by an actual description.<br/><br/> - Qt::PlainText + Qt::RichText Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop @@ -1551,6 +1551,9 @@ true + + true +