mirror of
https://github.com/HamletDuFromage/aio-switch-updater.git
synced 2024-11-28 04:12:03 +00:00
added support for support packs
This commit is contained in:
parent
9c4637717d
commit
0fd52987b7
7 changed files with 29 additions and 7 deletions
2
Makefile
2
Makefile
|
@ -22,7 +22,7 @@ DATA := data
|
|||
INCLUDES := include lib/zipper/include /lib/borealis/library/include/borealis/extern/nlohmann
|
||||
APP_TITLE := All-in-One Switch Updater
|
||||
APP_AUTHOR := HamletDuFromage
|
||||
APP_VERSION := 2.9.0
|
||||
APP_VERSION := 2.10.0
|
||||
TARGET := $(notdir $(CURDIR))
|
||||
|
||||
ROMFS := resources
|
||||
|
|
4
customPacks.json
Normal file
4
customPacks.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"Name of pack": "link_to_zip",
|
||||
"Name of anther pack": "link_to_zip"
|
||||
}
|
|
@ -15,7 +15,7 @@ class AmsTab : public brls::List
|
|||
std::string GetRepoName(const std::string& repo);
|
||||
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 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);
|
||||
void ShowCustomDeepseaBuilder(nlohmann::ordered_json& modules);
|
||||
|
||||
|
|
|
@ -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_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_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";
|
||||
|
|
|
@ -179,7 +179,8 @@
|
|||
"download_deepsea_package": "Compile and download",
|
||||
"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",
|
||||
"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": {
|
||||
"title": "Internet settings"
|
||||
|
|
|
@ -20,7 +20,7 @@ AmsTab::AmsTab(const bool erista) : brls::List()
|
|||
|
||||
download::getRequest(AMS_URL, cfws);
|
||||
|
||||
CreateDownloadItems("Atmosphere");
|
||||
CreateDownloadItems(cfws["Atmosphere"]);
|
||||
|
||||
description = new brls::Label(
|
||||
brls::LabelStyle::DESCRIPTION,
|
||||
|
@ -38,14 +38,26 @@ AmsTab::AmsTab(const bool erista) : brls::List()
|
|||
});
|
||||
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::vector<std::pair<std::string, std::string>> links;
|
||||
links = download::getLinksFromJson(cfws[key]);
|
||||
links = download::getLinksFromJson(cfw_links);
|
||||
this->size = links.size();
|
||||
if(this->size){
|
||||
auto hekate_link = download::getLinks(HEKATE_URL);
|
||||
|
|
|
@ -172,6 +172,9 @@ ChangelogPage::ChangelogPage() : AppletFrame(true, true)
|
|||
verTitles.push_back("v2.9.0");
|
||||
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--){
|
||||
listItem = new brls::ListItem(verTitles[i]);
|
||||
change = changes[i];
|
||||
|
|
Loading…
Reference in a new issue