mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
Download previous versions (#20)
* WIP: Start adding downloading pervious versions * Oops this was in here * Properly add Download previous Releases. * Finally fix it. Co-authored-by: StackZ <47382115+SuperSaiyajinStackZ@users.noreply.github.com>
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "config.hpp"
|
||||
#include "ftpScreen.hpp"
|
||||
#include "mainMenu.hpp"
|
||||
#include "scriptHelper.hpp"
|
||||
#include "scriptlist.hpp"
|
||||
#include "settings.hpp"
|
||||
#include "unistore.hpp"
|
||||
@@ -35,6 +36,7 @@ extern bool exiting;
|
||||
extern bool touching(touchPosition touch, Structs::ButtonPos button);
|
||||
extern int fadealpha;
|
||||
extern bool fadein;
|
||||
extern u32 TextColor;
|
||||
|
||||
void MainMenu::Draw(void) const {
|
||||
GFX::DrawTop();
|
||||
@@ -126,4 +128,10 @@ void MainMenu::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
Gui::setScreen(std::make_unique<FTPScreen>());
|
||||
}
|
||||
}
|
||||
|
||||
/* That was a test.
|
||||
if (hDown & KEY_X) {
|
||||
TextColor = Config::TxtColor;
|
||||
ScriptHelper::downloadRelease("Universal-Team/extras", "Universal-Updater.3dsx", "/3ds/Universal-Updater.3dsx", true, true, "Downloading Universal-Updater...");
|
||||
}*/
|
||||
}
|
||||
@@ -907,7 +907,7 @@ void ScriptList::runFunctions(nlohmann::json &json) {
|
||||
if(!missing) ScriptHelper::downloadFile(file, output, message);
|
||||
|
||||
} else if(type == "downloadRelease") {
|
||||
bool missing = false, includePrereleases = false;
|
||||
bool missing = false, includePrereleases = false, showVersions = false;
|
||||
std::string repo, file, output, message;
|
||||
if(json.at(choice).at(i).contains("repo")) repo = json.at(choice).at(i).at("repo");
|
||||
else missing = true;
|
||||
@@ -917,8 +917,10 @@ void ScriptList::runFunctions(nlohmann::json &json) {
|
||||
else missing = true;
|
||||
if(json.at(choice).at(i).contains("includePrereleases") && json.at(choice).at(i).at("includePrereleases").is_boolean())
|
||||
includePrereleases = json.at(choice).at(i).at("includePrereleases");
|
||||
if(json.at(choice).at(i).contains("showVersions") && json.at(choice).at(i).at("showVersions").is_boolean())
|
||||
showVersions = json.at(choice).at(i).at("showVersions");
|
||||
if(json.at(choice).at(i).contains("message")) message = json.at(choice).at(i).at("message");
|
||||
if(!missing) ScriptHelper::downloadRelease(repo, file, output, includePrereleases, message);
|
||||
if(!missing) ScriptHelper::downloadRelease(repo, file, output, includePrereleases, showVersions, message);
|
||||
|
||||
} else if(type == "extractFile") {
|
||||
bool missing = false;
|
||||
|
||||
@@ -1239,7 +1239,7 @@ void UniStore::execute() {
|
||||
if(!missing) ScriptHelper::downloadFile(file, output, message);
|
||||
|
||||
} else if(type == "downloadRelease") {
|
||||
bool missing = false, includePrereleases = false;
|
||||
bool missing = false, includePrereleases = false, showVersions = false;
|
||||
std::string repo, file, output, message;
|
||||
if(appStoreJson.at("storeContent").at(Selection).at("script").at(i).contains("repo")) repo = appStoreJson.at("storeContent").at(Selection).at("script").at(i).at("repo");
|
||||
else missing = true;
|
||||
@@ -1249,8 +1249,10 @@ void UniStore::execute() {
|
||||
else missing = true;
|
||||
if(appStoreJson.at("storeContent").at(Selection).at("script").at(i).contains("includePrereleases") && appStoreJson.at("storeContent").at(Selection).at("script").at(i).at("includePrereleases").is_boolean())
|
||||
includePrereleases = appStoreJson.at(Selection).at("script").at(i).at("includePrereleases");
|
||||
if(appStoreJson.at("storeContent").at(Selection).at("script").at(i).contains("showVersions") && appStoreJson.at("storeContent").at(Selection).at("script").at(i).at("showVersions").is_boolean())
|
||||
showVersions = appStoreJson.at(Selection).at("script").at(i).at("showVersions");
|
||||
if(appStoreJson.at("storeContent").at(Selection).at("script").at(i).contains("message")) message = appStoreJson.at("storeContent").at(Selection).at("script").at(i).at("message");
|
||||
if(!missing) ScriptHelper::downloadRelease(repo, file, output, includePrereleases, message);
|
||||
if(!missing) ScriptHelper::downloadRelease(repo, file, output, includePrereleases, showVersions, message);
|
||||
|
||||
} else if(type == "extractFile") {
|
||||
bool missing = false;
|
||||
|
||||
Reference in New Issue
Block a user