1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-11-08 11:31:43 +00:00

add option to exclude all/none of the games from recieving cheat updates (https://github.com/HamletDuFromage/aio-switch-updater/issues/224)

This commit is contained in:
flb 2022-10-31 21:16:59 +01:00
parent 1b93f7581e
commit 8aae4c012e
2 changed files with 22 additions and 3 deletions

View file

@ -37,6 +37,8 @@
"exclude_titles": "Exclude titles",
"exclude_titles_desc": "You can turn off cheat updates with this menu",
"exclude_titles_save": "Save choice and return",
"exclude_all": "Exclude all",
"exclude_none": "Exclude none",
"dl_all": "Download and extract the entire GBAtemp.net cheats archive",
"gbatemp_dl": "Download cheat codes curated from GBAtemp.net. Those cheats will be added to the end of your existing cheat file.",
"gbatemp_dl_cheatcode": "Download cheat code",

View file

@ -68,7 +68,7 @@ void AppPage::PopulatePage()
brls::Logger::debug("count {}", list->getViewsCount());
if(!list->getViewsCount()) {
if (!list->getViewsCount()) {
list->addView(new brls::Label(brls::LabelStyle::DESCRIPTION, "menus/common/nothing_to_see"_i18n, true));
}
@ -267,6 +267,24 @@ void AppPage_Exclude::PopulatePage()
return true;
});
this->registerAction("menus/cheats/exclude_all"_i18n, brls::Key::X, [this] {
std::set<std::string> exclude;
if (true) {
for (const auto& item : items) {
exclude.insert(item.second);
}
}
extract::writeTitlesToFile(exclude, CHEATS_EXCLUDE);
brls::Application::popView();
return true;
});
this->registerAction("menus/cheats/exclude_none"_i18n, brls::Key::Y, [this] {
extract::writeTitlesToFile({}, CHEATS_EXCLUDE);
brls::Application::popView();
return true;
});
this->setContentView(list);
}
@ -315,8 +333,7 @@ void AppPage_DownloadedCheats::GetExistingCheatsTids()
AppPage_OutdatedTitles::AppPage_OutdatedTitles() : AppPage()
{
download::getRequest(LOOKUP_TABLE_URL, versions);
if(versions.empty())
{
if (versions.empty()) {
list->addView(new brls::Label(brls::LabelStyle::DESCRIPTION, "menus/main/links_not_found"_i18n, true));
this->setContentView(list);
}