mirror of
https://github.com/PCSX2/pcsx2.git
synced 2025-12-16 04:08:48 +00:00
Qt/Patches: Gracefully migrate old per-game widescreen/no-interlace toggles to Patches
Some checks failed
🐧 Linux Builds / AppImage (push) Has been cancelled
🐧 Linux Builds / Flatpak (push) Has been cancelled
🍎 MacOS Builds / Defaults (push) Has been cancelled
🖥️ Windows Builds / Lint VS Project Files (push) Has been cancelled
🖥️ Windows Builds / CMake (push) Has been cancelled
🖥️ Windows Builds / SSE4 (push) Has been cancelled
🖥️ Windows Builds / AVX2 (push) Has been cancelled
🏭 Update Controller Database / update-controller-db (push) Has been cancelled
Some checks failed
🐧 Linux Builds / AppImage (push) Has been cancelled
🐧 Linux Builds / Flatpak (push) Has been cancelled
🍎 MacOS Builds / Defaults (push) Has been cancelled
🖥️ Windows Builds / Lint VS Project Files (push) Has been cancelled
🖥️ Windows Builds / CMake (push) Has been cancelled
🖥️ Windows Builds / SSE4 (push) Has been cancelled
🖥️ Windows Builds / AVX2 (push) Has been cancelled
🏭 Update Controller Database / update-controller-db (push) Has been cancelled
This old upgrade path telling users that the setting has been deprecated can now be changed to perform the upgrade seamlessly for the user, because the behaviour of the old per-game setting is identical to the new behaviour of the Patches tab.
This commit is contained in:
parent
f7ba355697
commit
97f316eca7
@ -8,6 +8,7 @@
|
|||||||
#include <QtWidgets/QMessageBox>
|
#include <QtWidgets/QMessageBox>
|
||||||
|
|
||||||
#include "pcsx2/Host.h"
|
#include "pcsx2/Host.h"
|
||||||
|
#include "pcsx2/Patch.h"
|
||||||
#include "pcsx2/GS/GS.h"
|
#include "pcsx2/GS/GS.h"
|
||||||
#include "pcsx2/GS/GSCapture.h"
|
#include "pcsx2/GS/GSCapture.h"
|
||||||
#include "pcsx2/GS/GSUtil.h"
|
#include "pcsx2/GS/GSUtil.h"
|
||||||
@ -321,24 +322,61 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Get rid of widescreen/no-interlace checkboxes from per-game settings, unless the user previously had them set.
|
// Get rid of widescreen/no-interlace checkboxes from per-game settings, and migrate them to Patches if necessary.
|
||||||
if (m_dialog->isPerGameSettings())
|
if (m_dialog->isPerGameSettings())
|
||||||
{
|
{
|
||||||
if ((m_dialog->containsSettingValue("EmuCore", "EnableWideScreenPatches") || m_dialog->containsSettingValue("EmuCore", "EnableNoInterlacingPatches")) &&
|
SettingsInterface* si = m_dialog->getSettingsInterface();
|
||||||
QMessageBox::question(QtUtils::GetRootWidget(this), tr("Remove Unsupported Settings"),
|
bool needs_save = false;
|
||||||
tr("You currently have the <strong>Enable Widescreen Patches</strong> or <strong>Enable No-Interlacing Patches</strong> options enabled for this game.<br><br>"
|
|
||||||
"We no longer support these options, instead <strong>you should select the \"Patches\" section, and explicitly enable the patches you want.</strong><br><br>"
|
if (si->ContainsValue("EmuCore", "EnableWideScreenPatches"))
|
||||||
"Do you want to remove these options from your game configuration now?"),
|
|
||||||
QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
|
|
||||||
{
|
{
|
||||||
m_dialog->removeSettingValue("EmuCore", "EnableWideScreenPatches");
|
const bool ws_enabled = si->GetBoolValue("EmuCore", "EnableWideScreenPatches");
|
||||||
m_dialog->removeSettingValue("EmuCore", "EnableNoInterlacingPatches");
|
si->DeleteValue("EmuCore", "EnableWideScreenPatches");
|
||||||
|
|
||||||
|
const char* WS_PATCH_NAME = "Widescreen 16:9";
|
||||||
|
if (ws_enabled)
|
||||||
|
{
|
||||||
|
si->AddToStringList(Patch::PATCHES_CONFIG_SECTION, Patch::PATCH_ENABLE_CONFIG_KEY, WS_PATCH_NAME);
|
||||||
|
si->RemoveFromStringList(Patch::PATCHES_CONFIG_SECTION, Patch::PATCH_DISABLE_CONFIG_KEY, WS_PATCH_NAME);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
si->AddToStringList(Patch::PATCHES_CONFIG_SECTION, Patch::PATCH_DISABLE_CONFIG_KEY, WS_PATCH_NAME);
|
||||||
|
si->RemoveFromStringList(Patch::PATCHES_CONFIG_SECTION, Patch::PATCH_ENABLE_CONFIG_KEY, WS_PATCH_NAME);
|
||||||
|
}
|
||||||
|
needs_save = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (si->ContainsValue("EmuCore", "EnableNoInterlacingPatches"))
|
||||||
|
{
|
||||||
|
const bool ni_enabled = si->GetBoolValue("EmuCore", "EnableNoInterlacingPatches");
|
||||||
|
si->DeleteValue("EmuCore", "EnableNoInterlacingPatches");
|
||||||
|
|
||||||
|
const char* NI_PATCH_NAME = "No-Interlacing";
|
||||||
|
if (ni_enabled)
|
||||||
|
{
|
||||||
|
si->AddToStringList(Patch::PATCHES_CONFIG_SECTION, Patch::PATCH_ENABLE_CONFIG_KEY, NI_PATCH_NAME);
|
||||||
|
si->RemoveFromStringList(Patch::PATCHES_CONFIG_SECTION, Patch::PATCH_DISABLE_CONFIG_KEY, NI_PATCH_NAME);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
si->AddToStringList(Patch::PATCHES_CONFIG_SECTION, Patch::PATCH_DISABLE_CONFIG_KEY, NI_PATCH_NAME);
|
||||||
|
si->RemoveFromStringList(Patch::PATCHES_CONFIG_SECTION, Patch::PATCH_ENABLE_CONFIG_KEY, NI_PATCH_NAME);
|
||||||
|
}
|
||||||
|
needs_save = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (needs_save)
|
||||||
|
{
|
||||||
|
m_dialog->saveAndReloadGameSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui.displayGridLayout->removeWidget(m_ui.widescreenPatches);
|
m_ui.displayGridLayout->removeWidget(m_ui.widescreenPatches);
|
||||||
m_ui.displayGridLayout->removeWidget(m_ui.noInterlacingPatches);
|
m_ui.displayGridLayout->removeWidget(m_ui.noInterlacingPatches);
|
||||||
safe_delete(m_ui.widescreenPatches);
|
m_ui.widescreenPatches->deleteLater();
|
||||||
safe_delete(m_ui.noInterlacingPatches);
|
m_ui.noInterlacingPatches->deleteLater();
|
||||||
|
m_ui.widescreenPatches = nullptr;
|
||||||
|
m_ui.noInterlacingPatches = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hide advanced options by default.
|
// Hide advanced options by default.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user