1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-11-28 12:22:02 +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 WriteCheats(const std::string& cheatContent);
void AddCheatsfileListItem(); void AddCheatsfileListItem();
void ShowBidNotFound(); void ShowBidNotFound();
void ShowCheatsNotFound(); void ShowCheatsNotFound(const std::string& versionsWithCheats = "");
typedef struct typedef struct
{ {

View file

@ -47,7 +47,8 @@
"delete_cheats": "Delete cheats for this game", "delete_cheats": "Delete cheats for this game",
"deletion_error": "Couldn't delete the cheat files for game with ID:\n{}", "deletion_error": "Couldn't delete the cheat files for game with ID:\n{}",
"show_cheat_files": "Show all cheat files", "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": { "common": {
"downloading": "Downloading…", "downloading": "Downloading…",

View file

@ -194,11 +194,11 @@ void DownloadCheatsPage::ShowBidNotFound()
this->list->addView(label); this->list->addView(label);
} }
void DownloadCheatsPage::ShowCheatsNotFound() void DownloadCheatsPage::ShowCheatsNotFound(const std::string& versionsWithCheats)
{ {
brls::Label* label = new brls::Label( brls::Label* label = new brls::Label(
brls::LabelStyle::REGULAR, 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); true);
this->list->addView(label); this->list->addView(label);
} }
@ -375,7 +375,11 @@ DownloadCheatsPage_GbaTemp::DownloadCheatsPage_GbaTemp(uint64_t tid, const std::
this->list->addView(new brls::ListItemGroupSpacing(true)); this->list->addView(new brls::ListItemGroupSpacing(true));
} }
else { else {
ShowCheatsNotFound(); std::string versionsWithCheats;
for (auto& [key, val] : cheatsJson.items()) {
versionsWithCheats += key + " ";
}
ShowCheatsNotFound(versionsWithCheats);
} }
} }