Add touch for: Scriptlist, Get Scripts and TinyDB.

This commit is contained in:
SuperSaiyajinStackZ
2019-12-22 22:37:08 +01:00
parent b723836397
commit 14b93d286e
3 changed files with 126 additions and 0 deletions
+68
View File
@@ -394,6 +394,52 @@ void ScriptList::ListSelection(u32 hDown, u32 hHeld, touchPosition touch) {
selection = 0;
}
}
if (hDown & KEY_TOUCH) {
if (Config::viewMode == 0) {
for(int i=0;i<ENTRIES_PER_SCREEN;i++) {
if(touch.py > (i+1)*57 && touch.py < (i+2)*57) {
if (dirContents[screenPos + i].isDirectory) {
} else if (fileInfo.size() != 0) {
if (ScriptHelper::checkIfValid(dirContents[screenPos + i].name) == true) {
currentFile = dirContents[screenPos + i].name;
selectedTitle = fileInfo[screenPos + i].title;
jsonFile = openScriptFile();
Desc = Description(jsonFile);
checkForValidate();
fileInfo2 = parseObjects(currentFile);
loadColors(jsonFile);
loadDesc();
isScriptSelected = true;
selection = 0;
mode = 1;
}
}
}
}
} else if (Config::viewMode == 1) {
for(int i=0;i<ENTRIES_PER_LIST;i++) {
if(touch.py > (i+1)*27 && touch.py < (i+2)*27) {
if (dirContents[screenPosList + i].isDirectory) {
} else if (fileInfo.size() != 0) {
if (ScriptHelper::checkIfValid(dirContents[screenPosList + i].name) == true) {
currentFile = dirContents[screenPosList + i].name;
selectedTitle = fileInfo[screenPosList + i].title;
jsonFile = openScriptFile();
Desc = Description(jsonFile);
checkForValidate();
fileInfo2 = parseObjects(currentFile);
loadColors(jsonFile);
loadDesc();
isScriptSelected = true;
selection = 0;
mode = 1;
}
}
}
}
}
}
if (hHeld & KEY_DOWN && !keyRepeatDelay) {
if (selection < (int)fileInfo.size()-1) {
@@ -480,6 +526,28 @@ void ScriptList::SelectFunction(u32 hDown, u32 hHeld, touchPosition touch) {
}
}
if (hDown & KEY_TOUCH) {
if (Config::viewMode == 0) {
for(int i=0;i<ENTRIES_PER_SCREEN;i++) {
if(touch.py > (i+1)*57 && touch.py < (i+2)*57) {
if (fileInfo2.size() != 0) {
choice = fileInfo2[screenPos2 + i];
runFunctions(jsonFile);
}
}
}
} else if (Config::viewMode == 1) {
for(int i=0;i<ENTRIES_PER_LIST;i++) {
if(touch.py > (i+1)*27 && touch.py < (i+2)*27) {
if (fileInfo2.size() != 0) {
choice = fileInfo2[screenPosList2 + i];
runFunctions(jsonFile);
}
}
}
}
}
if (hHeld & KEY_DOWN && !keyRepeatDelay) {
if (selection2 < (int)fileInfo2.size()-1) {
selection2++;