From 9d4edd4e88d291aa4b778b74f6e9daa9dd358d2b Mon Sep 17 00:00:00 2001
From: Morph <39850852+Morph1984@users.noreply.github.com>
Date: Sun, 13 Sep 2020 09:25:22 -0400
Subject: ui/themes: Cleanup UI
---
src/yuzu/configuration/configure_input_advanced.ui | 192 ++++++++++-----------
1 file changed, 96 insertions(+), 96 deletions(-)
(limited to 'src/yuzu/configuration/configure_input_advanced.ui')
diff --git a/src/yuzu/configuration/configure_input_advanced.ui b/src/yuzu/configuration/configure_input_advanced.ui
index 5958435fc..a880a7c68 100644
--- a/src/yuzu/configuration/configure_input_advanced.ui
+++ b/src/yuzu/configuration/configure_input_advanced.ui
@@ -192,18 +192,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -247,18 +247,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -323,18 +323,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -378,18 +378,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -478,18 +478,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -533,18 +533,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -609,18 +609,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -664,18 +664,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -782,18 +782,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -837,18 +837,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -913,18 +913,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -968,18 +968,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1068,18 +1068,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1123,18 +1123,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1199,18 +1199,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1254,18 +1254,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1393,18 +1393,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1448,18 +1448,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1524,18 +1524,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1579,18 +1579,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1679,18 +1679,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1734,18 +1734,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1810,18 +1810,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1865,18 +1865,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -1983,18 +1983,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -2038,18 +2038,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -2114,18 +2114,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -2169,18 +2169,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -2269,18 +2269,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -2324,18 +2324,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -2400,18 +2400,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
@@ -2455,18 +2455,18 @@
- 57
+ 68
0
- 55
+ 68
16777215
- min-width: 55px;
+ min-width: 68px;
--
cgit v1.2.3
From b57ba7bfb6792e054033e828120b79b78587d58d Mon Sep 17 00:00:00 2001
From: german
Date: Thu, 26 Nov 2020 20:56:06 -0600
Subject: Disable analog joystick from buttons by default
---
src/core/settings.h | 2 ++
src/input_common/analog_from_button.cpp | 22 ++++++++++++++-
src/yuzu/configuration/config.cpp | 5 ++++
.../configuration/configure_input_advanced.cpp | 2 ++
src/yuzu/configuration/configure_input_advanced.ui | 31 +++++++++++++++-------
5 files changed, 52 insertions(+), 10 deletions(-)
(limited to 'src/yuzu/configuration/configure_input_advanced.ui')
diff --git a/src/core/settings.h b/src/core/settings.h
index 1143aba5d..55310fe3d 100644
--- a/src/core/settings.h
+++ b/src/core/settings.h
@@ -178,6 +178,8 @@ struct Values {
u16 udp_input_port;
u8 udp_pad_index;
+ bool emulate_analog_keyboard;
+
bool mouse_enabled;
std::string mouse_device;
MouseButtonsRaw mouse_buttons;
diff --git a/src/input_common/analog_from_button.cpp b/src/input_common/analog_from_button.cpp
index d748c1c04..40b516f85 100755
--- a/src/input_common/analog_from_button.cpp
+++ b/src/input_common/analog_from_button.cpp
@@ -6,6 +6,7 @@
#include
#include
#include "common/math_util.h"
+#include "core/settings.h"
#include "input_common/analog_from_button.h"
namespace InputCommon {
@@ -112,7 +113,26 @@ public:
}
std::tuple GetStatus() const override {
- return std::make_tuple(std::cos(angle) * amplitude, std::sin(angle) * amplitude);
+ if (Settings::values.emulate_analog_keyboard) {
+ return std::make_tuple(std::cos(angle) * amplitude, std::sin(angle) * amplitude);
+ }
+ constexpr float SQRT_HALF = 0.707106781f;
+ int x = 0, y = 0;
+ if (right->GetStatus()) {
+ ++x;
+ }
+ if (left->GetStatus()) {
+ --x;
+ }
+ if (up->GetStatus()) {
+ ++y;
+ }
+ if (down->GetStatus()) {
+ --y;
+ }
+ const float coef = modifier->GetStatus() ? modifier_scale : 1.0f;
+ return std::make_tuple(static_cast(x) * coef * (y == 0 ? 1.0f : SQRT_HALF),
+ static_cast(y) * coef * (x == 0 ? 1.0f : SQRT_HALF));
}
bool GetAnalogDirectionStatus(Input::AnalogDirection direction) const override {
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index 3c423a271..bdd923cbe 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -510,6 +510,9 @@ void Config::ReadControlValues() {
ReadTouchscreenValues();
ReadMotionTouchValues();
+ Settings::values.emulate_analog_keyboard =
+ ReadSetting(QStringLiteral("emulate_analog_keyboard"), false).toBool();
+
ReadSettingGlobal(Settings::values.use_docked_mode, QStringLiteral("use_docked_mode"), false);
ReadSettingGlobal(Settings::values.vibration_enabled, QStringLiteral("vibration_enabled"),
true);
@@ -1193,6 +1196,8 @@ void Config::SaveControlValues() {
QString::fromStdString(Settings::values.touch_device),
QStringLiteral("engine:emu_window"));
WriteSetting(QStringLiteral("keyboard_enabled"), Settings::values.keyboard_enabled, false);
+ WriteSetting(QStringLiteral("emulate_analog_keyboard"),
+ Settings::values.emulate_analog_keyboard, false);
qt_config->endGroup();
}
diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp
index abaf03630..4e557bc6f 100644
--- a/src/yuzu/configuration/configure_input_advanced.cpp
+++ b/src/yuzu/configuration/configure_input_advanced.cpp
@@ -121,6 +121,7 @@ void ConfigureInputAdvanced::ApplyConfiguration() {
Settings::values.debug_pad_enabled = ui->debug_enabled->isChecked();
Settings::values.mouse_enabled = ui->mouse_enabled->isChecked();
Settings::values.keyboard_enabled = ui->keyboard_enabled->isChecked();
+ Settings::values.emulate_analog_keyboard = ui->emulate_analog_keyboard->isChecked();
Settings::values.touchscreen.enabled = ui->touchscreen_enabled->isChecked();
}
@@ -147,6 +148,7 @@ void ConfigureInputAdvanced::LoadConfiguration() {
ui->debug_enabled->setChecked(Settings::values.debug_pad_enabled);
ui->mouse_enabled->setChecked(Settings::values.mouse_enabled);
ui->keyboard_enabled->setChecked(Settings::values.keyboard_enabled);
+ ui->emulate_analog_keyboard->setChecked(Settings::values.emulate_analog_keyboard);
ui->touchscreen_enabled->setChecked(Settings::values.touchscreen.enabled);
UpdateUIEnabled();
diff --git a/src/yuzu/configuration/configure_input_advanced.ui b/src/yuzu/configuration/configure_input_advanced.ui
index a880a7c68..f207e5d3b 100644
--- a/src/yuzu/configuration/configure_input_advanced.ui
+++ b/src/yuzu/configuration/configure_input_advanced.ui
@@ -2546,14 +2546,27 @@
- -
+
-
+
+
+
+ 0
+ 23
+
+
+
+ Emulate Analog with Keyboard Input
+
+
+
+ -
Advanced
- -
+
-
Qt::Horizontal
@@ -2569,21 +2582,21 @@
- -
+
-
Advanced
- -
+
-
Touchscreen
- -
+
-
@@ -2596,28 +2609,28 @@
- -
+
-
Motion / Touch
- -
+
-
Configure
- -
+
-
Debug Controller
- -
+
-
Configure
--
cgit v1.2.3