mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-12-06 03:07:19 +00:00
*Only* open valid Scripts.
This commit is contained in:
1 parent
11e7664706
commit
3ebdb7e95d
5 files changed
+29
-15
No files matched your search
@@ -131,4 +131,18 @@ void ScriptHelper::displayTimeMsg(std::string message, int seconds) {
|
||||
for (int i = 0; i < 60*seconds; i++) {
|
||||
gspWaitForVBlank();
|
||||
}
|
||||
}
|
||||
|
||||
bool ScriptHelper::checkIfValid(std::string scriptFile) {
|
||||
FILE* file = fopen(scriptFile.c_str(), "rt");
|
||||
if(!file) {
|
||||
printf("File not found\n");
|
||||
return false;
|
||||
}
|
||||
nlohmann::json json = nlohmann::json::parse(file, nullptr, false);
|
||||
fclose(file);
|
||||
|
||||
if (!json.contains("info")) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in new issue
Block a user