early-access version 3729

main
pineappleEA 2023-07-01 07:36:50 +02:00
parent 9c1647cbcf
commit c30c5be9f1
30 changed files with 17652 additions and 14397 deletions

View File

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

1308
dist/languages/ca.ts vendored

File diff suppressed because it is too large Load Diff

1294
dist/languages/cs.ts vendored

File diff suppressed because it is too large Load Diff

1284
dist/languages/da.ts vendored

File diff suppressed because it is too large Load Diff

1472
dist/languages/de.ts vendored

File diff suppressed because it is too large Load Diff

1294
dist/languages/el.ts vendored

File diff suppressed because it is too large Load Diff

1292
dist/languages/es.ts vendored

File diff suppressed because it is too large Load Diff

1289
dist/languages/fr.ts vendored

File diff suppressed because it is too large Load Diff

1340
dist/languages/id.ts vendored

File diff suppressed because it is too large Load Diff

1332
dist/languages/it.ts vendored

File diff suppressed because it is too large Load Diff

1352
dist/languages/ja_JP.ts vendored

File diff suppressed because it is too large Load Diff

1357
dist/languages/ko_KR.ts vendored

File diff suppressed because it is too large Load Diff

1288
dist/languages/nb.ts vendored

File diff suppressed because it is too large Load Diff

1296
dist/languages/nl.ts vendored

File diff suppressed because it is too large Load Diff

1368
dist/languages/pl.ts vendored

File diff suppressed because it is too large Load Diff

1342
dist/languages/pt_BR.ts vendored

File diff suppressed because it is too large Load Diff

1344
dist/languages/pt_PT.ts vendored

File diff suppressed because it is too large Load Diff

1314
dist/languages/ru_RU.ts vendored

File diff suppressed because it is too large Load Diff

1284
dist/languages/sv.ts vendored

File diff suppressed because it is too large Load Diff

1288
dist/languages/tr_TR.ts vendored

File diff suppressed because it is too large Load Diff

1306
dist/languages/uk.ts vendored

File diff suppressed because it is too large Load Diff

1322
dist/languages/vi.ts vendored

File diff suppressed because it is too large Load Diff

1322
dist/languages/vi_VN.ts vendored

File diff suppressed because it is too large Load Diff

1288
dist/languages/zh_CN.ts vendored

File diff suppressed because it is too large Load Diff

1602
dist/languages/zh_TW.ts vendored

File diff suppressed because it is too large Load Diff

View File

