2020-09-20 01:21:28 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <borealis.hpp>
|
2021-06-27 23:46:00 +01:00
|
|
|
#include <switch.h>
|
2021-06-28 20:56:24 +01:00
|
|
|
#include <filesystem>
|
2020-09-20 01:21:28 +01:00
|
|
|
#include <algorithm>
|
2021-02-10 16:28:47 +00:00
|
|
|
#include <set>
|
2020-09-20 01:21:28 +01:00
|
|
|
|
2021-06-27 23:46:00 +01:00
|
|
|
static constexpr uint32_t MaxTitleCount = 64000;
|
2020-09-20 01:21:28 +01:00
|
|
|
|
2021-06-05 18:10:51 +01:00
|
|
|
enum class appPageType{
|
|
|
|
base,
|
|
|
|
cheatSlips,
|
|
|
|
gbatempCheats
|
|
|
|
};
|
2020-09-20 01:21:28 +01:00
|
|
|
|
|
|
|
class AppPage : public brls::AppletFrame
|
|
|
|
{
|
|
|
|
private:
|
2021-06-27 23:46:00 +01:00
|
|
|
brls::ListItem* download;
|
|
|
|
std::set<std::string> titles;
|
|
|
|
|
|
|
|
protected:
|
2020-09-20 01:21:28 +01:00
|
|
|
brls::List* list;
|
|
|
|
brls::Label* label;
|
2021-02-06 17:24:47 +00:00
|
|
|
brls::ListItem* listItem;
|
2021-06-27 23:46:00 +01:00
|
|
|
void CreateDownloadAllButton();
|
|
|
|
uint64_t GetCurrentApplicationId();
|
|
|
|
u32 InitControlData(NsApplicationControlData** controlData);
|
|
|
|
uint32_t GetControlData(u64 tid, NsApplicationControlData* controlData, u64& controlSize, std::string& name);
|
|
|
|
virtual void PopulatePage();
|
|
|
|
virtual void CreateLabel() { };
|
2021-06-28 15:58:04 +01:00
|
|
|
virtual void DeclareGameListItem(const std::string& name, uint64_t tid, NsApplicationControlData **controlData);
|
2021-06-27 23:46:00 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
AppPage();
|
|
|
|
};
|
|
|
|
|
|
|
|
class AppPage_Exclude : public AppPage
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
std::set<std::pair<brls::ToggleListItem*, std::string>> items;
|
|
|
|
void PopulatePage() override;
|
|
|
|
void CreateLabel() override;
|
|
|
|
public:
|
|
|
|
AppPage_Exclude();
|
|
|
|
};
|
|
|
|
|
|
|
|
class AppPage_CheatSlips : public AppPage
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
void CreateLabel() override;
|
2021-06-28 15:58:04 +01:00
|
|
|
void DeclareGameListItem(const std::string& name, uint64_t tid, NsApplicationControlData **controlData) override;
|
2021-06-27 23:46:00 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
AppPage_CheatSlips();
|
|
|
|
};
|
|
|
|
|
|
|
|
class AppPage_Gbatemp : public AppPage
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
void CreateLabel() override;
|
2021-06-28 15:58:04 +01:00
|
|
|
void DeclareGameListItem(const std::string& name, uint64_t tid, NsApplicationControlData **controlData) override;
|
2020-09-20 01:21:28 +01:00
|
|
|
|
|
|
|
public:
|
2021-06-27 23:46:00 +01:00
|
|
|
AppPage_Gbatemp();
|
2021-06-28 15:58:04 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class AppPage_DownloadedCheats : public AppPage
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
std::set<std::string> titles;
|
|
|
|
void CreateLabel() override;
|
|
|
|
void DeclareGameListItem(const std::string& name, uint64_t tid, NsApplicationControlData **controlData) override;
|
|
|
|
void GetExistingCheatsTids();
|
2021-06-28 20:56:24 +01:00
|
|
|
void ShowCheatFiles(uint64_t tid, const std::string& name);
|
|
|
|
bool CreateCheatList(const std::filesystem::path& path, brls::TabFrame** appView);
|
2021-06-28 15:58:04 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
AppPage_DownloadedCheats();
|
2020-09-20 01:21:28 +01:00
|
|
|
};
|