Universal-Updater -> DarkStore Part 2

Renamed Strings For DarkStore
Made .store Files Useable
This commit is contained in:
dark98
2021-09-09 16:23:22 +01:00
parent 76b41884c5
commit c894ff9924
61 changed files with 650 additions and 648 deletions
+3 -3
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_COMMON_HPP
#define _UNIVERSAL_UPDATER_COMMON_HPP
#ifndef _DARKSTORE_COMMON_HPP
#define _DARKSTORE_COMMON_HPP
#include "config.hpp"
#include "gfx.hpp"
@@ -38,7 +38,7 @@
#define _STORE_PATH "sdmc:/3ds/DarkStore/stores/"
#define _META_PATH "sdmc:/3ds/DarkStore/MetaData.json"
#define _THEME_AMOUNT 2
#define _UNISTORE_VERSION 4
#define _STORE_VERSION 4
inline std::unique_ptr<Config> config;
inline uint32_t hRepeat, hDown, hHeld;
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_GFX_HPP
#define _UNIVERSAL_UPDATER_GFX_HPP
#ifndef _DARKSTORE_GFX_HPP
#define _DARKSTORE_GFX_HPP
#include "common.hpp"
#include "sprites.h"
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_MSG_HPP
#define _UNIVERSAL_UPDATER_MSG_HPP
#ifndef _DARKSTORE_MSG_HPP
#define _DARKSTORE_MSG_HPP
#include <string>
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_INIT_HPP
#define _UNIVERSAL_UPDATER_INIT_HPP
#ifndef _DARKSTORE_INIT_HPP
#define _DARKSTORE_INIT_HPP
#include <3ds.h>
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_KEYBOARD_HPP
#define _UNIVERSAL_UPDATER_KEYBOARD_HPP
#ifndef _DARKSTORE_KEYBOARD_HPP
#define _DARKSTORE_KEYBOARD_HPP
#include "storeEntry.hpp"
#include <string>
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_OVERLAY_HPP
#define _UNIVERSAL_UPDATER_OVERLAY_HPP
#ifndef _DARKSTORE_OVERLAY_HPP
#define _DARKSTORE_OVERLAY_HPP
#include "common.hpp"
#include <3ds.h>
+2 -2
View File
@@ -50,8 +50,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_QR_CODE_HPP
#define _UNIVERSAL_UPDATER_QR_CODE_HPP
#ifndef _DARKSTORE_QR_CODE_HPP
#define _DARKSTORE_QR_CODE_HPP
#include "common.hpp"
#include "quirc.hpp"
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_MAIN_SCREEN_HPP
#define _UNIVERSAL_UPDATER_MAIN_SCREEN_HPP
#ifndef _DARKSTORE_MAIN_SCREEN_HPP
#define _DARKSTORE_MAIN_SCREEN_HPP
#include "common.hpp"
#include "store.hpp"
+17 -17
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_META_HPP
#define _UNIVERSAL_UPDATER_META_HPP
#ifndef _DARKSTORE_META_HPP
#define _DARKSTORE_META_HPP
#include "json.hpp"
#include <string>
@@ -44,22 +44,22 @@ public:
Meta();
~Meta() { this->SaveCall(); };
std::string GetUpdated(const std::string &unistoreName, const std::string &entry) const;
int GetMarks(const std::string &unistoreName, const std::string &entry) const;
bool UpdateAvailable(const std::string &unistoreName, const std::string &entry, const std::string &updated) const;
std::vector<std::string> GetInstalled(const std::string &unistoreName, const std::string &entry) const;
std::string GetUpdated(const std::string &storeName, const std::string &entry) const;
int GetMarks(const std::string &storeName, const std::string &entry) const;
bool UpdateAvailable(const std::string &storeName, const std::string &entry, const std::string &updated) const;
std::vector<std::string> GetInstalled(const std::string &storeName, const std::string &entry) const;
void SetUpdated(const std::string &unistoreName, const std::string &entry, const std::string &updated) {
this->metadataJson[unistoreName][entry]["updated"] = updated;
void SetUpdated(const std::string &storeName, const std::string &entry, const std::string &updated) {
this->metadataJson[storeName][entry]["updated"] = updated;
};
void SetMarks(const std::string &unistoreName, const std::string &entry, int marks) {
this->metadataJson[unistoreName][entry]["marks"] = marks;
void SetMarks(const std::string &storeName, const std::string &entry, int marks) {
this->metadataJson[storeName][entry]["marks"] = marks;
};
/* TODO: Handle this better. */
void SetInstalled(const std::string &unistoreName, const std::string &entry, const std::string &name) {
const std::vector<std::string> installs = this->GetInstalled(unistoreName, entry);
void SetInstalled(const std::string &storeName, const std::string &entry, const std::string &name) {
const std::vector<std::string> installs = this->GetInstalled(storeName, entry);
bool write = true;
if (!installs.empty()) {
@@ -73,22 +73,22 @@ public:
}
}
if (write) this->metadataJson[unistoreName][entry]["installed"] += name;
if (write) this->metadataJson[storeName][entry]["installed"] += name;
}
/* Remove installed state from a download list entry. */
void RemoveInstalled(const std::string &unistoreName, const std::string &entry, const std::string &name) {
const std::vector<std::string> installs = this->GetInstalled(unistoreName, entry);
void RemoveInstalled(const std::string &storeName, const std::string &entry, const std::string &name) {
const std::vector<std::string> installs = this->GetInstalled(storeName, entry);
if (installs.empty()) return;
for (int i = 0; i < (int)installs.size(); i++) {
if (installs[i] == name) {
this->metadataJson[unistoreName][entry]["installed"].erase(i);
this->metadataJson[storeName][entry]["installed"].erase(i);
break;
}
}
if (this->metadataJson[unistoreName][entry]["installed"].empty() && this->metadataJson[unistoreName][entry].contains("updated")) this->metadataJson[unistoreName][entry].erase("updated");
if (this->metadataJson[storeName][entry]["installed"].empty() && this->metadataJson[storeName][entry].contains("updated")) this->metadataJson[storeName][entry].erase("updated");
}
void ImportMetadata();
+7 -7
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_STORE_HPP
#define _UNIVERSAL_UPDATER_STORE_HPP
#ifndef _DARKSTORE_STORE_HPP
#define _DARKSTORE_STORE_HPP
#include "json.hpp"
#include <citro2d.h>
@@ -40,11 +40,11 @@ public:
void unloadSheets();
void update(const std::string &file);
/* Get Information of the UniStore itself. */
std::string GetUniStoreTitle() const;
std::string GetUniStoreAuthor() const;
/* Get Information of the Store itself. */
std::string GetStoreTitle() const;
std::string GetStoreAuthor() const;
/* Get Information of the UniStore entries. */
/* Get Information of the SStore entries. */
std::string GetTitleEntry(int index) const;
std::string GetAuthorEntry(int index) const;
std::string GetDescriptionEntry(int index) const;
@@ -85,7 +85,7 @@ public:
C2D_Image GetStoreImg() const { return this->storeBG; };
bool customBG() const { return this->hasCustomBG; };
/* Return filename of the UniStore. */
/* Return filename of the Store. */
std::string GetFileName() const { return this->fileName; };
private:
void SetC2DBGImage();
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_STORE_ENTRY_HPP
#define _UNIVERSAL_UPDATER_STORE_ENTRY_HPP
#ifndef _DARKSTORE_STORE_ENTRY_HPP
#define _DARKSTORE_STORE_ENTRY_HPP
#include "meta.hpp"
#include "store.hpp"
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_STORE_UTILS_HPP
#define _UNIVERSAL_UPDATER_STORE_UTILS_HPP
#ifndef _DARKSTORE_STORE_UTILS_HPP
#define _DARKSTORE_STORE_UTILS_HPP
#include "meta.hpp"
#include "store.hpp"
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_ANIMATION_HPP
#define _UNIVERSAL_UPDATER_ANIMATION_HPP
#ifndef _DARKSTORE_ANIMATION_HPP
#define _DARKSTORE_ANIMATION_HPP
#include <3ds.h>
#include <string>
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_ARGUMENT_PARSER_HPP
#define _UNIVERSAL_UPDATER_ARGUMENT_PARSER_HPP
#ifndef _DARKSTORE_ARGUMENT_PARSER_HPP
#define _DARKSTORE_ARGUMENT_PARSER_HPP
#include "json.hpp"
#include "store.hpp"
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_CIA_HPP
#define _UNIVERSAL_UPDATER_CIA_HPP
#ifndef _DARKSTORE_CIA_HPP
#define _DARKSTORE_CIA_HPP
#include "common.hpp"
+4 -4
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_CONFIG_HPP
#define _UNIVERSAL_UPDATER_CONFIG_HPP
#ifndef _DARKSTORE_CONFIG_HPP
#define _DARKSTORE_CONFIG_HPP
#include "json.hpp"
@@ -74,11 +74,11 @@ public:
bool metadata() const { return this->v_metadata; };
void metadata(bool v) { this->v_metadata = v; if (!this->changesMade) this->changesMade = true; };
/* U-U Update check on startup. */
/* DarkStore Update check on startup. */
bool updatecheck() const { return this->v_updateCheck; };
void updatecheck(bool v) { this->v_updateCheck = v; if (!this->changesMade) this->changesMade = true; };
/* U-U Update check on startup. */
/* DarkStore Update check on startup. */
bool usebg() const { return this->v_showBg; };
void usebg(bool v) { this->v_showBg = v; if (!this->changesMade) this->changesMade = true; };
+5 -5
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_DOWNLOAD_HPP
#define _UNIVERSAL_UPDATER_DOWNLOAD_HPP
#ifndef _DARKSTORE_DOWNLOAD_HPP
#define _DARKSTORE_DOWNLOAD_HPP
#include "common.hpp"
@@ -48,7 +48,7 @@ struct StoreList {
std::string Description;
};
struct UUUpdate {
struct DSUpdate {
bool Available = false;
std::string Notes = "";
std::string Version = "";
@@ -79,9 +79,9 @@ void notImplemented(void);
void doneMsg(void);
bool IsUpdateAvailable(const std::string &URL, int revCurrent);
bool DownloadUniStore(const std::string &URL, int currentRev, std::string &fl, bool isDownload = false, bool isUDB = false);
bool DownloadStore(const std::string &URL, int currentRev, std::string &fl, bool isDownload = false, bool isDS = false);
bool DownloadSpriteSheet(const std::string &URL, const std::string &file);
UUUpdate IsUUUpdateAvailable();
DSUpdate IsDSUpdateAvailable();
void UpdateAction();
std::vector<StoreList> FetchStores();
C2D_Image FetchScreenshot(const std::string &URL);
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_EXTRACT_HPP
#define _UNIVERSAL_UPDATER_EXTRACT_HPP
#ifndef _DARKSTORE_EXTRACT_HPP
#define _DARKSTORE_EXTRACT_HPP
#include "common.hpp"
+5 -5
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_FILE_BROWSE_HPP
#define _UNIVERSAL_UPDATER_FILE_BROWSE_HPP
#ifndef _DARKSTORE_FILE_BROWSE_HPP
#define _DARKSTORE_FILE_BROWSE_HPP
#include <dirent.h>
#include <string>
@@ -39,9 +39,9 @@ struct DirEntry {
};
/*
UniStore Info struct.
Store Info struct.
*/
struct UniStoreInfo {
struct StoreInfo {
std::string Title;
std::string Author;
std::string URL;
@@ -57,7 +57,7 @@ bool nameEndsWith(const std::string &name, const std::vector<std::string> &exten
void getDirectoryContents(std::vector<DirEntry> &dirContents, const std::vector<std::string> &extensionList);
void getDirectoryContents(std::vector<DirEntry> &dirContents);
std::vector<UniStoreInfo> GetUniStoreInfo(const std::string &path);
std::vector<StoreInfo> GetStoreInfo(const std::string &path);
void dirCopy(DirEntry *entry, const char *destinationPath, const char *sourcePath);
int fcopy(const char *sourcePath, const char *destinationPath);
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_FILES_HPP
#define _UNIVERSAL_UPDATER_FILES_HPP
#ifndef _DARKSTORE_FILES_HPP
#define _DARKSTORE_FILES_HPP
#include "common.hpp"
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_LANG_HPP
#define _UNIVERSAL_UPDATER_LANG_HPP
#ifndef _DARKSTORE_LANG_HPP
#define _DARKSTORE_LANG_HPP
#include "json.hpp"
#include <string>
+4 -4
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_QUEUE_SYSTEM_HPP
#define _UNIVERSAL_UPDATER_QUEUE_SYSTEM_HPP
#ifndef _DARKSTORE_QUEUE_SYSTEM_HPP
#define _DARKSTORE_QUEUE_SYSTEM_HPP
#include "json.hpp"
#include <citro2d.h>
@@ -70,13 +70,13 @@ namespace QueueSystem {
class Queue {
public:
Queue(nlohmann::json object, const C2D_Image &img, const std::string &name, const std::string &uName, const std::string &eName, const std::string &lUpdated) :
obj(object), icn(img), total(object.size()), current(QueueSystem::LastElement), name(name), unistoreName(uName), entryName(eName), lastUpdated(lUpdated) { };
obj(object), icn(img), total(object.size()), current(QueueSystem::LastElement), name(name), storeName(uName), entryName(eName), lastUpdated(lUpdated) { };
QueueStatus status = QueueStatus::None;
nlohmann::json obj;
C2D_Image icn;
int total, current;
std::string name = "", unistoreName = "", entryName = "", lastUpdated = "";
std::string name = "", storeName = "", entryName = "", lastUpdated = "";
};
#endif
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_SCREENSHOT_HPP
#define _UNIVERSAL_UPDATER_SCREENSHOT_HPP
#ifndef _DARKSTORE_SCREENSHOT_HPP
#define _DARKSTORE_SCREENSHOT_HPP
#include <citro2d.h>
#include <string>
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_SCRIPT_UTILS_HPP
#define _UNIVERSAL_UPDATER_SCRIPT_UTILS_HPP
#ifndef _DARKSTORE_SCRIPT_UTILS_HPP
#define _DARKSTORE_SCRIPT_UTILS_HPP
#include "json.hpp"
#include <3ds.h>
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_SOUND_HPP
#define _UNIVERSAL_UPDATER_SOUND_HPP
#ifndef _DARKSTORE_SOUND_HPP
#define _DARKSTORE_SOUND_HPP
#include <3ds.h>
#include <string>
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_STRING_UTILS_HPP
#define _UNIVERSAL_UPDATER_STRING_UTILS_HPP
#ifndef _DARKSTORE_STRING_UTILS_HPP
#define _DARKSTORE_STRING_UTILS_HPP
#include "meta.hpp"
#include <string>
+2 -2
View File
@@ -24,8 +24,8 @@
* reasonable ways as different from the original version.
*/
#ifndef _UNIVERSAL_UPDATER_THEME_HPP
#define _UNIVERSAL_UPDATER_THEME_HPP
#ifndef _DARKSTORE_THEME_HPP
#define _DARKSTORE_THEME_HPP
#include "json.hpp"
#include <citro2d.h>