@ -85,7 +85,7 @@ void Mouse::UpdateThread(std::stop_token stop_token) {
} }
void Mouse::UpdateStickInput() { void Mouse::UpdateStickInput() {
if (!Settings::values.mouse_panning) { if (!IsMousePanningEnabled()) {
return; return;
} }
@ -111,8 +111,8 @@ void Mouse::UpdateStickInput() {
} }
void Mouse::UpdateMotionInput() { void Mouse::UpdateMotionInput() {
const float sensitivity = Settings::values.mouse_panning ? default_motion_panning_sensitivity const float sensitivity =
: default_motion_sensitivity; IsMousePanningEnabled() ? default_motion_panning_sensitivity : default_motion_sensitivity;
const float rotation_velocity = std::sqrt(last_motion_change.x * last_motion_change.x + const float rotation_velocity = std::sqrt(last_motion_change.x * last_motion_change.x +
last_motion_change.y * last_motion_change.y); last_motion_change.y * last_motion_change.y);
@ -134,7 +134,7 @@ void Mouse::UpdateMotionInput() {
.delta_timestamp = update_time * 1000, .delta_timestamp = update_time * 1000,
}; };
if (Settings::values.mouse_panning) { if (IsMousePanningEnabled()) {
last_motion_change.x = 0; last_motion_change.x = 0;
last_motion_change.y = 0; last_motion_change.y = 0;
} }
@ -144,7 +144,7 @@ void Mouse::UpdateMotionInput() {
} }
void Mouse::Move(int x, int y, int center_x, int center_y) { void Mouse::Move(int x, int y, int center_x, int center_y) {
if (Settings::values.mouse_panning) { if (IsMousePanningEnabled()) {
const auto mouse_change = const auto mouse_change =
(Common::MakeVec(x, y) - Common::MakeVec(center_x, center_y)).Cast<float>(); (Common::MakeVec(x, y) - Common::MakeVec(center_x, center_y)).Cast<float>();
const float x_sensitivity = const float x_sensitivity =
@ -219,7 +219,7 @@ void Mouse::ReleaseButton(MouseButton button) {
SetButton(real_mouse_identifier, static_cast<int>(button), false); SetButton(real_mouse_identifier, static_cast<int>(button), false);
SetButton(touch_identifier, static_cast<int>(button), false); SetButton(touch_identifier, static_cast<int>(button), false);
if (!Settings::values.mouse_panning) { if (!IsMousePanningEnabled()) {
SetAxis(identifier, mouse_axis_x, 0); SetAxis(identifier, mouse_axis_x, 0);
SetAxis(identifier, mouse_axis_y, 0); SetAxis(identifier, mouse_axis_y, 0);
} }
@ -243,6 +243,11 @@ void Mouse::ReleaseAllButtons() {
button_pressed = false; button_pressed = false;
} }
bool Mouse::IsMousePanningEnabled() {
// Disable mouse panning when a real mouse is connected
return Settings::values.mouse_panning && !Settings::values.mouse_enabled;
}
std::vector<Common::ParamPackage> Mouse::GetInputDevices() const { std::vector<Common::ParamPackage> Mouse::GetInputDevices() const {
std::vector<Common::ParamPackage> devices; std::vector<Common::ParamPackage> devices;
devices.emplace_back(Common::ParamPackage{ devices.emplace_back(Common::ParamPackage{

View File

@ -99,6 +99,8 @@ private:
void UpdateStickInput(); void UpdateStickInput();
void UpdateMotionInput(); void UpdateMotionInput();
bool IsMousePanningEnabled();
Common::Input::ButtonNames GetUIButtonName(const Common::ParamPackage& params) const; Common::Input::ButtonNames GetUIButtonName(const Common::ParamPackage& params) const;
Common::Vec2<int> mouse_origin; Common::Vec2<int> mouse_origin;

View File

@ -3105,21 +3105,6 @@
</property> </property>
<item> <item>
<widget class="QPushButton" name="mousePanningButton"> <widget class="QPushButton" name="mousePanningButton">
<property name="minimumSize">
<size>
<width>68</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>68</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">min-width: 68px;</string>
</property>
<property name="text"> <property name="text">
<string>Configure</string> <string>Configure</string>
</property> </property>

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <QCloseEvent> #include <QCloseEvent>
#include <QMessageBox>
#include "common/settings.h" #include "common/settings.h"
#include "ui_configure_mouse_panning.h" #include "ui_configure_mouse_panning.h"
@ -33,13 +34,20 @@ void ConfigureMousePanning::SetConfiguration(float right_stick_deadzone, float r
ui->min_decay->setValue(Settings::values.mouse_panning_min_decay.GetValue()); ui->min_decay->setValue(Settings::values.mouse_panning_min_decay.GetValue());
if (right_stick_deadzone > 0.0f || right_stick_range != 1.0f) { if (right_stick_deadzone > 0.0f || right_stick_range != 1.0f) {
ui->warning_label->setText(QString::fromStdString( const QString right_stick_deadzone_str =
"Mouse panning works better with a deadzone of 0% and a range of 100%.\n" QString::fromStdString(std::to_string(static_cast<int>(right_stick_deadzone * 100.0f)));
"Current values are " + const QString right_stick_range_str =
std::to_string(static_cast<int>(right_stick_deadzone * 100.0f)) + "% and " + QString::fromStdString(std::to_string(static_cast<int>(right_stick_range * 100.0f)));
std::to_string(static_cast<int>(right_stick_range * 100.0f)) + "% respectively."));
} else { ui->warning_label->setText(
ui->warning_label->hide(); tr("Mouse panning works better with a deadzone of 0% and a range of 100%.\nCurrent "
"values are %1% and %2% respectively.")
.arg(right_stick_deadzone_str, right_stick_range_str));
}
if (Settings::values.mouse_enabled) {
ui->warning_label->setText(
tr("Emulated mouse is enabled. This is incompatible with mouse panning."));
} }
} }
@ -69,5 +77,14 @@ void ConfigureMousePanning::ApplyConfiguration() {
Settings::values.mouse_panning_decay_strength = static_cast<float>(ui->decay_strength->value()); Settings::values.mouse_panning_decay_strength = static_cast<float>(ui->decay_strength->value());
Settings::values.mouse_panning_min_decay = static_cast<float>(ui->min_decay->value()); Settings::values.mouse_panning_min_decay = static_cast<float>(ui->min_decay->value());
if (Settings::values.mouse_enabled && Settings::values.mouse_panning) {
Settings::values.mouse_panning = false;
QMessageBox::critical(
this, tr("Emulated mouse is enabled"),
tr("Real mouse input and mouse panning are incompatible. Please disable the "
"emulated mouse in input advanced settings to allow mouse panning."));
return;
}
accept(); accept();
} }

View File

@ -9,10 +9,10 @@
<item> <item>
<widget class="QCheckBox" name="enable"> <widget class="QCheckBox" name="enable">
<property name="text"> <property name="text">
<string>Enable</string> <string>Enable mouse panning</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Can be toggled via a hotkey</string> <string>Can be toggled via a hotkey. Default hotkey is Ctrl + F9</string>
</property> </property>
</widget> </widget>
</item> </item>