From 62fda70c418030f95d1f3c7d5b8d6c517bbfbb71 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Thu, 21 Apr 2022 03:55:46 +0200 Subject: [PATCH] early-access version 2688 --- README.md | 2 +- src/input_common/helpers/udp_protocol.h | 9 +++++++++ .../configuration/configure_input_player.cpp | 20 ++++++++++++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9cf6d2cca..37e4882fa 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2687. +This is the source code for early-access 2688. ## Legal Notice diff --git a/src/input_common/helpers/udp_protocol.h b/src/input_common/helpers/udp_protocol.h index 9c205e944..597f51cd3 100755 --- a/src/input_common/helpers/udp_protocol.h +++ b/src/input_common/helpers/udp_protocol.h @@ -8,8 +8,17 @@ #include #include +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4701) // Potentially uninitialized local variable 'result' used +#endif + #include +#ifdef _MSC_VER +#pragma warning(pop) +#endif + #include "common/swap.h" namespace InputCommon::CemuhookUDP { diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index c10ad254a..b4f5d172a 100755 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp @@ -10,6 +10,7 @@ #include #include #include +#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")) {