Some more ~~insect~~ bug fixes.

This commit is contained in:
StackZ
2020-11-07 10:03:03 +01:00
parent ddbea3ab36
commit ee2769b294
6 changed files with 33 additions and 7 deletions
+5 -1
View File
@@ -68,11 +68,13 @@ void StoreUtils::DrawSideMenu(int currentMenu) {
int &currentMenu: Reference to the Store Mode / Menu.
bool &fetch: Reference of the download fetch variable.. so we know, if we need to fetch the download entries.
int &lastMenu: Reference to the last menu.
*/
void StoreUtils::SideMenuHandle(int &currentMenu, bool &fetch) {
void StoreUtils::SideMenuHandle(int &currentMenu, bool &fetch, int &lastMenu) {
if (hDown & KEY_TOUCH) {
for (int i = 0; i < 5; i++) {
if (touching(touch, sidePos[i])) {
lastMenu = currentMenu;
if (i == 1) fetch = true; // Fetch download list, if 1.
currentMenu = i;
break;
@@ -82,6 +84,7 @@ void StoreUtils::SideMenuHandle(int &currentMenu, bool &fetch) {
if (hRepeat & KEY_R) {
if (currentMenu < 4) {
lastMenu = currentMenu;
if (currentMenu + 1 == 1) fetch = true; // Fetch download list, if 1.
currentMenu++;
}
@@ -89,6 +92,7 @@ void StoreUtils::SideMenuHandle(int &currentMenu, bool &fetch) {
if (hRepeat & KEY_L) {
if (currentMenu > 0) {
lastMenu = currentMenu;
if (currentMenu - 1 == 1) fetch = true; // Fetch download list, if 1.
currentMenu--;
}
+5
View File
@@ -208,6 +208,11 @@ void Store::loadSheets() {
*/
void Store::LoadFromFile(const std::string &file) {
FILE *in = fopen(file.c_str(), "rt");
if (!in) {
this->valid = false;
return;
}
this->storeJson = nlohmann::json::parse(in, nullptr, false);
fclose(in);