diff --git a/include/download/download.hpp b/include/download/download.hpp index 847edf2..c18e7b6 100644 --- a/include/download/download.hpp +++ b/include/download/download.hpp @@ -109,4 +109,5 @@ namespace download { void deleteFileList(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 displayTimeMsg(std::string message, int seconds); } \ No newline at end of file diff --git a/source/download/download.cpp b/source/download/download.cpp index 6e6f1f3..ea59f83 100644 --- a/source/download/download.cpp +++ b/source/download/download.cpp @@ -673,4 +673,11 @@ void download::extractFileList(std::string file, std::string input, std::string Threads::create((ThreadFunc)displayProgressBar); extractArchive(file, input, output); showProgressBar = false; +} + +void download::displayTimeMsg(std::string message, int seconds) { + DisplayMsg(message); + for (int i = 0; i < 60*seconds; i++) { + gspWaitForVBlank(); + } } \ No newline at end of file diff --git a/source/screens/scriptlist.cpp b/source/screens/scriptlist.cpp index dfe64f8..ae01aa2 100644 --- a/source/screens/scriptlist.cpp +++ b/source/screens/scriptlist.cpp @@ -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"); else missing = true; 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();