Compare commits

..

3 Commits

Author SHA1 Message Date
oltolm
c8e77c4fe9
Merge d2155b41d2 into a163877413 2025-06-10 23:41:11 +02:00
JMC47
a163877413
Merge pull request #13746 from LillyJadeKatrin/retroachievements-hardcore-changed
MainWindow - Avoid excessive emulation state changes
2025-06-10 17:32:04 -04:00
LillyJadeKatrin
417badc55c MainWindow - Avoid excessive emulation state changes
Updates the Hardcore Changed callback to only signal EmulationStateChanged if the new Hardcore Mode setting is different from the previous one.
2025-06-10 16:03:14 -04:00
2 changed files with 8 additions and 2 deletions

View File

@ -2010,9 +2010,14 @@ void MainWindow::ShowAchievementSettings()
void MainWindow::OnHardcoreChanged()
{
if (AchievementManager::GetInstance().IsHardcoreModeActive())
bool hardcore_active = AchievementManager::GetInstance().IsHardcoreModeActive();
if (hardcore_active)
Settings::Instance().SetDebugModeEnabled(false);
emit Settings::Instance().EmulationStateChanged(Core::GetState(Core::System::GetInstance()));
// EmulationStateChanged causes several dialogs to redraw, including anything affected by hardcore
// mode. Every dialog that depends on hardcore mode is redrawn by EmulationStateChanged.
if (hardcore_active != m_former_hardcore_setting)
emit Settings::Instance().EmulationStateChanged(Core::GetState(Core::System::GetInstance()));
m_former_hardcore_setting = hardcore_active;
}
#endif // USE_RETRO_ACHIEVEMENTS

View File

@ -267,6 +267,7 @@ private:
#ifdef USE_RETRO_ACHIEVEMENTS
AchievementsWindow* m_achievements_window = nullptr;
Config::ConfigChangedCallbackID m_config_changed_callback_id;
bool m_former_hardcore_setting = false;
#endif // USE_RETRO_ACHIEVEMENTS
AssemblerWidget* m_assembler_widget;