Add search menu.

This commit is contained in:
StackZ
2020-06-19 16:48:05 +02:00
parent 6163891c63
commit 7972fd483a
5 changed files with 245 additions and 37 deletions
+9 -1
View File
@@ -45,12 +45,13 @@ private:
std::unique_ptr<Store> sortedStore;
bool darkMode = true, sheetLoaded = false, canDisplay = false, hasLoaded = false, isDropDown = false;
int selectedBox = 0, lastViewMode = 0, dropSelection = 0, iconAmount = 0, selectedBoxList = 0, selection = -1, storePage = 0, downloadPage = 0, storePageList = 0, mode = 0, subSelection = 0;
int selectedBox = 0, lastViewMode = 0, dropSelection = 0, searchSelection = 0, iconAmount = 0, selectedBoxList = 0, selection = -1, storePage = 0, downloadPage = 0, storePageList = 0, mode = 0, subSelection = 0;
nlohmann::json storeJson;
C2D_SpriteSheet sheet;
std::vector<std::string> objects;
void DrawSortingMenu(void) const;
void DrawSearchMenu(void) const;
// Base stuff.
void DrawBaseTop(void) const;
@@ -120,6 +121,13 @@ private:
{115, 170, 100, 30} // Last Updated.
};
const std::vector<Structs::ButtonPos> searchPos = {
{0, 60, 149, 52}, // Title.
{162, 60, 149, 52}, // Author.
{0, 130, 149, 52}, // Category.
{162, 130, 149, 52} // Console.
};
u32 barColorLight, barColorDark, bgColorLight, bgColorDark, textColorLight, textColorDark, boxColorLight, boxColorDark, outlineColorLight, outlineColorDark;
};
+6
View File
@@ -61,7 +61,13 @@ public:
int returnJSONIndex(const int index);
int getSize();
bool getAscending() { return this->ascending; }
// Searching stuff.
int searchForEntries(const std::string searchResult);
int searchForAuthor(const std::string searchResult);
int searchForCategory(const std::string searchResult);
int searchForConsole(const std::string searchResult);
void reset() { this->sortedStore = this->unsortedStore; }
const int getSortType() {