mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-17 19:05:46 -04:00
Cheats: Support parsing built-in database
This commit is contained in:
@ -2436,6 +2436,20 @@ bool CommonHostInterface::LoadCheatListFromGameTitle()
|
||||
return LoadCheatList(filename.c_str());
|
||||
}
|
||||
|
||||
bool CommonHostInterface::LoadCheatListFromDatabase()
|
||||
{
|
||||
if (System::GetRunningCode().empty())
|
||||
return false;
|
||||
|
||||
std::unique_ptr<CheatList> cl = std::make_unique<CheatList>();
|
||||
if (!cl->LoadFromPackage(System::GetRunningCode()))
|
||||
return false;
|
||||
|
||||
AddFormattedOSDMessage(10.0f, TranslateString("OSDMessage", "Loaded %u cheats from database."), cl->GetCodeCount());
|
||||
System::SetCheatList(std::move(cl));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CommonHostInterface::SaveCheatList()
|
||||
{
|
||||
if (!System::IsValid() || !System::HasCheatList())
|
||||
|
@ -160,6 +160,9 @@ public:
|
||||
/// Loads the cheat list for the current game title from the user directory.
|
||||
bool LoadCheatListFromGameTitle();
|
||||
|
||||
/// Loads the cheat list for the current game code from the built-in code database.
|
||||
bool LoadCheatListFromDatabase();
|
||||
|
||||
/// Saves the current cheat list to the game title's file.
|
||||
bool SaveCheatList();
|
||||
|
||||
|
Reference in New Issue
Block a user