diff --git a/source/screens/scriptBrowse.cpp b/source/screens/scriptBrowse.cpp index 8d8699c..7c98ffd 100644 --- a/source/screens/scriptBrowse.cpp +++ b/source/screens/scriptBrowse.cpp @@ -45,12 +45,12 @@ std::string maxScripts; void fixInfo(nlohmann::json &json) { for(uint i=0;i (i+1)*57 && touch.py < (i+2)*57) { if (infoJson.size() != 0) { std::string fileName = Lang::get("DOWNLOADING") + std::string(infoJson[screenPos + i]["title"]); @@ -241,11 +241,11 @@ void ScriptBrowse::Logic(u32 hDown, u32 hHeld, touchPosition touch) { downloadToFile(infoJson[screenPos + i]["url"], Config::ScriptPath + titleFix + ".json"); infoJson[screenPos + i]["curRevision"] = infoJson[screenPos + i]["revision"]; } - } + } } } else if (Config::viewMode == 1) { - for(int i=0;i (i+1)*27 && touch.py < (i+2)*27) { + for(int i=0;i (i+1)*27 && touch.py < (i+2)*27) { if (infoJson.size() != 0) { std::string fileName = Lang::get("DOWNLOADING") + std::string(infoJson[screenPosList + i]["title"]); std::string titleFix = infoJson[screenPosList + i]["title"]; @@ -258,7 +258,7 @@ void ScriptBrowse::Logic(u32 hDown, u32 hHeld, touchPosition touch) { downloadToFile(infoJson[screenPosList + i]["url"], Config::ScriptPath + titleFix + ".json"); infoJson[screenPosList + i]["curRevision"] = infoJson[screenPosList + i]["revision"]; } - } + } } } } diff --git a/source/screens/scriptlist.cpp b/source/screens/scriptlist.cpp index adad82d..d21e0d0 100644 --- a/source/screens/scriptlist.cpp +++ b/source/screens/scriptlist.cpp @@ -84,7 +84,7 @@ void checkForValidate(void) { nlohmann::json openScriptFile() { FILE* file = fopen(currentFile.c_str(), "rt"); nlohmann::json jsonFile; - if(file) jsonFile = nlohmann::json::parse(file, nullptr, false); + if(file) jsonFile = nlohmann::json::parse(file, nullptr, false); fclose(file); return jsonFile; } @@ -123,7 +123,7 @@ void runFunctions(nlohmann::json &json) { bool missing = false; std::string file, message; if(json.at(choice).at(i).contains("file")) file = json.at(choice).at(i).at("file"); - else missing = true; + else missing = true; if(json.at(choice).at(i).contains("message")) message = json.at(choice).at(i).at("message"); if(!missing) ScriptHelper::removeFile(file, message); @@ -167,7 +167,7 @@ void runFunctions(nlohmann::json &json) { bool missing = false; std::string file, message; if(json.at(choice).at(i).contains("file")) file = json.at(choice).at(i).at("file"); - else missing = true; + else missing = true; if(json.at(choice).at(i).contains("message")) message = json.at(choice).at(i).at("message"); if(!missing) ScriptHelper::installFile(file, message); @@ -351,7 +351,7 @@ void ScriptList::DrawSingleObject(void) const { info = fileInfo2[screenPos2 + i]; if(screenPos2 + i == selection2) { Gui::Draw_Rect(0, 40+(i*57), 320, 45, selected); - } else { + } else { Gui::Draw_Rect(0, 40+(i*57), 320, 45, unselected); } Gui::DrawStringCentered(0, 50+(i*57), 0.7f, TextColor, info, 320); @@ -362,7 +362,7 @@ void ScriptList::DrawSingleObject(void) const { info = fileInfo2[screenPosList2 + i]; if(screenPosList2 + i == selection2) { Gui::Draw_Rect(0, (i+1)*27, 320, 25, selected); - } else { + } else { Gui::Draw_Rect(0, (i+1)*27, 320, 25, unselected); } Gui::DrawStringCentered(0, ((i+1)*27)+1, 0.7f, TextColor, info, 320); @@ -403,7 +403,7 @@ void ScriptList::ListSelection(u32 hDown, u32 hHeld, touchPosition touch) { if (hDown & KEY_TOUCH) { if (Config::viewMode == 0) { - for(int i=0;i (i+1)*57 && touch.py < (i+2)*57) { if (dirContents[screenPos + i].isDirectory) { } else if (fileInfo.size() != 0) { @@ -424,7 +424,7 @@ void ScriptList::ListSelection(u32 hDown, u32 hHeld, touchPosition touch) { } } } else if (Config::viewMode == 1) { - for(int i=0;i (i+1)*27 && touch.py < (i+2)*27) { if (dirContents[screenPosList + i].isDirectory) { } else if (fileInfo.size() != 0) { @@ -541,7 +541,7 @@ void ScriptList::SelectFunction(u32 hDown, u32 hHeld, touchPosition touch) { if (hDown & KEY_TOUCH) { if (Config::viewMode == 0) { - for(int i=0;i (i+1)*57 && touch.py < (i+2)*57) { if (fileInfo2.size() != 0) { choice = fileInfo2[screenPos2 + i]; @@ -550,7 +550,7 @@ void ScriptList::SelectFunction(u32 hDown, u32 hHeld, touchPosition touch) { } } } else if (Config::viewMode == 1) { - for(int i=0;i (i+1)*27 && touch.py < (i+2)*27) { if (fileInfo2.size() != 0) { choice = fileInfo2[screenPosList2 + i]; diff --git a/source/screens/tinyDB.cpp b/source/screens/tinyDB.cpp index deea76a..6656ea7 100644 --- a/source/screens/tinyDB.cpp +++ b/source/screens/tinyDB.cpp @@ -77,7 +77,6 @@ TinyDB::TinyDB() { selectedOption = tinyDBList[0]; } -// To-Do. void TinyDB::Draw(void) const { std::string info; Gui::setDraw(top); @@ -228,7 +227,7 @@ void TinyDB::Logic(u32 hDown, u32 hHeld, touchPosition touch) { if (hDown & KEY_TOUCH) { if (Config::viewMode == 0) { - for(int i=0;i (i+1)*57 && touch.py < (i+2)*57) { selection = screenPos + i; selectedOption = tinyDBList[screenPos + i]; @@ -236,7 +235,7 @@ void TinyDB::Logic(u32 hDown, u32 hHeld, touchPosition touch) { } } } else if (Config::viewMode == 1) { - for(int i=0;i (i+1)*27 && touch.py < (i+2)*27) { selection = screenPosList + i; selectedOption = tinyDBList[screenPosList + i]; @@ -258,7 +257,7 @@ void TinyDB::execute() { bool missing = false; std::string file, message; if(tinyDBJson.at(selectedOption).at("script").at(i).contains("file")) file = tinyDBJson.at(selectedOption).at("script").at(i).at("file"); - else missing = true; + else missing = true; if(tinyDBJson.at(selectedOption).at("script").at(i).contains("message")) message = tinyDBJson.at(selectedOption).at("script").at(i).at("message"); if(!missing) ScriptHelper::removeFile(file, message); @@ -276,7 +275,7 @@ void TinyDB::execute() { bool missing = false; std::string file, message; if(tinyDBJson.at(selectedOption).at("script").at(i).contains("file")) file = tinyDBJson.at(selectedOption).at("script").at(i).at("file"); - else missing = true; + else missing = true; if(tinyDBJson.at(selectedOption).at("script").at(i).contains("message")) message = tinyDBJson.at(selectedOption).at("script").at(i).at("message"); if(!missing) ScriptHelper::installFile(file, message); }