GeneralPane: Add BalloonTip to cheats checkbox

This commit is contained in:
Dentomologist 2023-11-27 22:47:28 -08:00
parent b2107023ba
commit d9336a5de0
5 changed files with 12 additions and 17 deletions

View File

@ -266,7 +266,7 @@ void AchievementSettingsWidget::ToggleHardcore()
if (Config::Get(Config::MAIN_EMULATION_SPEED) < 1.0f) if (Config::Get(Config::MAIN_EMULATION_SPEED) < 1.0f)
Config::SetBaseOrCurrent(Config::MAIN_EMULATION_SPEED, 1.0f); Config::SetBaseOrCurrent(Config::MAIN_EMULATION_SPEED, 1.0f);
Config::SetBaseOrCurrent(Config::FREE_LOOK_ENABLED, false); Config::SetBaseOrCurrent(Config::FREE_LOOK_ENABLED, false);
Settings::Instance().SetCheatsEnabled(false); Config::SetBaseOrCurrent(Config::MAIN_ENABLE_CHEATS, false);
Settings::Instance().SetDebugModeEnabled(false); Settings::Instance().SetDebugModeEnabled(false);
} }
emit Settings::Instance().EmulationStateChanged(Core::GetState(Core::System::GetInstance())); emit Settings::Instance().EmulationStateChanged(Core::GetState(Core::System::GetInstance()));

View File

@ -539,15 +539,6 @@ bool Settings::GetCheatsEnabled() const
return Config::Get(Config::MAIN_ENABLE_CHEATS); 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) void Settings::SetDebugModeEnabled(bool enabled)
{ {
if (AchievementManager::GetInstance().IsHardcoreModeActive()) if (AchievementManager::GetInstance().IsHardcoreModeActive())

View File

@ -145,7 +145,6 @@ public:
// Cheats // Cheats
bool GetCheatsEnabled() const; bool GetCheatsEnabled() const;
void SetCheatsEnabled(bool enabled);
// Debug // Debug
void SetDebugModeEnabled(bool enabled); void SetDebugModeEnabled(bool enabled);

View File

@ -99,7 +99,8 @@ void GeneralPane::OnEmulationStateChanged(Core::State state)
void GeneralPane::ConnectLayout() 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, connect(m_checkbox_override_region_settings, &QCheckBox::stateChanged, this,
&GeneralPane::OnSaveConfig); &GeneralPane::OnSaveConfig);
connect(m_checkbox_auto_disc_change, &QCheckBox::toggled, 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); m_checkbox_dualcore = new ConfigBool(tr("Enable Dual Core (speedhack)"), Config::MAIN_CPU_THREAD);
basic_group_layout->addWidget(m_checkbox_dualcore); 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); basic_group_layout->addWidget(m_checkbox_cheats);
m_checkbox_override_region_settings = new QCheckBox(tr("Allow Mismatched Region Settings")); m_checkbox_override_region_settings = new QCheckBox(tr("Allow Mismatched Region Settings"));
@ -262,7 +263,6 @@ void GeneralPane::LoadConfig()
SignalBlocking(m_checkbox_enable_analytics) SignalBlocking(m_checkbox_enable_analytics)
->setChecked(Settings::Instance().IsAnalyticsEnabled()); ->setChecked(Settings::Instance().IsAnalyticsEnabled());
#endif #endif
SignalBlocking(m_checkbox_cheats)->setChecked(Settings::Instance().GetCheatsEnabled());
SignalBlocking(m_checkbox_override_region_settings) SignalBlocking(m_checkbox_override_region_settings)
->setChecked(Config::Get(Config::MAIN_OVERRIDE_REGION_SETTINGS)); ->setChecked(Config::Get(Config::MAIN_OVERRIDE_REGION_SETTINGS));
SignalBlocking(m_checkbox_auto_disc_change) SignalBlocking(m_checkbox_auto_disc_change)
@ -353,11 +353,9 @@ void GeneralPane::OnSaveConfig()
Settings::Instance().SetAnalyticsEnabled(m_checkbox_enable_analytics->isChecked()); Settings::Instance().SetAnalyticsEnabled(m_checkbox_enable_analytics->isChecked());
DolphinAnalytics::Instance().ReloadConfig(); DolphinAnalytics::Instance().ReloadConfig();
#endif #endif
Settings::Instance().SetCheatsEnabled(m_checkbox_cheats->isChecked());
Config::SetBaseOrCurrent(Config::MAIN_OVERRIDE_REGION_SETTINGS, Config::SetBaseOrCurrent(Config::MAIN_OVERRIDE_REGION_SETTINGS,
m_checkbox_override_region_settings->isChecked()); m_checkbox_override_region_settings->isChecked());
Config::SetBase(Config::MAIN_AUTO_DISC_CHANGE, m_checkbox_auto_disc_change->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( Settings::Instance().SetFallbackRegion(
UpdateFallbackRegionFromIndex(m_combobox_fallback_region->currentIndex())); UpdateFallbackRegionFromIndex(m_combobox_fallback_region->currentIndex()));
@ -386,6 +384,13 @@ void GeneralPane::AddDescriptions()
"improves performance. However, it can result in glitches and crashes." "improves performance. However, it can result in glitches and crashes."
"<br><br>This setting cannot be changed while emulation is active." "<br><br>This setting cannot be changed while emulation is active."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>"); "<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
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."
"<br><br>This setting cannot be changed while emulation is active."
"<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
m_checkbox_dualcore->SetDescription(tr(TR_DUALCORE_DESCRIPTION)); m_checkbox_dualcore->SetDescription(tr(TR_DUALCORE_DESCRIPTION));
m_checkbox_cheats->SetDescription(tr(TR_CHEATS_DESCRIPTION));
} }

View File

@ -43,7 +43,7 @@ private:
QComboBox* m_combobox_update_track; QComboBox* m_combobox_update_track;
QComboBox* m_combobox_fallback_region; QComboBox* m_combobox_fallback_region;
ConfigBool* m_checkbox_dualcore; ConfigBool* m_checkbox_dualcore;
QCheckBox* m_checkbox_cheats; ConfigBool* m_checkbox_cheats;
QCheckBox* m_checkbox_override_region_settings; QCheckBox* m_checkbox_override_region_settings;
QCheckBox* m_checkbox_auto_disc_change; QCheckBox* m_checkbox_auto_disc_change;
#ifdef USE_DISCORD_PRESENCE #ifdef USE_DISCORD_PRESENCE