From 833d07155b07a9db2f46144b92cae932705a68ff Mon Sep 17 00:00:00 2001 From: flb Date: Mon, 5 Dec 2022 02:40:05 +0100 Subject: [PATCH] Added download link for graphic enhancing codes. --- Makefile | 2 +- include/constants.hpp | 2 ++ resources/i18n/de/menus.json | 1 - resources/i18n/en-US/menus.json | 3 ++- resources/i18n/es/menus.json | 1 - resources/i18n/fr/menus.json | 2 +- resources/i18n/it/menus.json | 1 - resources/i18n/ja/menus.json | 1 - resources/i18n/ko/menus.json | 7 +++---- resources/i18n/zh-CN/menus.json | 1 - resources/i18n/zh-TW/menus.json | 1 - source/changelog_page.cpp | 8 ++++++-- source/download_cheats_page.cpp | 13 +++++++------ source/list_download_tab.cpp | 6 ++++-- source/utils.cpp | 4 ++-- 15 files changed, 28 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index af05722..b697821 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ DATA := data INCLUDES := include /lib/borealis/library/include/borealis/extern/nlohmann APP_TITLE := All-in-One Switch Updater APP_AUTHOR := HamletDuFromage -APP_VERSION := 2.21.2 +APP_VERSION := 2.21.3 TARGET := $(notdir $(CURDIR)) ROMFS := resources diff --git a/include/constants.hpp b/include/constants.hpp index 4883e9e..597ce24 100644 --- a/include/constants.hpp +++ b/include/constants.hpp @@ -45,6 +45,8 @@ constexpr const char CUSTOM_PACKS_PATH[] = "/config/aio-switch-updater/custom_pa constexpr const char CHEATS_URL_TITLES[] = "https://github.com/HamletDuFromage/switch-cheats-db/releases/latest/download/titles.zip"; constexpr const char CHEATS_URL_CONTENTS[] = "https://github.com/HamletDuFromage/switch-cheats-db/releases/latest/download/contents.zip"; +constexpr const char GFX_CHEATS_URL_TITLES[] = "https://github.com/HamletDuFromage/switch-cheats-db/releases/latest/download/titles_60fps-res-gfx.zip"; +constexpr const char GFX_CHEATS_URL_CONTENTS[] = "https://github.com/HamletDuFromage/switch-cheats-db/releases/latest/download/contents_60fps-res-gfx.zip"; constexpr const char CHEATS_URL_VERSION[] = "https://github.com/HamletDuFromage/switch-cheats-db/releases/latest/download/VERSION"; constexpr const char LOOKUP_TABLE_URL[] = "https://raw.githubusercontent.com/HamletDuFromage/switch-cheats-db/master/versions.json"; constexpr const char LOOKUP_TABLE_CBOR[] = "https://github.com/HamletDuFromage/switch-cheats-db/raw/master/versions.cbor"; diff --git a/resources/i18n/de/menus.json b/resources/i18n/de/menus.json index 937112b..8a251de 100644 --- a/resources/i18n/de/menus.json +++ b/resources/i18n/de/menus.json @@ -36,7 +36,6 @@ "exclude_titles_save": "Auswahl speichern und zurück", "dl_all": "Das gesamte GBAtemp.net Cheat-Archiv herunterladen und enptacken", "delete_orphaned": "Verwaiste Cheat-Codes löschen", - "get_gbatemp": "GBAtemp.net Cheat-Codes herunterladen", "cheats_label": "\u25c6 Lade einzelne Cheat-Codes aus der GBAtemp.net-Datenbank oder Cheat-Sheets von Cheat Slips herunter", "gbatemp_dl": "Lade von GBAtemp.net verwaltete Cheat-Codes herunter. Diese Cheats werden am Ende deiner bestehenden Cheat-Datei hinzugefügt.", "gbatemp_dl_cheatcode": "Cheat-Code herunterladen", diff --git a/resources/i18n/en-US/menus.json b/resources/i18n/en-US/menus.json index 21012fd..54a6eaa 100644 --- a/resources/i18n/en-US/menus.json +++ b/resources/i18n/en-US/menus.json @@ -20,7 +20,7 @@ "deleting": "Deleting…", "cheatslips_title": "Cheat Slips cheats", "gbatemp_title": "GBAtemp.net cheats", - "get_gbatemp": "Download GBAtemp.net cheat codes", + "get_gbatemp": "Download individual cheat codes", "get_cheatslips": "Download Cheat Slips cheat sheets", "cheats_label": "\u25c6 Download individual cheat codes from the GBAtemp.net database or cheat sheets from Cheat Slips", "cheatslips_dl": "Download a selection of cheat sheets from Cheat Slips.\nThose cheat codes will be added to the end of your existing cheat file.", @@ -109,6 +109,7 @@ "firmware_text": "\u25c6 Firmware dumps from 'https://darthsternie.net/switch-firmwares/'. Once downloaded, it will be extracted in '/firmware'. You can then install the update through Daybreak.\n\u25c6 Current FW: ", "cheats_text": "\u25c6 This will download a daily updated archive of cheat codes from 'gbatemp.net'. Cheat codes for games you don't have installed won't be extracted to your SD card. You can turn off cheat updates for specific games in 'Tools→Cheat menu'.\n\u25c6 Current cheats version: ", "get_cheats": "Download GBAtemp.net cheat archive (ver {})", + "get_cheats_gfx": "Download graphics enhancing cheats", "get_all_cheats:": "Download GBAtemp.net cheat archive", "firmware": "firmware", "not_found": "not found", diff --git a/resources/i18n/es/menus.json b/resources/i18n/es/menus.json index e4cf82e..c024921 100644 --- a/resources/i18n/es/menus.json +++ b/resources/i18n/es/menus.json @@ -19,7 +19,6 @@ "deleting": "Borrando…", "cheatslips_title": "Trucos de Cheat Slips", "gbatemp_title": "Trucos de GBAtemp.net", - "get_gbatemp": "Descargar trucos de GBAtemp.net", "get_cheatslips": "Descargar trucos de Cheat Slips", "cheats_label": "\u25c6 Descarga trucos individuales desde la base de datos de GBAtemp.net o trucos desde Cheat Slips", "cheatslips_dl": "Descarga una selección de trucos desde Cheat Slips.\nEstos trucos seran añadidos al final del archivo de trucos actual.", diff --git a/resources/i18n/fr/menus.json b/resources/i18n/fr/menus.json index 6704086..c88ad25 100644 --- a/resources/i18n/fr/menus.json +++ b/resources/i18n/fr/menus.json @@ -19,7 +19,7 @@ "deleting": "Suppression…", "cheatslips_title": "Codes de triche de Cheat Slips", "gbatemp_title": "Codes de triche de GBAtemp.net", - "get_gbatemp": "Télécharger les codes de triche de GBAtemp.net", + "get_gbatemp": "Télécharger les codes de triche individuellement", "get_cheatslips": "Télécharger les codes de triche de Cheat Slips", "cheats_label": "\u25c6 Télécharger des codes de triches individuels depuis la base de données de GBAtemp.net ou des listes de codes depuis Cheat Slips", "cheatslips_dl": "Télécharger une sélection de listes de codes de Cheat Slips.\nCes codes de triche seront ajoutés à la fin de du fichier de triche existant.", diff --git a/resources/i18n/it/menus.json b/resources/i18n/it/menus.json index c1c362b..2dab6d2 100644 --- a/resources/i18n/it/menus.json +++ b/resources/i18n/it/menus.json @@ -20,7 +20,6 @@ "deleting": "Eliminazione in corso…", "cheatslips_title": "Scarica cheat da Cheat Slips", "gbatemp_title": "Scarica cheat da GBAtemp.net", - "get_gbatemp": "Scarica cheat da GBAtemp.net", "get_cheatslips": "Scarica cheat da Cheat Slips", "cheats_label": "\u25c6 Scarica individualmente i cheat dal database cheat di GBAtemp.net o cheat-sheet da Cheat Slips", "cheatslips_dl": "Scarica una selezione di cheat-sheet da Cheat Slips.\nSaranno aggiunti al termine del file di cheat presente sul tuo sistema.", diff --git a/resources/i18n/ja/menus.json b/resources/i18n/ja/menus.json index 6b60ff7..864bd74 100644 --- a/resources/i18n/ja/menus.json +++ b/resources/i18n/ja/menus.json @@ -19,7 +19,6 @@ "deleting": "削除中…", "cheatslips_title": "Cheat Slipsチート", "gbatemp_title": "GBAtemp.netチート", - "get_gbatemp": "GBAtemp.netチートコードをダウンロード", "get_cheatslips": "Cheat Slipsのチートシートをダウンロードする", "cheats_label": "\u25c6 GBAtemp.netデータベースから個々のチートコードをダウンロードするか、Cheat Slipsからチートシートをダウンロードします。", "cheatslips_dl": "Cheat Slipsから選択したチートシートをダウンロードします。\nこれらのチートコードは、既存のチートファイルの最後に追加されます。", diff --git a/resources/i18n/ko/menus.json b/resources/i18n/ko/menus.json index 50e6f5a..6a0db24 100644 --- a/resources/i18n/ko/menus.json +++ b/resources/i18n/ko/menus.json @@ -20,7 +20,6 @@ "deleting": "삭제 중…", "cheatslips_title": "Cheat Slips 치트", "gbatemp_title": "GBAtemp.net 치트", - "get_gbatemp": "GBAtemp.net 치트 코드 다운로드", "get_cheatslips": "Cheat Slips 치트 시트 다운로드", "cheats_label": "\u25c6 GBAtemp.net 데이터베이스에서 개별 치트 코드를 다운로드하거나 Cheat Slips에서 치트 시트를 다운로드하세요.", "cheatslips_dl": "Cheat Slips에서 일부 치트 시트를 다운로드합니다.\n해당 치트 코드는 기존 치트 파일의 끝에 추가됩니다.", @@ -73,7 +72,7 @@ "cancel": "취소", "off": "사용 안 함", "selected": "선택됨", - "applet_mode_not_supported": "이 기능은 애플릿 모드에서 사용할 수 없습니다. 접속하려면 타이틀 오버라이드를 통해 일체형-스위치-업데이터를 시작하세요." + "applet_mode_not_supported": "이 기능은 애플릿 모드에서 사용할 수 없습니다. 접속하려면 타이틀 오버라이드를 통해 일체형-스위치-업데이터를 시작하세요.", "nothing_to_see": "여기는 볼게 없습니다!" }, "changelog": { @@ -158,7 +157,7 @@ "batch_copy": "파일 일괄 복사", "batch_copy_not_found": "다음 파일을 찾을 수 없으며 복사할 수 없습니다:\n", "batch_copy_config_not_found": "이 도구를 사용하면 파일을 특정 위치에 자동으로 복사할 수 있습니다. 이것은 부트로더/트린켓에 따라 유용할 수 있습니다. 'https://git.io/aiosu_copyfiles' 에서 copy_files.txt를 가져와서 편집하고 구성 폴더에 추가합니다. 이것은 업데이트 후에도 수행됩니다.", - "language": "앱 언어 변경" + "language": "앱 언어 변경", "outdated_titles": "업데이트 누락", "latest_version_not_found": "업데이트 정보를 찾을 수 없음", "outdated_titles_desc": "다음 타이틀에 사용 가능한 업데이트가 있습니다:" @@ -188,7 +187,7 @@ "cant_fetch_deepsea": "패키지를 가져올 수 없습니다. 이 문제가 지속되면 Github에 등록하세요.", "build_your_deepsea": "패키지를 선택하여 커스텀 DeepSea 패키지를 빌드하세요.", "getting_ams": "Atmosphère 가져오기", - "custom_packs_label": "\u25c6 다음은 {} 파일에 나열된 팩입니다. 일체형-스위치-업데이터에서 승인하지 않았으므로 해당 출처를 신뢰해야 합니다." + "custom_packs_label": "\u25c6 다음은 {} 파일에 나열된 팩입니다. 일체형-스위치-업데이터에서 승인하지 않았으므로 해당 출처를 신뢰해야 합니다.", "custom_packs_ams": "\u25c6 Atmosphère 맞춤형 펌웨어가 포함된 다운로드입니다.", "custom_packs_misc": "\u25c6 홈브류와 도구가 포함된 다운로드입니다.", "custom_download" : "커스텀 다운로드", diff --git a/resources/i18n/zh-CN/menus.json b/resources/i18n/zh-CN/menus.json index 1e14918..a9f34f6 100644 --- a/resources/i18n/zh-CN/menus.json +++ b/resources/i18n/zh-CN/menus.json @@ -19,7 +19,6 @@ "deleting": "删除中…", "cheatslips_title": "Cheat Slips金手指", "gbatemp_title": "GBAtemp.net金手指", - "get_gbatemp": "下载GBAtemp.net金手指", "get_cheatslips": "下载Cheat Slips金手指表", "cheats_label": "\u25c6 从GBAtemp.net数据库下载单独的金手指,或从Cheat Slips下载金手指表", "cheatslips_dl": "从Cheat Slips下载精选的金手指表。\n这些金手指代码将被添加到您现有的金手指文件的末尾。", diff --git a/resources/i18n/zh-TW/menus.json b/resources/i18n/zh-TW/menus.json index 6b0b776..f8a9e27 100644 --- a/resources/i18n/zh-TW/menus.json +++ b/resources/i18n/zh-TW/menus.json @@ -20,7 +20,6 @@ "deleting": "正在刪除…", "cheatslips_title": "Cheat Slips金手指", "gbatemp_title": "GBAtemp.net金手指", - "get_gbatemp": "下載GBAtemp.net金手指", "get_cheatslips": "下載Cheat Slips的金手指列表", "cheats_label": "\u25c6 從GBAtemp.net資料庫下載個別遊戲金手指或從Cheat Slips下載金手指列表", "cheatslips_dl": "準備從Cheat Slips下載金手指。\n下載的金手指將會放置排列在目前已有的金手指項目之後", diff --git a/source/changelog_page.cpp b/source/changelog_page.cpp index 487d186..8b26bb6 100644 --- a/source/changelog_page.cpp +++ b/source/changelog_page.cpp @@ -261,8 +261,12 @@ ChangelogPage::ChangelogPage() : AppletFrame(true, true) verTitles.push_back("v2.21.0"); changes.push_back("\uE016 Dialogs now default to not overwriting .ini files"); - verTitles.push_back("v2.22.0"); - changes.push_back("\uE016 Improved Korean translation.\n\uE016 Be more conversative when checking available space before a download.\n\uE016 Minor fixes."); + verTitles.push_back("v2.21.2"); + changes.push_back("\uE016 Improved Korean translation.\n\uE016 Be more conservative when checking available space before a download.\n\uE016 Minor fixes."); + + verTitles.push_back("v2.21.3"); + changes.push_back("\uE016 Added download link for graphic enhancing codes."); + for (int i = verTitles.size() - 1; i >= 0; i--) { listItem = new brls::ListItem(verTitles[i]); diff --git a/source/download_cheats_page.cpp b/source/download_cheats_page.cpp index f750757..ca4da22 100644 --- a/source/download_cheats_page.cpp +++ b/source/download_cheats_page.cpp @@ -340,12 +340,13 @@ DownloadCheatsPage_GbaTemp::DownloadCheatsPage_GbaTemp(uint64_t tid, const std:: nlohmann::ordered_json cheatsJson; download::getRequest(CHEATS_DIRECTORY + util::formatApplicationId(this->tid) + ".json", cheatsJson); if (cheatsJson.find(this->bid) != cheatsJson.end()) { - for (const auto& p : cheatsJson[this->bid].items()) { - json cheat = p.value(); - this->listItem = new brls::ListItem(cheat.at("title")); - listItem->registerAction("menus/cheats/gbatemp_dl_cheatcode"_i18n, brls::Key::A, [this, cheat] { - WriteCheats(cheat.at("content")); - util::showDialogBoxInfo(fmt::format("menus/cheats/gbatemp_dl_successful_dl"_i18n, cheat.at("title"))); + for (auto& [key, val] : cheatsJson[this->bid].items()) { + auto title = key; + auto content = val; + this->listItem = new brls::ListItem(title); + listItem->registerAction("menus/cheats/gbatemp_dl_cheatcode"_i18n, brls::Key::A, [this, content, title] { + WriteCheats(content); + util::showDialogBoxInfo(fmt::format("menus/cheats/gbatemp_dl_successful_dl"_i18n, title)); return true; }); this->list->addView(listItem); diff --git a/source/list_download_tab.cpp b/source/list_download_tab.cpp index cf88a3e..6f841e2 100644 --- a/source/list_download_tab.cpp +++ b/source/list_download_tab.cpp @@ -49,8 +49,10 @@ void ListDownloadTab::createList() void ListDownloadTab::createList(contentType type) { std::vector> links; - if (type == contentType::cheats && this->newCheatsVer != "") + if (type == contentType::cheats && this->newCheatsVer != "") { links.push_back(std::make_pair(fmt::format("menus/main/get_cheats"_i18n, this->newCheatsVer), CurrentCfw::running_cfw == CFW::sxos ? CHEATS_URL_TITLES : CHEATS_URL_CONTENTS)); + links.push_back(std::make_pair("menus/main/get_cheats_gfx"_i18n, CurrentCfw::running_cfw == CFW::sxos ? GFX_CHEATS_URL_TITLES : GFX_CHEATS_URL_CONTENTS)); + } else links = download::getLinksFromJson(util::getValueFromKey(this->nxlinks, contentTypeNames[(int)type].data())); @@ -171,7 +173,7 @@ void ListDownloadTab::createCheatSlipItem() } else { std::string usr, pwd; - //Result rc = swkbdCreate(&kbd, 0); + // Result rc = swkbdCreate(&kbd, 0); brls::Swkbd::openForText([&usr](std::string text) { usr = text; }, "cheatslips.com e-mail", "", 64, "", 0, "Submit", "cheatslips.com e-mail"); brls::Swkbd::openForText([&pwd](std::string text) { pwd = text; }, "cheatslips.com password", "", 64, "", 0, "Submit", "cheatslips.com password", true); std::string body = "{\"email\":\"" + std::string(usr) + "\",\"password\":\"" + std::string(pwd) + "\"}"; diff --git a/source/utils.cpp b/source/utils.cpp index 47bfe5b..67270e7 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -269,9 +269,9 @@ namespace util { std::string getCheatsVersion() { std::string res = util::downloadFileToString(CHEATS_URL_VERSION); - if (res == "" && isArchive(CHEATS_FILENAME)) { + /* if (res == "" && isArchive(CHEATS_FILENAME)) { res = "offline"; - } + } */ return res; }