diff options
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 291e37acf..a0f29d147 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <QMenu> | 10 | #include <QMenu> |
| 11 | #include <QMessageBox> | 11 | #include <QMessageBox> |
| 12 | #include <QTimer> | 12 | #include <QTimer> |
| 13 | #include "common/assert.h" | ||
| 13 | #include "common/param_package.h" | 14 | #include "common/param_package.h" |
| 14 | #include "core/hid/emulated_controller.h" | 15 | #include "core/hid/emulated_controller.h" |
| 15 | #include "core/hid/hid_core.h" | 16 | #include "core/hid/hid_core.h" |
| @@ -119,6 +120,23 @@ QString GetButtonName(Common::Input::ButtonNames button_name) { | |||
| 119 | } | 120 | } |
| 120 | } | 121 | } |
| 121 | 122 | ||
| 123 | QString GetDirectionName(const std::string& direction) { | ||
| 124 | if (direction == "left") { | ||
| 125 | return QObject::tr("Left"); | ||
| 126 | } | ||
| 127 | if (direction == "right") { | ||
| 128 | return QObject::tr("Right"); | ||
| 129 | } | ||
| 130 | if (direction == "up") { | ||
| 131 | return QObject::tr("Up"); | ||
| 132 | } | ||
| 133 | if (direction == "down") { | ||
| 134 | return QObject::tr("Down"); | ||
| 135 | } | ||
| 136 | UNIMPLEMENTED_MSG("Unimplemented direction name={}", direction); | ||
| 137 | return QString::fromStdString(direction); | ||
| 138 | } | ||
| 139 | |||
| 122 | void SetAnalogParam(const Common::ParamPackage& input_param, Common::ParamPackage& analog_param, | 140 | void SetAnalogParam(const Common::ParamPackage& input_param, Common::ParamPackage& analog_param, |
| 123 | const std::string& button_name) { | 141 | const std::string& button_name) { |
| 124 | // The poller returned a complete axis, so set all the buttons | 142 | // The poller returned a complete axis, so set all the buttons |
| @@ -162,7 +180,7 @@ QString ConfigureInputPlayer::ButtonToText(const Common::ParamPackage& param) { | |||
| 162 | 180 | ||
| 163 | if (common_button_name == Common::Input::ButtonNames::Value) { | 181 | if (common_button_name == Common::Input::ButtonNames::Value) { |
| 164 | if (param.Has("hat")) { | 182 | if (param.Has("hat")) { |
| 165 | const QString hat = QString::fromStdString(param.Get("direction", "")); | 183 | const QString hat = GetDirectionName(param.Get("direction", "")); |
| 166 | return QObject::tr("%1%2Hat %3").arg(toggle, inverted, hat); | 184 | return QObject::tr("%1%2Hat %3").arg(toggle, inverted, hat); |
| 167 | } | 185 | } |
| 168 | if (param.Has("axis")) { | 186 | if (param.Has("axis")) { |