mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-07 00:39:30 +00:00
UniStore v2! (#36)
* Do not build here. * WIP: UniStoreV2! This implementation is ugly and a big cleanup is needed. * [UniStoreV2]: Add `Lang::get(...)`. * Add back UniStore autobooting. * UniStoreV2: Add List Layout. * Some more UniStore work. Also constify vector's. * Some more spritesheet checks. * oops.. forgot to do `Config::fading`. * Display UniStore version on the Store list bar. * version now needs to be `0` or `1` or not included. versions with 2, 3, 4 and up shows an error now. * You can now also scroll to the next page with D-Pad Left/D-Pad Right! * Last fix before merge?
This commit is contained in:
@@ -38,37 +38,34 @@ class UniStore : public Screen {
|
||||
public:
|
||||
void Draw(void) const override;
|
||||
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;
|
||||
UniStore();
|
||||
UniStore(bool doAutoboot, std::string file);
|
||||
private:
|
||||
bool doAutoboot = false;
|
||||
std::string autobootFile = "";
|
||||
void refreshList();
|
||||
nlohmann::json openStoreFile();
|
||||
void loadStoreDesc(void);
|
||||
void loadStoreSheet(int pos);
|
||||
StoreInfo parseStoreInfo(std::string fileName);
|
||||
void autobootLogic();
|
||||
|
||||
void DrawSubMenu(void) const;
|
||||
void DrawStoreList(void) const;
|
||||
void DrawStore(void) const;
|
||||
void DrawSearch(void) const;
|
||||
void DrawFullURLScreen(void) const;
|
||||
void DrawGitHubScreen(void) const;
|
||||
void DrawGlossary(void) const;
|
||||
|
||||
void SubMenuLogic(u32 hDown, u32 hHeld, touchPosition touch);
|
||||
void StoreSelectionLogic(u32 hDown, u32 hHeld, touchPosition touch);
|
||||
void StoreLogic(u32 hDown, u32 hHeld, touchPosition touch);
|
||||
void SearchLogic(u32 hDown, u32 hHeld, touchPosition touch);
|
||||
void FullURLLogic(u32 hDown, u32 hHeld, touchPosition touch);
|
||||
void GitHubLogic(u32 hDown, u32 hHeld, touchPosition touch);
|
||||
|
||||
|
||||
Result execute();
|
||||
void descript();
|
||||
void updateStore(int selectedStore);
|
||||
void deleteStore(int selectedStore);
|
||||
bool handleIfDisplayText();
|
||||
int mode = 0;
|
||||
int lastMode = 1;
|
||||
mutable bool displayInformations = true;
|
||||
bool displayInformations = true;
|
||||
|
||||
// Stuff for the GitHub Store Search function and Full URL.
|
||||
std::string OwnerAndRepo = "";
|
||||
@@ -88,46 +85,46 @@ private:
|
||||
|
||||
// Other stuff.
|
||||
std::vector<StoreInfo> storeInfo; // Store Selection.
|
||||
std::vector<std::string> appStoreList; // Actual store. ;P
|
||||
std::vector<std::string> descLines;
|
||||
std::string storeDesc = "";
|
||||
nlohmann::json appStoreJson;
|
||||
nlohmann::json JSON;
|
||||
std::string currentStoreFile;
|
||||
|
||||
// Icon | Button Structs.
|
||||
std::vector<Structs::ButtonPos> arrowPos = {
|
||||
const std::vector<Structs::ButtonPos> arrowPos = {
|
||||
{295, 0, 25, 25}, // Arrow Up.
|
||||
{295, 215, 25, 25}, // Arrow Down.
|
||||
{0, 215, 25, 25}, // Back Arrow.
|
||||
{5, 0, 25, 25}, // Dropdown Menu.
|
||||
{5, 0, 25, 25} // Dropdown Menu.
|
||||
};
|
||||
|
||||
std::vector<Structs::ButtonPos> URLBtn = {
|
||||
const std::vector<Structs::ButtonPos> URLBtn = {
|
||||
{0, 60, 149, 52}, // FULL URL.
|
||||
{162, 60, 149, 52}, // GitHub.
|
||||
{0, 130, 149, 52}, // TinyDB.
|
||||
{162, 130, 149, 52} // QR Code?
|
||||
{162, 130, 149, 52} // Universal-DB.
|
||||
};
|
||||
|
||||
std::vector<Structs::ButtonPos> GitHubPos = {
|
||||
const std::vector<Structs::ButtonPos> GitHubPos = {
|
||||
{30, 50, 260, 30}, // Owner & Repo.
|
||||
{30, 130, 260, 30}, // Filename.
|
||||
{135, 180, 50, 30} // OK.
|
||||
};
|
||||
|
||||
std::vector<Structs::ButtonPos> subPos = {
|
||||
const std::vector<Structs::ButtonPos> subPos = {
|
||||
{80, 30, 149, 52}, // StoreList.
|
||||
{80, 90, 149, 52}, // storeSearch.
|
||||
{80, 150, 149, 52} // storePathChange.
|
||||
};
|
||||
|
||||
// DropDownMenu.
|
||||
std::vector<Structs::ButtonPos> dropPos = {
|
||||
const std::vector<Structs::ButtonPos> dropPos = {
|
||||
{5, 30, 25, 25}, // Delete.
|
||||
{5, 70, 25, 25}, // Update.
|
||||
{5, 110, 25, 25} // ViewMode.
|
||||
};
|
||||
std::vector<Structs::ButtonPos> dropPos2 = {
|
||||
|
||||
const std::vector<Structs::ButtonPos> dropPos2 = {
|
||||
{0, 28, 140, 30}, // Delete.
|
||||
{0, 68, 140, 30}, // Update.
|
||||
{0, 108, 140, 30} // ViewMode.
|
||||
|
||||
Reference in New Issue
Block a user