1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-11-24 18:42:05 +00:00

Added disclaimer when cheats matching a different BID are found

This commit is contained in:
flb 2022-03-10 14:11:20 +01:00
parent 2b87d60e34
commit e30f59b4b2
3 changed files with 10 additions and 5 deletions

View file

@ -35,7 +35,7 @@ protected:
void WriteCheats(const std::string& cheatContent);
void AddCheatsfileListItem();
void ShowBidNotFound();
void ShowCheatsNotFound();
void ShowCheatsNotFound(const std::string& versionsWithCheats = "");
typedef struct
{

View file

@ -47,7 +47,8 @@
"delete_cheats": "Delete cheats for this game",
"deletion_error": "Couldn't delete the cheat files for game with ID:\n{}",
"show_cheat_files": "Show all cheat files",
"cheats_not_found": "Couldn't find cheat codes matching this build ID."
"cheats_not_found": "Couldn't find cheat codes matching this build ID.",
"old_cheats_found": "Cheat codes matching BID(s) [ {}] exist."
},
"common": {
"downloading": "Downloading…",

View file

@ -194,11 +194,11 @@ void DownloadCheatsPage::ShowBidNotFound()
this->list->addView(label);
}
void DownloadCheatsPage::ShowCheatsNotFound()
void DownloadCheatsPage::ShowCheatsNotFound(const std::string& versionsWithCheats)
{
brls::Label* label = new brls::Label(
brls::LabelStyle::REGULAR,
"menus/cheats/cheats_not_found"_i18n,
"menus/cheats/cheats_not_found"_i18n + (!versionsWithCheats.empty() ? "\n" + fmt::format("menus/cheats/old_cheats_found"_i18n, versionsWithCheats) : ""),
true);
this->list->addView(label);
}
@ -375,7 +375,11 @@ DownloadCheatsPage_GbaTemp::DownloadCheatsPage_GbaTemp(uint64_t tid, const std::
this->list->addView(new brls::ListItemGroupSpacing(true));
}
else {
ShowCheatsNotFound();
std::string versionsWithCheats;
for (auto& [key, val] : cheatsJson.items()) {
versionsWithCheats += key + " ";
}
ShowCheatsNotFound(versionsWithCheats);
}
}