1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-09-19 13:33:39 +01:00

added support for support packs

This commit is contained in:
flb 2021-07-09 01:14:07 +02:00
parent 9c4637717d
commit 0fd52987b7
7 changed files with 29 additions and 7 deletions

View file

@ -22,7 +22,7 @@ DATA := data
INCLUDES := include lib/zipper/include /lib/borealis/library/include/borealis/extern/nlohmann INCLUDES := include lib/zipper/include /lib/borealis/library/include/borealis/extern/nlohmann
APP_TITLE := All-in-One Switch Updater APP_TITLE := All-in-One Switch Updater
APP_AUTHOR := HamletDuFromage APP_AUTHOR := HamletDuFromage
APP_VERSION := 2.9.0 APP_VERSION := 2.10.0
TARGET := $(notdir $(CURDIR)) TARGET := $(notdir $(CURDIR))
ROMFS := resources ROMFS := resources

4
customPacks.json Normal file
View file

@ -0,0 +1,4 @@
{
"Name of pack": "link_to_zip",
"Name of anther pack": "link_to_zip"
}

View file

@ -15,7 +15,7 @@ class AmsTab : public brls::List
std::string GetRepoName(const std::string& repo); std::string GetRepoName(const std::string& repo);
std::set<std::string> GetLastDownloadedModules(const std::string& json_path); std::set<std::string> GetLastDownloadedModules(const std::string& json_path);
void CreateStagedFrames(const std::string& text, const std::string& url, const std::string& operation, bool erista, bool hekate = false, const std::string& text_hekate = "", const std::string& hekate_url = ""); void CreateStagedFrames(const std::string& text, const std::string& url, const std::string& operation, bool erista, bool hekate = false, const std::string& text_hekate = "", const std::string& hekate_url = "");
void CreateDownloadItems(const std::string& key, bool hekate = true); void CreateDownloadItems(const nlohmann::ordered_json& cfw_links, bool hekate = true);
nlohmann::ordered_json SortDeepseaModules(const nlohmann::ordered_json& modules); nlohmann::ordered_json SortDeepseaModules(const nlohmann::ordered_json& modules);
void ShowCustomDeepseaBuilder(nlohmann::ordered_json& modules); void ShowCustomDeepseaBuilder(nlohmann::ordered_json& modules);

View file

@ -38,6 +38,8 @@ constexpr const char DEEPSEA_META_JSON[] = "https://builder.teamneptune.net/met
constexpr const char DEEPSEA_BUILD_URL[] = "https://builder.teamneptune.net/build/"; constexpr const char DEEPSEA_BUILD_URL[] = "https://builder.teamneptune.net/build/";
constexpr const char DEEPSEA_PACKAGE_PATH[] = "/config/deepsea/customPackage.json"; constexpr const char DEEPSEA_PACKAGE_PATH[] = "/config/deepsea/customPackage.json";
constexpr const char CUSTOM_PACKS_PATH[] = "/config/aio-switch-updater/customPacks.json";
constexpr const char CHEATS_RELEASE_URL[] = "https://github.com/HamletDuFromage/switch-cheats-db/releases/tag/v1.0"; constexpr const char CHEATS_RELEASE_URL[] = "https://github.com/HamletDuFromage/switch-cheats-db/releases/tag/v1.0";
constexpr const char CHEATS_URL_TITLES[] = "https://github.com/HamletDuFromage/switch-cheats-db/releases/download/v1.0/titles.zip"; constexpr const char CHEATS_URL_TITLES[] = "https://github.com/HamletDuFromage/switch-cheats-db/releases/download/v1.0/titles.zip";
constexpr const char CHEATS_URL_CONTENTS[] ="https://github.com/HamletDuFromage/switch-cheats-db/releases/download/v1.0/contents.zip"; constexpr const char CHEATS_URL_CONTENTS[] ="https://github.com/HamletDuFromage/switch-cheats-db/releases/download/v1.0/contents.zip";

View file

@ -179,7 +179,8 @@
"download_deepsea_package": "Compile and download", "download_deepsea_package": "Compile and download",
"cant_fetch_deepsea": "Couldn't fetch packages. Open a Github issue if this persists.", "cant_fetch_deepsea": "Couldn't fetch packages. Open a Github issue if this persists.",
"build_your_deepsea": "Build your own custom DeepSea package by selecting packages", "build_your_deepsea": "Build your own custom DeepSea package by selecting packages",
"getting_ams": "Getting Atmosphère" "getting_ams": "Getting Atmosphère",
"custom_packs_label": "Here are packs listed in the {} file. Be aware that those are not endorsed by aio-switch-updater so make sure you trust their source."
}, },
"net": { "net": {
"title": "Internet settings" "title": "Internet settings"

View file

@ -20,7 +20,7 @@ AmsTab::AmsTab(const bool erista) : brls::List()
download::getRequest(AMS_URL, cfws); download::getRequest(AMS_URL, cfws);
CreateDownloadItems("Atmosphere"); CreateDownloadItems(cfws["Atmosphere"]);
description = new brls::Label( description = new brls::Label(
brls::LabelStyle::DESCRIPTION, brls::LabelStyle::DESCRIPTION,
@ -38,14 +38,26 @@ AmsTab::AmsTab(const bool erista) : brls::List()
}); });
this->addView(listItem); this->addView(listItem);
CreateDownloadItems("DeepSea", false); CreateDownloadItems(cfws["DeepSea"], false);
auto custom_pack = fs::parseJsonFile(CUSTOM_PACKS_PATH);
if (custom_pack.size() != 0) {
description = new brls::Label(
brls::LabelStyle::DESCRIPTION,
fmt::format("menus/ams_update/custom_packs_label"_i18n, CUSTOM_PACKS_PATH),
true
);
this->addView(description);
CreateDownloadItems(custom_pack, true);
}
} }
void AmsTab::CreateDownloadItems(const std::string& key, bool hekate) void AmsTab::CreateDownloadItems(const nlohmann::ordered_json& cfw_links, bool hekate)
{ {
std::string operation("menus/ams_update/getting_ams"_i18n); std::string operation("menus/ams_update/getting_ams"_i18n);
std::vector<std::pair<std::string, std::string>> links; std::vector<std::pair<std::string, std::string>> links;
links = download::getLinksFromJson(cfws[key]); links = download::getLinksFromJson(cfw_links);
this->size = links.size(); this->size = links.size();
if(this->size){ if(this->size){
auto hekate_link = download::getLinks(HEKATE_URL); auto hekate_link = download::getLinks(HEKATE_URL);

View file

@ -172,6 +172,9 @@ ChangelogPage::ChangelogPage() : AppletFrame(true, true)
verTitles.push_back("v2.9.0"); verTitles.push_back("v2.9.0");
changes.push_back("\uE016 Added support for Team-Neptune's custom pack builder."); changes.push_back("\uE016 Added support for Team-Neptune's custom pack builder.");
verTitles.push_back("v2.9.0");
changes.push_back("\uE016 Added support custom packs through a json files.");
for(int i = verTitles.size() -1 ; i >= 0; i--){ for(int i = verTitles.size() -1 ; i >= 0; i--){
listItem = new brls::ListItem(verTitles[i]); listItem = new brls::ListItem(verTitles[i]);
change = changes[i]; change = changes[i];