remove credits from mod + constexpr VersionInfo + get loader version

This commit is contained in:
HJfod 2022-05-12 20:39:46 +03:00
parent e11de6cf18
commit 116473f233
3 changed files with 9 additions and 29 deletions

View file

@ -12,6 +12,7 @@
#include <utils/fs/filesystem.hpp>
#include <utils/json.hpp>
#include "Log.hpp"
#include <utils/VersionInfo.hpp>
class Geode;
@ -89,6 +90,9 @@ namespace geode {
public:
Loader();
virtual ~Loader();
VersionInfo getVersion() const;
std::string getVersionType() const;
Result<> saveSettings();
Result<> loadSettings();

View file

@ -42,25 +42,6 @@ namespace geode {
bool isUnresolved() const;
};
struct Credits {
struct Person {
std::string m_name;
std::string m_reason = "";
int m_gdAccountID = 0;
std::string m_gdAccountName = "";
std::unordered_map<std::string, std::string> m_links;
};
struct Library {
std::string m_name = "";
std::string m_repo = "";
};
std::vector<Person> m_people;
std::vector<std::string> m_thanks;
std::vector<Library> m_libraries;
};
/**
* Represents all the data gatherable
* from mod.json
@ -122,14 +103,6 @@ namespace geode {
* here; use `m_credits` instead.
*/
std::string m_details = "";
/**
* Free-form list of credits.
*/
std::string m_creditsString = "";
/**
* List of credits.
*/
Credits m_credits;
/**
* Git Repository of the mod.
*/
@ -319,7 +292,6 @@ namespace geode {
std::string getDeveloper() const;
std::string getDescription()const;
std::string getDetails() const;
std::string getCredits() const;
std::string getPath() const;
VersionInfo getVersion() const;
bool isEnabled() const;

View file

@ -29,7 +29,11 @@ namespace geode {
public:
VersionInfo() = delete;
VersionInfo(int major, int minor, int patch);
constexpr VersionInfo(int major, int minor, int patch) {
m_major = major;
m_minor = minor;
m_patch = patch;
}
VersionInfo(const char* versionString);
VersionInfo(std::string const& versionString);