mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-06 16:49:11 +00:00
Add WiFi Checks for things, which need it.
For example by updating Stores or the store search download functions.
This commit is contained in:
+36
-24
@@ -450,25 +450,29 @@ void UniStore::StoreSelectionLogic(u32 hDown, u32 hHeld, touchPosition touch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((hDown & KEY_Y) || (hDown & KEY_TOUCH && touching(touch, arrowPos[5]))) {
|
if ((hDown & KEY_Y) || (hDown & KEY_TOUCH && touching(touch, arrowPos[5]))) {
|
||||||
if (Gui::promptMsg(Lang::get("WOULD_YOU_LIKE_UPDATE"))) {
|
if (checkWifiStatus() == true) {
|
||||||
if(storeInfo[selection].url != "" && storeInfo[selection].url != "MISSING: storeInfo.url" &&
|
if (Gui::promptMsg(Lang::get("WOULD_YOU_LIKE_UPDATE"))) {
|
||||||
storeInfo[selection].file != "" && storeInfo[selection].file != "MISSING: storeInfo.file") {
|
if(storeInfo[selection].url != "" && storeInfo[selection].url != "MISSING: storeInfo.url" &&
|
||||||
ScriptHelper::downloadFile(storeInfo[selection].url, storeInfo[selection].file, Lang::get("UPDATING"));
|
storeInfo[selection].file != "" && storeInfo[selection].file != "MISSING: storeInfo.file") {
|
||||||
}
|
ScriptHelper::downloadFile(storeInfo[selection].url, storeInfo[selection].file, Lang::get("UPDATING"));
|
||||||
if(storeInfo[selection].sheetURL != "" && storeInfo[selection].sheetURL != "MISSING: storeInfo.sheetURL" &&
|
}
|
||||||
storeInfo[selection].storeSheet != "" && storeInfo[selection].storeSheet != "MISSING: storeInfo.sheet") {
|
if(storeInfo[selection].sheetURL != "" && storeInfo[selection].sheetURL != "MISSING: storeInfo.sheetURL" &&
|
||||||
ScriptHelper::downloadFile(storeInfo[selection].sheetURL, storeInfo[selection].storeSheet, Lang::get("UPDATING"));
|
storeInfo[selection].storeSheet != "" && storeInfo[selection].storeSheet != "MISSING: storeInfo.sheet") {
|
||||||
}
|
ScriptHelper::downloadFile(storeInfo[selection].sheetURL, storeInfo[selection].storeSheet, Lang::get("UPDATING"));
|
||||||
// Refresh the list.
|
}
|
||||||
dirContents.clear();
|
// Refresh the list.
|
||||||
storeInfo.clear();
|
dirContents.clear();
|
||||||
chdir(Config::StorePath.c_str());
|
storeInfo.clear();
|
||||||
getDirectoryContents(dirContents, {"unistore"});
|
chdir(Config::StorePath.c_str());
|
||||||
for(uint i=0;i<dirContents.size();i++) {
|
getDirectoryContents(dirContents, {"unistore"});
|
||||||
storeInfo.push_back(parseStoreInfo(dirContents[i].name));
|
for(uint i=0;i<dirContents.size();i++) {
|
||||||
descript();
|
storeInfo.push_back(parseStoreInfo(dirContents[i].name));
|
||||||
loadStoreDesc();
|
descript();
|
||||||
|
loadStoreDesc();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
notConnectedMsg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -863,11 +867,15 @@ void UniStore::GitHubLogic(u32 hDown, u32 hHeld, touchPosition touch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hDown & KEY_TOUCH && touching(touch, GitHubPos[2])) {
|
if (hDown & KEY_TOUCH && touching(touch, GitHubPos[2])) {
|
||||||
std::string URL = "https://github.com/";
|
if (checkWifiStatus() == true) {
|
||||||
URL += OwnerAndRepo;
|
std::string URL = "https://github.com/";
|
||||||
URL += "/raw/master/unistore/";
|
URL += OwnerAndRepo;
|
||||||
URL += fileName;
|
URL += "/raw/master/unistore/";
|
||||||
ScriptHelper::downloadFile(URL, Config::StorePath + fileName, Lang::get("DOWNLOADING") + fileName);
|
URL += fileName;
|
||||||
|
ScriptHelper::downloadFile(URL, Config::StorePath + fileName, Lang::get("DOWNLOADING") + fileName);
|
||||||
|
} else {
|
||||||
|
notConnectedMsg();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((hDown & KEY_B) || (hDown & KEY_TOUCH && touching(touch, arrowPos[2]))) {
|
if ((hDown & KEY_B) || (hDown & KEY_TOUCH && touching(touch, arrowPos[2]))) {
|
||||||
@@ -912,7 +920,11 @@ void UniStore::FullURLLogic(u32 hDown, u32 hHeld, touchPosition touch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hDown & KEY_TOUCH && touching(touch, GitHubPos[2])) {
|
if (hDown & KEY_TOUCH && touching(touch, GitHubPos[2])) {
|
||||||
ScriptHelper::downloadFile(FullURL, Config::StorePath + fileName, Lang::get("DOWNLOADING") + fileName);
|
if (checkWifiStatus() == true) {
|
||||||
|
ScriptHelper::downloadFile(FullURL, Config::StorePath + fileName, Lang::get("DOWNLOADING") + fileName);
|
||||||
|
} else {
|
||||||
|
notConnectedMsg();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((hDown & KEY_B) || (hDown & KEY_TOUCH && touching(touch, arrowPos[2]))) {
|
if ((hDown & KEY_B) || (hDown & KEY_TOUCH && touching(touch, arrowPos[2]))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user