mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
A little Script Creator work and little checks. (#9)
* No builds allowed here. * Try something. * Next work. * Add some Logging stuff for testing purpose. * Ok, this should log it priperly. * Replace MainMenu with Screen Selection. * Redo Screen Logic. * Switch back to old MainMenu. * Only access Scriptlist, when Scripts are found. Hopefully avoid crashes with that. * Remove unused String, because we use the MainMenu again.
This commit is contained in:
@@ -43,14 +43,14 @@ nlohmann::json infoJson;
|
||||
std::string maxScripts;
|
||||
|
||||
void fixInfo(nlohmann::json &json) {
|
||||
for(uint i=0;i<json.size();i++) {
|
||||
if(!json[i].contains("title")) json[i]["title"] = "TITLE";
|
||||
if(!json[i].contains("author")) json[i]["author"] = "AUTHOR";
|
||||
for(uint i=0;i<json.size();i++) {
|
||||
if(!json[i].contains("title")) json[i]["title"] = "TITLE";
|
||||
if(!json[i].contains("author")) json[i]["author"] = "AUTHOR";
|
||||
if(!json[i].contains("shortDesc")) json[i]["shortDesc"] = "SHORTDESC";
|
||||
if(!json[i].contains("revision")) json[i]["revision"] = 0;
|
||||
if(!json[i].contains("curRevision")) json[i]["curRevision"] = 0;
|
||||
if(!json[i].contains("version")) json[i]["revision"] = 0;
|
||||
}
|
||||
if(!json[i].contains("revision")) json[i]["revision"] = 0;
|
||||
if(!json[i].contains("curRevision")) json[i]["curRevision"] = 0;
|
||||
if(!json[i].contains("version")) json[i]["revision"] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
nlohmann::json infoFromScript(const std::string &path) {
|
||||
@@ -169,7 +169,7 @@ void ScriptBrowse::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
if (keyRepeatDelay) keyRepeatDelay--;
|
||||
if (hDown & KEY_B) {
|
||||
infoJson.clear();
|
||||
Gui::screenBack();
|
||||
Screen::back();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -205,9 +205,9 @@ void ScriptBrowse::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
|
||||
std::string titleFix = infoJson[selection]["title"];
|
||||
for (int i = 0; i < (int)titleFix.size(); i++) {
|
||||
if (titleFix[i] == '/') {
|
||||
titleFix[i] = '-';
|
||||
}
|
||||
if (titleFix[i] == '/') {
|
||||
titleFix[i] = '-';
|
||||
}
|
||||
}
|
||||
DisplayMsg(fileName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user