Disable cheats in hardcore mode

RetroAchievements does not allow cheats such as Action Replay or Gecko in hardcore mode, for fairness.
This commit is contained in:
LillyJadeKatrin
2023-06-07 21:53:38 -04:00
parent 0abfa94bc8
commit 3aebbbb3e7
17 changed files with 105 additions and 9 deletions

View File

@ -15,6 +15,7 @@
#include <QVBoxLayout>
#include <QWidget>
#include "Core/Config/AchievementSettings.h"
#include "Core/Config/MainSettings.h"
#include "Core/Config/UISettings.h"
#include "Core/ConfigManager.h"
@ -84,7 +85,12 @@ void GeneralPane::OnEmulationStateChanged(Core::State state)
const bool running = state != Core::State::Uninitialized;
m_checkbox_dualcore->setEnabled(!running);
#ifdef USE_RETRO_ACHIEVEMENTS
bool hardcore = Config::Get(Config::RA_HARDCORE_ENABLED);
m_checkbox_cheats->setEnabled(!running && !hardcore);
#else // USE_RETRO_ACHIEVEMENTS
m_checkbox_cheats->setEnabled(!running);
#endif // USE_RETRO_ACHIEVEMENTS
m_checkbox_override_region_settings->setEnabled(!running);
#ifdef USE_DISCORD_PRESENCE
m_checkbox_discord_presence->setEnabled(!running);