Add deleteTitle and bootTitle.

**ONLY USE "DELETE TITLE" WHEN NEEDED!!!!!!!!!!!!!**
This commit is contained in:
StackZ
2020-03-01 10:42:59 +01:00
parent 3c2ee7adb2
commit 1bdcf008bf
8 changed files with 111 additions and 20 deletions
+32
View File
@@ -148,4 +148,36 @@ bool ScriptHelper::checkIfValid(std::string scriptFile, int mode) {
}
return true;
}
void ScriptHelper::deleteTitle(const std::string TitleID, bool isNAND, std::string message) {
std::string MSG = Lang::get("DELETE_TITLE") + "\n\n";
if (isNAND) MSG += Lang::get("MEDIATYPE_NAND") + "\n" + TitleID;
else MSG += Lang::get("MEDIATYPE_SD") + "\n" + TitleID;
u64 ID = std::stoull(TitleID, 0, 16);
if (Msg::promptMsg(MSG)) {
if (isNAND == true) {
Msg::DisplayMsg(message);
deletePrevious(ID, MEDIATYPE_NAND);
} else {
Msg::DisplayMsg(message);
deletePrevious(ID, MEDIATYPE_SD);
}
}
}
void ScriptHelper::bootTitle(const std::string TitleID, bool isNAND, std::string message) {
std::string MSG = Lang::get("BOOT_TITLE") + "\n\n";
if (isNAND) MSG += Lang::get("MEDIATYPE_NAND") + "\n" + TitleID;
else MSG += Lang::get("MEDIATYPE_SD") + "\n" + TitleID;
u64 ID = std::stoull(TitleID, 0, 16);
if (Msg::promptMsg(MSG)) {
if (isNAND == true) {
Msg::DisplayMsg(message);
CIA_LaunchTitle(ID, MEDIATYPE_NAND);
} else {
Msg::DisplayMsg(message);
CIA_LaunchTitle(ID, MEDIATYPE_SD);
}
}
}