This should fix the Issues.

Also: Don't do anything when pressed `A` on folders.
This commit is contained in:
VoltZ 2019-11-06 17:03:59 +01:00
commit f702a94573
2 changed files with 12 additions and 3 deletions

View file

@ -278,7 +278,7 @@ void loadColors(nlohmann::json &json) {
ScriptList::ScriptList() {
dirContents.clear();
chdir(Config::ScriptPath.c_str());
getDirectoryContents(dirContents);
getDirectoryContents(dirContents, {"json"});
for(uint i=0;i<dirContents.size();i++) {
fileInfo.push_back(parseInfo(dirContents[i].name));
}
@ -375,7 +375,8 @@ void ScriptList::ListSelection(u32 hDown, u32 hHeld) {
}
if (hDown & KEY_A) {
if (fileInfo.size() != 0) {
if (dirContents[selection].isDirectory) {
} else if (fileInfo.size() != 0) {
currentFile = dirContents[selection].name;
selectedTitle = fileInfo[selection].title;
jsonFile = openScriptFile();