|
|
@ -806,21 +806,8 @@ void GMainWindow::InitializeWidgets() {
|
|
|
|
filter_status_button = new QPushButton();
|
|
|
|
filter_status_button = new QPushButton();
|
|
|
|
filter_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton"));
|
|
|
|
filter_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton"));
|
|
|
|
filter_status_button->setFocusPolicy(Qt::NoFocus);
|
|
|
|
filter_status_button->setFocusPolicy(Qt::NoFocus);
|
|
|
|
connect(filter_status_button, &QPushButton::clicked, [&] {
|
|
|
|
connect(filter_status_button, &QPushButton::clicked, this,
|
|
|
|
auto filter = Settings::values.scaling_filter.GetValue();
|
|
|
|
&GMainWindow::OnToggleAdaptingFilter);
|
|
|
|
if (filter == Settings::ScalingFilter::LastFilter) {
|
|
|
|
|
|
|
|
filter = Settings::ScalingFilter::NearestNeighbor;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
filter = static_cast<Settings::ScalingFilter>(static_cast<u32>(filter) + 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL &&
|
|
|
|
|
|
|
|
filter == Settings::ScalingFilter::Fsr) {
|
|
|
|
|
|
|
|
filter = Settings::ScalingFilter::NearestNeighbor;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings::values.scaling_filter.SetValue(filter);
|
|
|
|
|
|
|
|
filter_status_button->setChecked(true);
|
|
|
|
|
|
|
|
UpdateFilterText();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
auto filter = Settings::values.scaling_filter.GetValue();
|
|
|
|
auto filter = Settings::values.scaling_filter.GetValue();
|
|
|
|
if (Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL &&
|
|
|
|
if (Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL &&
|
|
|
|
filter == Settings::ScalingFilter::Fsr) {
|
|
|
|
filter == Settings::ScalingFilter::Fsr) {
|
|
|
@ -835,25 +822,7 @@ void GMainWindow::InitializeWidgets() {
|
|
|
|
dock_status_button = new QPushButton();
|
|
|
|
dock_status_button = new QPushButton();
|
|
|
|
dock_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton"));
|
|
|
|
dock_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton"));
|
|
|
|
dock_status_button->setFocusPolicy(Qt::NoFocus);
|
|
|
|
dock_status_button->setFocusPolicy(Qt::NoFocus);
|
|
|
|
connect(dock_status_button, &QPushButton::clicked, [&] {
|
|
|
|
connect(dock_status_button, &QPushButton::clicked, this, &GMainWindow::OnToggleDockedMode);
|
|
|
|
const bool is_docked = Settings::values.use_docked_mode.GetValue();
|
|
|
|
|
|
|
|
auto* player_1 = system->HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1);
|
|
|
|
|
|
|
|
auto* handheld = system->HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!is_docked && handheld->IsConnected()) {
|
|
|
|
|
|
|
|
QMessageBox::warning(this, tr("Invalid config detected"),
|
|
|
|
|
|
|
|
tr("Handheld controller can't be used on docked mode. Pro "
|
|
|
|
|
|
|
|
"controller will be selected."));
|
|
|
|
|
|
|
|
handheld->Disconnect();
|
|
|
|
|
|
|
|
player_1->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController);
|
|
|
|
|
|
|
|
player_1->Connect();
|
|
|
|
|
|
|
|
controller_dialog->refreshConfiguration();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Settings::values.use_docked_mode.SetValue(!is_docked);
|
|
|
|
|
|
|
|
dock_status_button->setChecked(!is_docked);
|
|
|
|
|
|
|
|
OnDockedModeChanged(is_docked, !is_docked, *system);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
dock_status_button->setText(tr("DOCK"));
|
|
|
|
dock_status_button->setText(tr("DOCK"));
|
|
|
|
dock_status_button->setCheckable(true);
|
|
|
|
dock_status_button->setCheckable(true);
|
|
|
|
dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue());
|
|
|
|
dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue());
|
|
|
@ -863,22 +832,7 @@ void GMainWindow::InitializeWidgets() {
|
|
|
|
gpu_accuracy_button->setObjectName(QStringLiteral("GPUStatusBarButton"));
|
|
|
|
gpu_accuracy_button->setObjectName(QStringLiteral("GPUStatusBarButton"));
|
|
|
|
gpu_accuracy_button->setCheckable(true);
|
|
|
|
gpu_accuracy_button->setCheckable(true);
|
|
|
|
gpu_accuracy_button->setFocusPolicy(Qt::NoFocus);
|
|
|
|
gpu_accuracy_button->setFocusPolicy(Qt::NoFocus);
|
|
|
|
connect(gpu_accuracy_button, &QPushButton::clicked, [this] {
|
|
|
|
connect(gpu_accuracy_button, &QPushButton::clicked, this, &GMainWindow::OnToggleGpuAccuracy);
|
|
|
|
switch (Settings::values.gpu_accuracy.GetValue()) {
|
|
|
|
|
|
|
|
case Settings::GPUAccuracy::High: {
|
|
|
|
|
|
|
|
Settings::values.gpu_accuracy.SetValue(Settings::GPUAccuracy::Normal);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case Settings::GPUAccuracy::Normal:
|
|
|
|
|
|
|
|
case Settings::GPUAccuracy::Extreme:
|
|
|
|
|
|
|
|
default: {
|
|
|
|
|
|
|
|
Settings::values.gpu_accuracy.SetValue(Settings::GPUAccuracy::High);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
system->ApplySettings();
|
|
|
|
|
|
|
|
UpdateGPUAccuracyButton();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
UpdateGPUAccuracyButton();
|
|
|
|
UpdateGPUAccuracyButton();
|
|
|
|
statusBar()->insertPermanentWidget(0, gpu_accuracy_button);
|
|
|
|
statusBar()->insertPermanentWidget(0, gpu_accuracy_button);
|
|
|
|
|
|
|
|
|
|
|
@ -1009,12 +963,10 @@ void GMainWindow::InitializeHotkeys() {
|
|
|
|
ToggleFullscreen();
|
|
|
|
ToggleFullscreen();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
connect_shortcut(QStringLiteral("Change Docked Mode"), [&] {
|
|
|
|
connect_shortcut(QStringLiteral("Change Adapting Filter"),
|
|
|
|
Settings::values.use_docked_mode.SetValue(!Settings::values.use_docked_mode.GetValue());
|
|
|
|
&GMainWindow::OnToggleAdaptingFilter);
|
|
|
|
OnDockedModeChanged(!Settings::values.use_docked_mode.GetValue(),
|
|
|
|
connect_shortcut(QStringLiteral("Change Docked Mode"), &GMainWindow::OnToggleDockedMode);
|
|
|
|
Settings::values.use_docked_mode.GetValue(), *system);
|
|
|
|
connect_shortcut(QStringLiteral("Change GPU Accuracy"), &GMainWindow::OnToggleGpuAccuracy);
|
|
|
|
dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
connect_shortcut(QStringLiteral("Audio Mute/Unmute"),
|
|
|
|
connect_shortcut(QStringLiteral("Audio Mute/Unmute"),
|
|
|
|
[] { Settings::values.audio_muted = !Settings::values.audio_muted; });
|
|
|
|
[] { Settings::values.audio_muted = !Settings::values.audio_muted; });
|
|
|
|
connect_shortcut(QStringLiteral("Audio Volume Down"), [] {
|
|
|
|
connect_shortcut(QStringLiteral("Audio Volume Down"), [] {
|
|
|
@ -2868,6 +2820,59 @@ void GMainWindow::OnTasReset() {
|
|
|
|
input_subsystem->GetTas()->Reset();
|
|
|
|
input_subsystem->GetTas()->Reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GMainWindow::OnToggleDockedMode() {
|
|
|
|
|
|
|
|
const bool is_docked = Settings::values.use_docked_mode.GetValue();
|
|
|
|
|
|
|
|
auto* player_1 = system->HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1);
|
|
|
|
|
|
|
|
auto* handheld = system->HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!is_docked && handheld->IsConnected()) {
|
|
|
|
|
|
|
|
QMessageBox::warning(this, tr("Invalid config detected"),
|
|
|
|
|
|
|
|
tr("Handheld controller can't be used on docked mode. Pro "
|
|
|
|
|
|
|
|
"controller will be selected."));
|
|
|
|
|
|
|
|
handheld->Disconnect();
|
|
|
|
|
|
|
|
player_1->SetNpadStyleIndex(Core::HID::NpadStyleIndex::ProController);
|
|
|
|
|
|
|
|
player_1->Connect();
|
|
|
|
|
|
|
|
controller_dialog->refreshConfiguration();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Settings::values.use_docked_mode.SetValue(!is_docked);
|
|
|
|
|
|
|
|
dock_status_button->setChecked(!is_docked);
|
|
|
|
|
|
|
|
OnDockedModeChanged(is_docked, !is_docked, *system);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GMainWindow::OnToggleGpuAccuracy() {
|
|
|
|
|
|
|
|
switch (Settings::values.gpu_accuracy.GetValue()) {
|
|
|
|
|
|
|
|
case Settings::GPUAccuracy::High: {
|
|
|
|
|
|
|
|
Settings::values.gpu_accuracy.SetValue(Settings::GPUAccuracy::Normal);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case Settings::GPUAccuracy::Normal:
|
|
|
|
|
|
|
|
case Settings::GPUAccuracy::Extreme:
|
|
|
|
|
|
|
|
default: {
|
|
|
|
|
|
|
|
Settings::values.gpu_accuracy.SetValue(Settings::GPUAccuracy::High);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
system->ApplySettings();
|
|
|
|
|
|
|
|
UpdateGPUAccuracyButton();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GMainWindow::OnToggleAdaptingFilter() {
|
|
|
|
|
|
|
|
auto filter = Settings::values.scaling_filter.GetValue();
|
|
|
|
|
|
|
|
if (filter == Settings::ScalingFilter::LastFilter) {
|
|
|
|
|
|
|
|
filter = Settings::ScalingFilter::NearestNeighbor;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
filter = static_cast<Settings::ScalingFilter>(static_cast<u32>(filter) + 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL &&
|
|
|
|
|
|
|
|
filter == Settings::ScalingFilter::Fsr) {
|
|
|
|
|
|
|
|
filter = Settings::ScalingFilter::NearestNeighbor;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings::values.scaling_filter.SetValue(filter);
|
|
|
|
|
|
|
|
filter_status_button->setChecked(true);
|
|
|
|
|
|
|
|
UpdateFilterText();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GMainWindow::OnConfigurePerGame() {
|
|
|
|
void GMainWindow::OnConfigurePerGame() {
|
|
|
|
const u64 title_id = system->GetCurrentProcessProgramID();
|
|
|
|
const u64 title_id = system->GetCurrentProcessProgramID();
|
|
|
|
OpenPerGameConfiguration(title_id, game_path.toStdString());
|
|
|
|
OpenPerGameConfiguration(title_id, game_path.toStdString());
|
|
|
|