Qt: Display warning before allowing cheats

This commit is contained in:
Connor McLaughlin
2021-07-17 15:13:28 +10:00
parent 6008b9f1e9
commit efaf3d6ce5
2 changed files with 36 additions and 4 deletions

View File

@ -3600,9 +3600,13 @@ bool CommonHostInterface::LoadCheatList(const char* filename)
return false;
}
AddOSDMessage(TranslateStdString("OSDMessage", "Loaded %n cheats from list.", "", cl->GetCodeCount()) +
TranslateStdString("OSDMessage", " %n cheats are enabled.", "", cl->GetEnabledCodeCount()),
10.0f);
if (cl->GetEnabledCodeCount() > 0)
{
AddOSDMessage(TranslateStdString("OSDMessage", "%n cheats are enabled. This may result in instability.", "",
cl->GetEnabledCodeCount()),
30.0f);
}
System::SetCheatList(std::move(cl));
return true;
}
@ -3628,7 +3632,7 @@ bool CommonHostInterface::LoadCheatListFromDatabase()
if (!cl->LoadFromPackage(System::GetRunningCode()))
return false;
AddOSDMessage(TranslateStdString("OSDMessage", "Loaded %n cheats from database.", "", cl->GetCodeCount()), 10.0f);
Log_InfoPrintf("Loaded %u cheats from database.", cl->GetCodeCount());
System::SetCheatList(std::move(cl));
return true;
}