2020-12-12 15:41:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <borealis.hpp>
|
2021-06-27 23:46:00 +01:00
|
|
|
#include <json.hpp>
|
|
|
|
#include <set>
|
2020-12-12 15:41:56 +00:00
|
|
|
|
2022-09-06 19:45:26 +01:00
|
|
|
#include "constants.hpp"
|
|
|
|
|
2020-12-12 15:41:56 +00:00
|
|
|
class AmsTab : public brls::List
|
|
|
|
{
|
2022-10-31 18:59:48 +00:00
|
|
|
protected:
|
2021-09-11 14:48:13 +01:00
|
|
|
brls::ListItem* listItem;
|
|
|
|
bool erista;
|
2022-10-31 18:59:48 +00:00
|
|
|
nlohmann::ordered_json nxlinks;
|
2021-09-15 16:23:37 +01:00
|
|
|
nlohmann::ordered_json hekate;
|
2022-10-31 18:59:48 +00:00
|
|
|
contentType type;
|
2022-09-06 19:45:26 +01:00
|
|
|
void CreateStagedFrames(const std::string& text, const std::string& url, bool erista, bool ams = true, bool hekate = false, const std::string& text_hekate = "", const std::string& hekate_url = "");
|
2022-10-31 18:59:48 +00:00
|
|
|
bool CreateDownloadItems(const nlohmann::ordered_json& cfw_links, bool hekate = true, bool ams = true);
|
|
|
|
void CreateNotFoundLabel();
|
|
|
|
virtual void RegisterListItemAction(brls::ListItem* listItem);
|
|
|
|
|
|
|
|
public:
|
|
|
|
AmsTab(const nlohmann::ordered_json& nxlinks, const bool erista = true);
|
|
|
|
};
|
|
|
|
|
|
|
|
class AmsTab_Regular : public AmsTab
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
void CreateLists();
|
|
|
|
bool CreateDownloadItems(const nlohmann::ordered_json& cfw_links, bool hekate = true, bool ams = true);
|
2021-09-11 14:48:13 +01:00
|
|
|
void ShowCustomDeepseaBuilder(nlohmann::ordered_json& modules);
|
2022-10-31 18:59:48 +00:00
|
|
|
std::set<std::string> GetLastDownloadedModules(const std::string& json_path);
|
|
|
|
nlohmann::ordered_json SortDeepseaModules(const nlohmann::ordered_json& modules);
|
|
|
|
std::string GetRepoName(const std::string& repo);
|
|
|
|
|
|
|
|
public:
|
|
|
|
AmsTab_Regular(const nlohmann::ordered_json& nxlinks, const bool erista = true);
|
|
|
|
};
|
|
|
|
|
|
|
|
class AmsTab_Custom : public AmsTab
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
nlohmann::ordered_json custom_packs;
|
|
|
|
void CreateLists();
|
|
|
|
void RegisterListItemAction(brls::ListItem* listItem) override;
|
|
|
|
void AddLinkCreator();
|
2021-06-27 23:46:00 +01:00
|
|
|
|
2021-09-11 14:48:13 +01:00
|
|
|
public:
|
2022-10-31 18:59:48 +00:00
|
|
|
AmsTab_Custom(const nlohmann::ordered_json& nxlinks, const bool erista = true);
|
2021-06-27 23:46:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class UnTogglableListItem : public brls::ToggleListItem
|
|
|
|
{
|
2021-09-11 14:48:13 +01:00
|
|
|
public:
|
|
|
|
UnTogglableListItem(const std::string& label, bool initialValue, std::string description = "", std::string onValue = "On", std::string offValue = "Off") : ToggleListItem(label, initialValue, description, onValue, offValue) {}
|
|
|
|
virtual bool onClick() override;
|
2020-12-12 15:41:56 +00:00
|
|
|
};
|