Port Enable Cheats to the new config system

This commit is contained in:
JosJuice
2021-08-11 13:52:08 +02:00
parent 67c06cfc55
commit fa0525f826
9 changed files with 19 additions and 20 deletions

View File

@ -32,13 +32,14 @@
#include "Common/BitUtils.h"
#include "Common/CommonTypes.h"
#include "Common/Config/Config.h"
#include "Common/IniFile.h"
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Core/ARDecrypt.h"
#include "Core/CheatCodes.h"
#include "Core/ConfigManager.h"
#include "Core/Config/MainSettings.h"
#include "Core/PowerPC/MMU.h"
namespace ActionReplay
@ -112,7 +113,7 @@ struct ARAddr
// AR Remote Functions
void ApplyCodes(const std::vector<ARCode>& codes)
{
if (!SConfig::GetInstance().bEnableCheats)
if (!Config::Get(Config::MAIN_ENABLE_CHEATS))
return;
std::lock_guard guard(s_lock);
@ -141,7 +142,7 @@ void UpdateSyncedCodes(const std::vector<ARCode>& codes)
std::vector<ARCode> ApplyAndReturnCodes(const std::vector<ARCode>& codes)
{
if (SConfig::GetInstance().bEnableCheats)
if (Config::Get(Config::MAIN_ENABLE_CHEATS))
{
std::lock_guard guard(s_lock);
s_disable_logging = false;
@ -156,7 +157,7 @@ std::vector<ARCode> ApplyAndReturnCodes(const std::vector<ARCode>& codes)
void AddCode(ARCode code)
{
if (!SConfig::GetInstance().bEnableCheats)
if (!Config::Get(Config::MAIN_ENABLE_CHEATS))
return;
if (code.enabled)
@ -972,7 +973,7 @@ static bool RunCodeLocked(const ARCode& arcode)
void RunAllActive()
{
if (!SConfig::GetInstance().bEnableCheats)
if (!Config::Get(Config::MAIN_ENABLE_CHEATS))
return;
// If the mutex is idle then acquiring it should be cheap, fast mutexes