mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-19 07:21:40 +00:00
Core: Allow overriding the enabling of a code
If we want to enable codes in the default game INIs, we should have some way for users to disable them. This commit accomplishes that by adding a *_Disabled section corresponding to each *_Enabled section.
This commit is contained in:
parent
3328eb4523
commit
366cfd0f8c
14 changed files with 68 additions and 69 deletions
|
@ -13,6 +13,7 @@
|
|||
#include "Common/IniFile.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Core/CheatCodes.h"
|
||||
|
||||
namespace Gecko
|
||||
{
|
||||
|
@ -190,24 +191,7 @@ std::vector<GeckoCode> LoadCodes(const IniFile& globalIni, const IniFile& localI
|
|||
gcodes.push_back(gcode);
|
||||
}
|
||||
|
||||
ini->GetLines("Gecko_Enabled", &lines, false);
|
||||
|
||||
for (const std::string& line : lines)
|
||||
{
|
||||
if (line.empty() || line[0] != '$')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (GeckoCode& ogcode : gcodes)
|
||||
{
|
||||
// Exclude the initial '$' from the comparison.
|
||||
if (line.compare(1, std::string::npos, ogcode.name) == 0)
|
||||
{
|
||||
ogcode.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
ReadEnabledAndDisabled(*ini, "Gecko", &gcodes);
|
||||
}
|
||||
|
||||
return gcodes;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue