Settings: Clearing settings disables Cheats/Patches

The 'Clear Settings' button will now disable all cheats and patches from the configuration. This will allow quickly resetting to having no game altering pnach patches/cheats.
This commit is contained in:
Dan McCarthy 2023-12-31 20:40:14 -06:00 committed by refractionpcsx2
parent 85c3a413fa
commit 6f0aef3344
5 changed files with 19 additions and 0 deletions

View File

@ -80,6 +80,13 @@ void GameCheatSettingsWidget::updateListEnabled()
m_ui.reloadCheats->setEnabled(cheats_enabled);
}
void GameCheatSettingsWidget::disableAllCheats()
{
SettingsInterface* si = m_dialog->getSettingsInterface();
si->ClearSection(Patch::CHEATS_CONFIG_SECTION);
si->Save();
}
void GameCheatSettingsWidget::setCheatEnabled(std::string name, bool enabled, bool save_and_reload_settings)
{
SettingsInterface* si = m_dialog->getSettingsInterface();

View File

@ -28,6 +28,7 @@ class GameCheatSettingsWidget : public QWidget
public:
GameCheatSettingsWidget(SettingsWindow* dialog, QWidget* parent);
void disableAllCheats();
~GameCheatSettingsWidget();
private Q_SLOTS:

View File

@ -71,6 +71,13 @@ void GamePatchSettingsWidget::onReloadClicked()
g_emu_thread->reloadPatches();
}
void GamePatchSettingsWidget::disableAllPatches()
{
SettingsInterface* si = m_dialog->getSettingsInterface();
si->ClearSection(Patch::PATCHES_CONFIG_SECTION);
si->Save();
}
void GamePatchSettingsWidget::reloadList()
{
// Patches shouldn't have any unlabelled patch groups, because they're new.

View File

@ -41,6 +41,7 @@ class GamePatchSettingsWidget : public QWidget
public:
GamePatchSettingsWidget(SettingsWindow* dialog, QWidget* parent);
void disableAllPatches();
~GamePatchSettingsWidget();
private Q_SLOTS:

View File

@ -314,6 +314,9 @@ void SettingsWindow::onClearSettingsClicked()
return;
}
m_game_cheat_settings_widget->disableAllCheats();
m_game_patch_settings_widget->disableAllPatches();
Pcsx2Config::ClearConfiguration(m_sif.get());
m_sif->Save();
g_emu_thread->reloadGameSettings();