diff --git a/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp b/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp index fe83fe9146..622b2e848f 100644 --- a/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp +++ b/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp @@ -266,7 +266,7 @@ void AchievementSettingsWidget::ToggleHardcore() if (Config::Get(Config::MAIN_EMULATION_SPEED) < 1.0f) Config::SetBaseOrCurrent(Config::MAIN_EMULATION_SPEED, 1.0f); Config::SetBaseOrCurrent(Config::FREE_LOOK_ENABLED, false); - Settings::Instance().SetCheatsEnabled(false); + Config::SetBaseOrCurrent(Config::MAIN_ENABLE_CHEATS, false); Settings::Instance().SetDebugModeEnabled(false); } emit Settings::Instance().EmulationStateChanged(Core::GetState(Core::System::GetInstance())); diff --git a/Source/Core/DolphinQt/Settings.cpp b/Source/Core/DolphinQt/Settings.cpp index 195cf16579..ec930711a1 100644 --- a/Source/Core/DolphinQt/Settings.cpp +++ b/Source/Core/DolphinQt/Settings.cpp @@ -539,15 +539,6 @@ bool Settings::GetCheatsEnabled() const return Config::Get(Config::MAIN_ENABLE_CHEATS); } -void Settings::SetCheatsEnabled(bool enabled) -{ - if (Config::Get(Config::MAIN_ENABLE_CHEATS) != enabled) - { - Config::SetBaseOrCurrent(Config::MAIN_ENABLE_CHEATS, enabled); - emit EnableCheatsChanged(enabled); - } -} - void Settings::SetDebugModeEnabled(bool enabled) { if (AchievementManager::GetInstance().IsHardcoreModeActive()) diff --git a/Source/Core/DolphinQt/Settings.h b/Source/Core/DolphinQt/Settings.h index a1ceb0c8c5..f59e7c143b 100644 --- a/Source/Core/DolphinQt/Settings.h +++ b/Source/Core/DolphinQt/Settings.h @@ -145,7 +145,6 @@ public: // Cheats bool GetCheatsEnabled() const; - void SetCheatsEnabled(bool enabled); // Debug void SetDebugModeEnabled(bool enabled); diff --git a/Source/Core/DolphinQt/Settings/GeneralPane.cpp b/Source/Core/DolphinQt/Settings/GeneralPane.cpp index 8aabfdb9fe..fab903a873 100644 --- a/Source/Core/DolphinQt/Settings/GeneralPane.cpp +++ b/Source/Core/DolphinQt/Settings/GeneralPane.cpp @@ -99,7 +99,8 @@ void GeneralPane::OnEmulationStateChanged(Core::State state) void GeneralPane::ConnectLayout() { - connect(m_checkbox_cheats, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig); + connect(m_checkbox_cheats, &QCheckBox::toggled, &Settings::Instance(), + &Settings::EnableCheatsChanged); connect(m_checkbox_override_region_settings, &QCheckBox::stateChanged, this, &GeneralPane::OnSaveConfig); connect(m_checkbox_auto_disc_change, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig); @@ -144,7 +145,7 @@ void GeneralPane::CreateBasic() m_checkbox_dualcore = new ConfigBool(tr("Enable Dual Core (speedhack)"), Config::MAIN_CPU_THREAD); basic_group_layout->addWidget(m_checkbox_dualcore); - m_checkbox_cheats = new QCheckBox(tr("Enable Cheats")); + m_checkbox_cheats = new ConfigBool(tr("Enable Cheats"), Config::MAIN_ENABLE_CHEATS); basic_group_layout->addWidget(m_checkbox_cheats); m_checkbox_override_region_settings = new QCheckBox(tr("Allow Mismatched Region Settings")); @@ -262,7 +263,6 @@ void GeneralPane::LoadConfig() SignalBlocking(m_checkbox_enable_analytics) ->setChecked(Settings::Instance().IsAnalyticsEnabled()); #endif - SignalBlocking(m_checkbox_cheats)->setChecked(Settings::Instance().GetCheatsEnabled()); SignalBlocking(m_checkbox_override_region_settings) ->setChecked(Config::Get(Config::MAIN_OVERRIDE_REGION_SETTINGS)); SignalBlocking(m_checkbox_auto_disc_change) @@ -353,11 +353,9 @@ void GeneralPane::OnSaveConfig() Settings::Instance().SetAnalyticsEnabled(m_checkbox_enable_analytics->isChecked()); DolphinAnalytics::Instance().ReloadConfig(); #endif - Settings::Instance().SetCheatsEnabled(m_checkbox_cheats->isChecked()); Config::SetBaseOrCurrent(Config::MAIN_OVERRIDE_REGION_SETTINGS, m_checkbox_override_region_settings->isChecked()); Config::SetBase(Config::MAIN_AUTO_DISC_CHANGE, m_checkbox_auto_disc_change->isChecked()); - Config::SetBaseOrCurrent(Config::MAIN_ENABLE_CHEATS, m_checkbox_cheats->isChecked()); Settings::Instance().SetFallbackRegion( UpdateFallbackRegionFromIndex(m_combobox_fallback_region->currentIndex())); @@ -386,6 +384,13 @@ void GeneralPane::AddDescriptions() "improves performance. However, it can result in glitches and crashes." "

This setting cannot be changed while emulation is active." "

If unsure, leave this checked."); + static constexpr char TR_CHEATS_DESCRIPTION[] = QT_TR_NOOP( + "Enables the use of AR and Gecko cheat codes which can be used to modify games' behavior. " + "These codes can be configured with the Cheats Manager in the Tools menu." + "

This setting cannot be changed while emulation is active." + "

If unsure, leave this unchecked."); m_checkbox_dualcore->SetDescription(tr(TR_DUALCORE_DESCRIPTION)); + + m_checkbox_cheats->SetDescription(tr(TR_CHEATS_DESCRIPTION)); } diff --git a/Source/Core/DolphinQt/Settings/GeneralPane.h b/Source/Core/DolphinQt/Settings/GeneralPane.h index 2fc68ddc13..3c69360c75 100644 --- a/Source/Core/DolphinQt/Settings/GeneralPane.h +++ b/Source/Core/DolphinQt/Settings/GeneralPane.h @@ -43,7 +43,7 @@ private: QComboBox* m_combobox_update_track; QComboBox* m_combobox_fallback_region; ConfigBool* m_checkbox_dualcore; - QCheckBox* m_checkbox_cheats; + ConfigBool* m_checkbox_cheats; QCheckBox* m_checkbox_override_region_settings; QCheckBox* m_checkbox_auto_disc_change; #ifdef USE_DISCORD_PRESENCE