mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-03 00:39:02 +00:00
Woops, fixes and defines. :P
This commit is contained in:
@@ -38,6 +38,7 @@ inline std::unique_ptr<Config> config;
|
|||||||
|
|
||||||
#define _STORE_PATH "sdmc:/3ds/Universal-Updater/stores/"
|
#define _STORE_PATH "sdmc:/3ds/Universal-Updater/stores/"
|
||||||
#define _META_PATH "sdmc:/3ds/Universal-Updater/MetaData.json"
|
#define _META_PATH "sdmc:/3ds/Universal-Updater/MetaData.json"
|
||||||
|
#define _UNISTORE_VERSION 3
|
||||||
inline uint32_t hRepeat, hDown, hHeld;
|
inline uint32_t hRepeat, hDown, hHeld;
|
||||||
inline touchPosition touch;
|
inline touchPosition touch;
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,20 @@ MainScreen::MainScreen() {
|
|||||||
} else {
|
} else {
|
||||||
notConnectedMsg();
|
notConnectedMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
const UniStoreInfo info = GetInfo("sdmc:/3ds/Universal-Updater/stores/universal-db.unistore", "universal-db.unistore");
|
||||||
|
|
||||||
|
if (info.Version != _UNISTORE_VERSION) {
|
||||||
|
if (checkWifiStatus()) {
|
||||||
|
std::string tmp = ""; // Just a temp.
|
||||||
|
DownloadUniStore("https://db.universal-team.net/unistore/universal-db.unistore", -1, tmp, true, true);
|
||||||
|
DownloadSpriteSheet("https://db.universal-team.net/unistore/universal-db.t3x", "universal-db.t3x");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
notConnectedMsg();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,11 +103,13 @@ void StoreUtils::GridLogic(std::unique_ptr<Store> &store, std::vector<std::uniqu
|
|||||||
if (store) { // Ensure, store is not a nullptr.
|
if (store) { // Ensure, store is not a nullptr.
|
||||||
if (hRepeat & KEY_DOWN) {
|
if (hRepeat & KEY_DOWN) {
|
||||||
if (store->GetBox() > 9) {
|
if (store->GetBox() > 9) {
|
||||||
if (store->GetEntry() + 5 < (int)entries.size()) {
|
if (store->GetEntry() + 5 < (int)entries.size() - 1) {
|
||||||
store->SetEntry(store->GetEntry() + 5);
|
store->SetEntry(store->GetEntry() + 5);
|
||||||
|
|
||||||
if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) {
|
if (entries.size() > 15) {
|
||||||
store->SetScreenIndx(store->GetScreenIndx() + 1);
|
if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) {
|
||||||
|
store->SetScreenIndx(store->GetScreenIndx() + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -115,8 +117,10 @@ void StoreUtils::GridLogic(std::unique_ptr<Store> &store, std::vector<std::uniqu
|
|||||||
store->SetEntry(entries.size() - 1);
|
store->SetEntry(entries.size() - 1);
|
||||||
store->SetBox(10 + (store->GetEntry() % 5));
|
store->SetBox(10 + (store->GetEntry() % 5));
|
||||||
|
|
||||||
if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) {
|
if (entries.size() > 15) {
|
||||||
store->SetScreenIndx(store->GetScreenIndx() + 1);
|
if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) {
|
||||||
|
store->SetScreenIndx(store->GetScreenIndx() + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ void StoreUtils::ListLogic(std::unique_ptr<Store> &store, std::vector<std::uniqu
|
|||||||
|
|
||||||
if (hRepeat & KEY_LEFT) {
|
if (hRepeat & KEY_LEFT) {
|
||||||
if (store->GetEntry() - 2 > 0) store->SetEntry(store->GetEntry() - 3);
|
if (store->GetEntry() - 2 > 0) store->SetEntry(store->GetEntry() - 3);
|
||||||
|
else store->SetEntry(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hRepeat & KEY_UP) {
|
if (hRepeat & KEY_UP) {
|
||||||
|
|||||||
@@ -219,9 +219,9 @@ void Store::LoadFromFile(const std::string &file) {
|
|||||||
/* Check, if valid. */
|
/* Check, if valid. */
|
||||||
if (this->storeJson.contains("storeInfo") && this->storeJson.contains("storeContent")) {
|
if (this->storeJson.contains("storeInfo") && this->storeJson.contains("storeContent")) {
|
||||||
if (this->storeJson["storeInfo"].contains("version") && this->storeJson["storeInfo"]["version"].is_number()) {
|
if (this->storeJson["storeInfo"].contains("version") && this->storeJson["storeInfo"]["version"].is_number()) {
|
||||||
if (this->storeJson["storeInfo"]["version"] < 3) Msg::waitMsg(Lang::get("UNISTORE_TOO_OLD"));
|
if (this->storeJson["storeInfo"]["version"] < _UNISTORE_VERSION) Msg::waitMsg(Lang::get("UNISTORE_TOO_OLD"));
|
||||||
else if (this->storeJson["storeInfo"]["version"] > 3) Msg::waitMsg(Lang::get("UNISTORE_TOO_NEW"));
|
else if (this->storeJson["storeInfo"]["version"] > _UNISTORE_VERSION) Msg::waitMsg(Lang::get("UNISTORE_TOO_NEW"));
|
||||||
this->valid = this->storeJson["storeInfo"]["version"] == 3;
|
this->valid = this->storeJson["storeInfo"]["version"] == _UNISTORE_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -582,9 +582,9 @@ bool DownloadUniStore(const std::string &URL, int currentRev, std::string &fl, b
|
|||||||
nlohmann::json parsedAPI = nlohmann::json::parse(result_buf);
|
nlohmann::json parsedAPI = nlohmann::json::parse(result_buf);
|
||||||
|
|
||||||
if (parsedAPI.contains("storeInfo") && parsedAPI.contains("storeContent")) {
|
if (parsedAPI.contains("storeInfo") && parsedAPI.contains("storeContent")) {
|
||||||
/* Ensure, version == 3. */
|
/* Ensure, version == _UNISTORE_VERSION. */
|
||||||
if (parsedAPI["storeInfo"].contains("version") && parsedAPI["storeInfo"]["version"].is_number()) {
|
if (parsedAPI["storeInfo"].contains("version") && parsedAPI["storeInfo"]["version"].is_number()) {
|
||||||
if (parsedAPI["storeInfo"]["version"] == 3) {
|
if (parsedAPI["storeInfo"]["version"] == _UNISTORE_VERSION) {
|
||||||
if (currentRev > -1) {
|
if (currentRev > -1) {
|
||||||
|
|
||||||
if (parsedAPI["storeInfo"].contains("revision") && parsedAPI["storeInfo"]["revision"].is_number()) {
|
if (parsedAPI["storeInfo"].contains("revision") && parsedAPI["storeInfo"]["revision"].is_number()) {
|
||||||
@@ -644,10 +644,10 @@ bool DownloadUniStore(const std::string &URL, int currentRev, std::string &fl, b
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (parsedAPI["storeInfo"]["version"] < 3) {
|
} else if (parsedAPI["storeInfo"]["version"] < _UNISTORE_VERSION) {
|
||||||
Msg::waitMsg(Lang::get("UNISTORE_TOO_OLD"));
|
Msg::waitMsg(Lang::get("UNISTORE_TOO_OLD"));
|
||||||
|
|
||||||
} else if (parsedAPI["storeInfo"]["version"] > 3) {
|
} else if (parsedAPI["storeInfo"]["version"] > _UNISTORE_VERSION) {
|
||||||
Msg::waitMsg(Lang::get("UNISTORE_TOO_NEW"));
|
Msg::waitMsg(Lang::get("UNISTORE_TOO_NEW"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user