mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-02 16:49:05 +00:00
Add nightly/prerelease warnings
This commit is contained in:
@@ -51,7 +51,7 @@ public:
|
||||
void Draw(void) const override;
|
||||
void Logic(u32 hDown, u32 hHeld, touchPosition touch) override;
|
||||
private:
|
||||
std::vector<std::string> dwnldList, dwnldSizes;
|
||||
std::vector<std::string> dwnldList, dwnldSizes, dwnldTypes;
|
||||
|
||||
bool initialized = false, fetchDown = false, showMarks = false, showSettings = false,
|
||||
ascending = false, updateFilter = false, screenshotFetch = false, canDisplay = false, isAND = true;
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
std::string GetLicenseEntry(int index) const;
|
||||
C2D_Image GetIconEntry(int index) const;
|
||||
std::string GetFileSizes(int index, const std::string &entry) const;
|
||||
std::string GetFileTypes(int index, const std::string &entry) const;
|
||||
std::vector<std::string> GetScreenshotList(int index) const;
|
||||
std::vector<std::string> GetScreenshotNames(int index) const;
|
||||
std::string GetReleaseNotes(int index) const;
|
||||
|
||||
@@ -53,6 +53,7 @@ public:
|
||||
std::vector<std::string> GetCategoryFull() const { return this->FullCategory; };
|
||||
std::vector<std::string> GetConsoleFull() const { return this->FullConsole; };
|
||||
std::vector<std::string> GetSizes() const { return this->Sizes; };
|
||||
std::vector<std::string> GetTypes() const { return this->Types; };
|
||||
std::vector<std::string> GetScreenshots() const { return this->Screenshots; };
|
||||
std::vector<std::string> GetScreenshotNames() const { return this->ScreenshotNames; };
|
||||
std::string GetReleaseNotes() const { return this->ReleaseNotes; };
|
||||
@@ -69,7 +70,7 @@ private:
|
||||
std::string Title, Author, Description, Category, Version, Console, LastUpdated, License, MarkString, ReleaseNotes;
|
||||
C2D_Image Icon;
|
||||
int SheetIndex, EntryIndex, Marks;
|
||||
std::vector<std::string> FullCategory, FullConsole, Sizes, Screenshots, ScreenshotNames;
|
||||
std::vector<std::string> FullCategory, FullConsole, Sizes, Types, Screenshots, ScreenshotNames;
|
||||
bool UpdateAvailable;
|
||||
};
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace StoreUtils {
|
||||
|
||||
/* Download entries. */
|
||||
void DrawDownList(const std::vector<std::string> &entries, bool fetch, const std::unique_ptr<StoreEntry> &entry, const std::vector<std::string> &sizes, const std::vector<bool> &installs);
|
||||
void DownloadHandle(const std::unique_ptr<StoreEntry> &entry, const std::vector<std::string> &entries, int ¤tMenu, const int &lastMode, int &smallDelay, std::vector<bool> &installs);
|
||||
void DownloadHandle(const std::unique_ptr<StoreEntry> &entry, const std::vector<std::string> &entries, int ¤tMenu, const int &lastMode, int &smallDelay, std::vector<bool> &installs, const std::vector<std::string> &types);
|
||||
|
||||
/* Queue System. */
|
||||
void DrawQueueMenu(const int queueIndex);
|
||||
|
||||
@@ -66,6 +66,8 @@
|
||||
"ENTRIES": "Entries",
|
||||
"EXECUTE_ENTRY": "Would you like to execute this entry?",
|
||||
"EXIT_APP": "Exit DarkStore",
|
||||
"NOTE_NIGHTLY": "Note: \"Nightly\" versions are intended for testing\nupcoming features and may be unstable.\n\nIf you simply want to install,\nplease cancel and install the normal version.",
|
||||
"NOTE_PRERELEASE": "Note: This is a prerelease build and may be unstable.\n\nIf you simply want to install, you may\nwant to install the normal version if one exists.",
|
||||
"EXTRACTING": "Extracting... %s / %s (%.2f%%)",
|
||||
"EXTRACT_ERROR": "Extract error!",
|
||||
"FEATURE_SIDE_EFFECTS": "This Feature may have side effects while the Queue is running.\nAre you sure you want to continue?",
|
||||
@@ -142,4 +144,4 @@
|
||||
"UPDATING_SPRITE_SHEET2": "Updating Spritesheet %i of %i...",
|
||||
"UPDATING_STORE": "Updating Store...",
|
||||
"VERSION": "Version"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ void StoreUtils::DrawDownList(const std::vector<std::string> &entries, bool fetc
|
||||
int &smallDelay: Reference to the small delay. This helps to not directly press A.
|
||||
std::vector<bool> &installs: Reference to the installed states.
|
||||
*/
|
||||
void StoreUtils::DownloadHandle(const std::unique_ptr<StoreEntry> &entry, const std::vector<std::string> &entries, int ¤tMenu, const int &lastMode, int &smallDelay, std::vector<bool> &installs) {
|
||||
void StoreUtils::DownloadHandle(const std::unique_ptr<StoreEntry> &entry, const std::vector<std::string> &entries, int ¤tMenu, const int &lastMode, int &smallDelay, std::vector<bool> &installs, const std::vector<std::string> &types) {
|
||||
if (StoreUtils::store && entry) { // Ensure, store & entry is not a nullptr.
|
||||
if (smallDelay > 0) {
|
||||
smallDelay--;
|
||||
@@ -212,7 +212,10 @@ void StoreUtils::DownloadHandle(const std::unique_ptr<StoreEntry> &entry, const
|
||||
for (int i = 0; i < DOWNLOAD_ENTRIES; i++) {
|
||||
if (touching(touch, downloadBoxes[i])) {
|
||||
if (i + StoreUtils::store->GetDownloadSIndex() < (int)entries.size()) {
|
||||
if (Msg::promptMsg(Lang::get("EXECUTE_ENTRY") + "\n\n" + entries[i + StoreUtils::store->GetDownloadSIndex()])) {
|
||||
std::string Msg = Lang::get("EXECUTE_ENTRY") + "\n\n" + entries[i + StoreUtils::store->GetDownloadSIndex()];
|
||||
if (types[i + StoreUtils::store->GetDownloadSIndex()] == "nightly") Msg += "\n\n" + Lang::get("NOTE_NIGHTLY");
|
||||
else if (types[i + StoreUtils::store->GetDownloadSIndex()] == "prerelease") Msg += "\n\n" + Lang::get("NOTE_PRERELEASE");
|
||||
if (Msg::promptMsg(Msg)) {
|
||||
StoreUtils::AddToQueue(entry->GetEntryIndex(), entries[i + StoreUtils::store->GetDownloadSIndex()], entry->GetTitle(), entry->GetLastUpdated());
|
||||
}
|
||||
}
|
||||
@@ -234,7 +237,10 @@ void StoreUtils::DownloadHandle(const std::unique_ptr<StoreEntry> &entry, const
|
||||
}
|
||||
|
||||
if (smallDelay == 0 && hDown & KEY_A && !entries.empty()) {
|
||||
if (Msg::promptMsg(Lang::get("EXECUTE_ENTRY") + "\n\n" + entries[StoreUtils::store->GetDownloadIndex()])) {
|
||||
std::string Msg = Lang::get("EXECUTE_ENTRY") + "\n\n" + entries[StoreUtils::store->GetDownloadIndex()];
|
||||
if (types[StoreUtils::store->GetDownloadIndex()] == "nightly") Msg += "\n\n" + Lang::get("NOTE_NIGHTLY");
|
||||
else if (types[StoreUtils::store->GetDownloadIndex()] == "prerelease") Msg += "\n\n" + Lang::get("NOTE_PRERELEASE");
|
||||
if (Msg::promptMsg(Msg)) {
|
||||
StoreUtils::AddToQueue(entry->GetEntryIndex(), entries[StoreUtils::store->GetDownloadIndex()], entry->GetTitle(), entry->GetLastUpdated());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,6 +235,7 @@ void MainScreen::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
this->installs.clear();
|
||||
this->dwnldList.clear();
|
||||
this->dwnldSizes.clear();
|
||||
this->dwnldTypes.clear();
|
||||
|
||||
if (StoreUtils::store && StoreUtils::store->GetValid()) {
|
||||
const std::vector<std::string> installedNames = StoreUtils::meta->GetInstalled(StoreUtils::store->GetStoreTitle(), StoreUtils::entries[StoreUtils::store->GetEntry()]->GetTitle());
|
||||
@@ -244,6 +245,7 @@ void MainScreen::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
if ((int)StoreUtils::entries.size() > StoreUtils::store->GetEntry()) {
|
||||
this->dwnldList = StoreUtils::store->GetDownloadList(StoreUtils::entries[StoreUtils::store->GetEntry()]->GetEntryIndex());
|
||||
this->dwnldSizes = StoreUtils::entries[StoreUtils::store->GetEntry()]->GetSizes();
|
||||
this->dwnldTypes = StoreUtils::entries[StoreUtils::store->GetEntry()]->GetTypes();
|
||||
|
||||
for (int i = 0; i < (int)this->dwnldList.size(); i++) {
|
||||
bool good = false;
|
||||
@@ -269,7 +271,7 @@ void MainScreen::Logic(u32 hDown, u32 hHeld, touchPosition touch) {
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (StoreUtils::store && StoreUtils::store->GetValid() && StoreUtils::entries.size() > 0) StoreUtils::DownloadHandle(StoreUtils::entries[StoreUtils::store->GetEntry()], this->dwnldList, storeMode, this->lastMode, this->smallDelay, this->installs);
|
||||
if (StoreUtils::store && StoreUtils::store->GetValid() && StoreUtils::entries.size() > 0) StoreUtils::DownloadHandle(StoreUtils::entries[StoreUtils::store->GetEntry()], this->dwnldList, storeMode, this->lastMode, this->smallDelay, this->installs, this->dwnldTypes);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
||||
@@ -506,6 +506,26 @@ std::string Store::GetFileSizes(int index, const std::string &entry) const {
|
||||
return "";
|
||||
}
|
||||
|
||||
/*
|
||||
Get file script type for each download entry.
|
||||
|
||||
int index: The index.
|
||||
const std::string &entry: The entry name.
|
||||
*/
|
||||
std::string Store::GetFileTypes(int index, const std::string &entry) const {
|
||||
if (!this->valid) return "";
|
||||
|
||||
if (index > (int)this->storeJson["storeContent"].size() - 1) return "";
|
||||
|
||||
if (this->storeJson["storeContent"][index].contains(entry) && this->storeJson["storeContent"][index][entry].type() == nlohmann::json::value_t::object) {
|
||||
if (this->storeJson["storeContent"][index][entry].contains("type") && this->storeJson["storeContent"][index][entry]["type"].is_string()) {
|
||||
return this->storeJson["storeContent"][index][entry]["type"];
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/*
|
||||
Get Screenshot URL list.
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ StoreEntry::StoreEntry(const std::unique_ptr<Store> &store, const std::unique_pt
|
||||
if (!entries.empty()) {
|
||||
for (int i = 0; i < (int)entries.size(); i++) {
|
||||
this->Sizes.push_back( store->GetFileSizes(index, entries[i]) );
|
||||
this->Types.push_back( store->GetFileTypes(index, entries[i]) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user