early-access version 2688

This commit is contained in:
pineappleEA 2022-04-21 03:55:46 +02:00
parent 8aa17b7ffc
commit 62fda70c41
3 changed files with 29 additions and 2 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 2687. This is the source code for early-access 2688.
## Legal Notice ## Legal Notice

View file

@ -8,8 +8,17 @@
#include <optional> #include <optional>
#include <type_traits> #include <type_traits>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4701) // Potentially uninitialized local variable 'result' used
#endif
#include <boost/crc.hpp> #include <boost/crc.hpp>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "common/swap.h" #include "common/swap.h"
namespace InputCommon::CemuhookUDP { namespace InputCommon::CemuhookUDP {

View file

@ -10,6 +10,7 @@
#include <QMenu> #include <QMenu>
#include <QMessageBox> #include <QMessageBox>
#include <QTimer> #include <QTimer>
#include "common/assert.h"
#include "common/param_package.h" #include "common/param_package.h"
#include "core/hid/emulated_controller.h" #include "core/hid/emulated_controller.h"
#include "core/hid/hid_core.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, void SetAnalogParam(const Common::ParamPackage& input_param, Common::ParamPackage& analog_param,
const std::string& button_name) { const std::string& button_name) {
// The poller returned a complete axis, so set all the buttons // 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 (common_button_name == Common::Input::ButtonNames::Value) {
if (param.Has("hat")) { 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); return QObject::tr("%1%2Hat %3").arg(toggle, inverted, hat);
} }
if (param.Has("axis")) { if (param.Has("axis")) {