mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-06 16:49:11 +00:00
This should fix the Issues.
Also: Don't do anything when pressed `A` on folders.
This commit is contained in:
@@ -132,8 +132,16 @@ void ScriptBrowse::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
|||||||
if (hDown & KEY_A) {
|
if (hDown & KEY_A) {
|
||||||
if (jsonFileBrowse.size() != 0) {
|
if (jsonFileBrowse.size() != 0) {
|
||||||
std::string fileName = Lang::get("DOWNLOADING") + std::string(jsonFileBrowse[selection]["title"]);
|
std::string fileName = Lang::get("DOWNLOADING") + std::string(jsonFileBrowse[selection]["title"]);
|
||||||
|
|
||||||
|
std::string titleFix = jsonFileBrowse[selection]["title"];
|
||||||
|
for (int i = 0; i < (int)titleFix.size(); i++) {
|
||||||
|
if (titleFix[i] == '/') {
|
||||||
|
titleFix[i] = '-';
|
||||||
|
}
|
||||||
|
}
|
||||||
DisplayMsg(fileName);
|
DisplayMsg(fileName);
|
||||||
downloadToFile(jsonFileBrowse[selection]["url"], Config::ScriptPath + std::string(jsonFileBrowse[selection]["title"])+ ".json");
|
|
||||||
|
downloadToFile(jsonFileBrowse[selection]["url"], Config::ScriptPath + titleFix + ".json");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ void loadColors(nlohmann::json &json) {
|
|||||||
ScriptList::ScriptList() {
|
ScriptList::ScriptList() {
|
||||||
dirContents.clear();
|
dirContents.clear();
|
||||||
chdir(Config::ScriptPath.c_str());
|
chdir(Config::ScriptPath.c_str());
|
||||||
getDirectoryContents(dirContents);
|
getDirectoryContents(dirContents, {"json"});
|
||||||
for(uint i=0;i<dirContents.size();i++) {
|
for(uint i=0;i<dirContents.size();i++) {
|
||||||
fileInfo.push_back(parseInfo(dirContents[i].name));
|
fileInfo.push_back(parseInfo(dirContents[i].name));
|
||||||
}
|
}
|
||||||
@@ -375,7 +375,8 @@ void ScriptList::ListSelection(u32 hDown, u32 hHeld) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hDown & KEY_A) {
|
if (hDown & KEY_A) {
|
||||||
if (fileInfo.size() != 0) {
|
if (dirContents[selection].isDirectory) {
|
||||||
|
} else if (fileInfo.size() != 0) {
|
||||||
currentFile = dirContents[selection].name;
|
currentFile = dirContents[selection].name;
|
||||||
selectedTitle = fileInfo[selection].title;
|
selectedTitle = fileInfo[selection].title;
|
||||||
jsonFile = openScriptFile();
|
jsonFile = openScriptFile();
|
||||||
|
|||||||
Reference in New Issue
Block a user