mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-07 08:49:08 +00:00
Add timeMsg Function.
This commit is contained in:
@@ -109,4 +109,5 @@ namespace download {
|
|||||||
void deleteFileList(std::string file, std::string message);
|
void deleteFileList(std::string file, std::string message);
|
||||||
void installFileList(std::string file, std::string message);
|
void installFileList(std::string file, std::string message);
|
||||||
void extractFileList(std::string file, std::string input, std::string output, std::string message);
|
void extractFileList(std::string file, std::string input, std::string output, std::string message);
|
||||||
|
void displayTimeMsg(std::string message, int seconds);
|
||||||
}
|
}
|
||||||
@@ -674,3 +674,10 @@ void download::extractFileList(std::string file, std::string input, std::string
|
|||||||
extractArchive(file, input, output);
|
extractArchive(file, input, output);
|
||||||
showProgressBar = false;
|
showProgressBar = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void download::displayTimeMsg(std::string message, int seconds) {
|
||||||
|
DisplayMsg(message);
|
||||||
|
for (int i = 0; i < 60*seconds; i++) {
|
||||||
|
gspWaitForVBlank();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -224,6 +224,17 @@ void runFunctions(nlohmann::json &json) {
|
|||||||
if(json.at(choice).at(i).contains("file")) file = json.at(choice).at(i).at("file");
|
if(json.at(choice).at(i).contains("file")) file = json.at(choice).at(i).at("file");
|
||||||
else missing = true;
|
else missing = true;
|
||||||
if(!missing) createFile(file.c_str());
|
if(!missing) createFile(file.c_str());
|
||||||
|
|
||||||
|
} else if (type == "timeMsg") {
|
||||||
|
bool missing = false;
|
||||||
|
std::string message;
|
||||||
|
int seconds;
|
||||||
|
if(json.at(choice).at(i).contains("message")) message = json.at(choice).at(i).at("message");
|
||||||
|
else missing = true;
|
||||||
|
if(json.at(choice).at(i).contains("seconds") && json.at(choice).at(i).at("seconds").is_number())
|
||||||
|
seconds = json.at(choice).at(i).at("seconds");
|
||||||
|
else missing = true;
|
||||||
|
if(!missing) download::displayTimeMsg(message, seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
doneMsg();
|
doneMsg();
|
||||||
|
|||||||
Reference in New Issue
Block a user