summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle K <190571+Docteh@users.noreply.github.com>2022-04-18 14:35:54 +0200
committerKyle K <190571+Docteh@users.noreply.github.com>2022-04-19 13:24:39 +0200
commitc99712ea7d991036d3b78b94e4e1faf9c7f9c074 (patch)
tree34d03fe9ac991a12e13e1705be17d3d460225def
parentMerge pull request #8223 from Tachi107/patch-3 (diff)
downloadyuzu-c99712ea7d991036d3b78b94e4e1faf9c7f9c074.tar
yuzu-c99712ea7d991036d3b78b94e4e1faf9c7f9c074.tar.gz
yuzu-c99712ea7d991036d3b78b94e4e1faf9c7f9c074.tar.bz2
yuzu-c99712ea7d991036d3b78b94e4e1faf9c7f9c074.tar.lz
yuzu-c99712ea7d991036d3b78b94e4e1faf9c7f9c074.tar.xz
yuzu-c99712ea7d991036d3b78b94e4e1faf9c7f9c074.tar.zst
yuzu-c99712ea7d991036d3b78b94e4e1faf9c7f9c074.zip
-rw-r--r--src/yuzu/configuration/configure_input_player.cpp20
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 @@
#include <QMenu>
#include <QMessageBox>
#include <QTimer>
+#include "common/assert.h"
#include "common/param_package.h"
#include "core/hid/emulated_controller.h"
#include "core/hid/hid_core.h"
@@ -119,6 +120,23 @@ QString GetButtonName(Common::Input::ButtonNames button_name) {
}
}
+QString GetDirectionName(const std::string& direction) {
+ if (direction == "left") {
+ return QObject::tr("Left");
+ }
+ if (direction == "right") {
+ return QObject::tr("Right");
+ }
+ if (direction == "up") {
+ return QObject::tr("Up");
+ }
+ if (direction == "down") {
+ return QObject::tr("Down");
+ }
+ UNIMPLEMENTED_MSG("Unimplemented direction name={}", direction);
+ return QString::fromStdString(direction);
+}
+
void SetAnalogParam(const Common::ParamPackage& input_param, Common::ParamPackage& analog_param,
const std::string& button_name) {
// The poller returned a complete axis, so set all the buttons
@@ -162,7 +180,7 @@ QString ConfigureInputPlayer::ButtonToText(const Common::ParamPackage& param) {
if (common_button_name == Common::Input::ButtonNames::Value) {
if (param.Has("hat")) {
- const QString hat = QString::fromStdString(param.Get("direction", ""));
+ const QString hat = GetDirectionName(param.Get("direction", ""));
return QObject::tr("%1%2Hat %3").arg(toggle, inverted, hat);
}
if (param.Has("axis")) {