mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
*Only* open valid Scripts.
This commit is contained in:
@@ -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