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
+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"