Merge pull request #10019 from JosJuice/port-enable-cheats

Port Enable Cheats to the new config system
This commit is contained in:
Léo Lam
2021-08-11 21:20:10 +02:00
committed by GitHub
9 changed files with 19 additions and 20 deletions

View File

@ -415,14 +415,14 @@ void Settings::ResetNetPlayServer(NetPlay::NetPlayServer* server)
bool Settings::GetCheatsEnabled() const
{
return SConfig::GetInstance().bEnableCheats;
return Config::Get(Config::MAIN_ENABLE_CHEATS);
}
void Settings::SetCheatsEnabled(bool enabled)
{
if (SConfig::GetInstance().bEnableCheats != enabled)
if (Config::Get(Config::MAIN_ENABLE_CHEATS) != enabled)
{
SConfig::GetInstance().bEnableCheats = enabled;
Config::SetBaseOrCurrent(Config::MAIN_ENABLE_CHEATS, enabled);
emit EnableCheatsChanged(enabled);
}
}