removed flame consturctor
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
9acbf98f94
commit
5b7c5607a9
@ -32,23 +32,6 @@ static const QMap<QString, IndexedVersionType::VersionType> s_indexed_version_ty
|
|||||||
|
|
||||||
IndexedVersionType::IndexedVersionType(const QString& type) : IndexedVersionType(enumFromString(type)) {}
|
IndexedVersionType::IndexedVersionType(const QString& type) : IndexedVersionType(enumFromString(type)) {}
|
||||||
|
|
||||||
IndexedVersionType::IndexedVersionType(int flame_type)
|
|
||||||
{
|
|
||||||
switch (flame_type) {
|
|
||||||
case 1:
|
|
||||||
m_type = IndexedVersionType::VersionType::Release;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
m_type = IndexedVersionType::VersionType::Beta;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
m_type = IndexedVersionType::VersionType::Alpha;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
m_type = IndexedVersionType::VersionType::Unknown;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IndexedVersionType::IndexedVersionType(const IndexedVersionType::VersionType& type)
|
IndexedVersionType::IndexedVersionType(const IndexedVersionType::VersionType& type)
|
||||||
{
|
{
|
||||||
m_type = type;
|
m_type = type;
|
||||||
|
@ -62,7 +62,6 @@ struct DonationData {
|
|||||||
struct IndexedVersionType {
|
struct IndexedVersionType {
|
||||||
enum class VersionType { Release = 1, Beta, Alpha, Unknown };
|
enum class VersionType { Release = 1, Beta, Alpha, Unknown };
|
||||||
IndexedVersionType(const QString& type);
|
IndexedVersionType(const QString& type);
|
||||||
IndexedVersionType(int flame_type);
|
|
||||||
IndexedVersionType(const IndexedVersionType::VersionType& type);
|
IndexedVersionType(const IndexedVersionType::VersionType& type);
|
||||||
IndexedVersionType(const IndexedVersionType& type);
|
IndexedVersionType(const IndexedVersionType& type);
|
||||||
IndexedVersionType() : IndexedVersionType(IndexedVersionType::VersionType::Unknown) {}
|
IndexedVersionType() : IndexedVersionType(IndexedVersionType::VersionType::Unknown) {}
|
||||||
|
@ -139,7 +139,22 @@ auto FlameMod::loadIndexedPackVersion(QJsonObject& obj, bool load_changelog) ->
|
|||||||
file.version = Json::requireString(obj, "displayName");
|
file.version = Json::requireString(obj, "displayName");
|
||||||
file.downloadUrl = Json::ensureString(obj, "downloadUrl");
|
file.downloadUrl = Json::ensureString(obj, "downloadUrl");
|
||||||
file.fileName = Json::requireString(obj, "fileName");
|
file.fileName = Json::requireString(obj, "fileName");
|
||||||
file.version_type = ModPlatform::IndexedVersionType(Json::requireInteger(obj, "releaseType"));
|
|
||||||
|
ModPlatform::IndexedVersionType::VersionType ver_type;
|
||||||
|
switch (Json::requireInteger(obj, "releaseType")) {
|
||||||
|
case 1:
|
||||||
|
ver_type = ModPlatform::IndexedVersionType::VersionType::Release;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ver_type = ModPlatform::IndexedVersionType::VersionType::Beta;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ver_type = ModPlatform::IndexedVersionType::VersionType::Alpha;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ver_type = ModPlatform::IndexedVersionType::VersionType::Unknown;
|
||||||
|
}
|
||||||
|
file.version_type = ModPlatform::IndexedVersionType(ver_type);
|
||||||
|
|
||||||
auto hash_list = Json::ensureArray(obj, "hashes");
|
auto hash_list = Json::ensureArray(obj, "hashes");
|
||||||
for (auto h : hash_list) {
|
for (auto h : hash_list) {
|
||||||
|
@ -89,7 +89,22 @@ void Flame::loadIndexedPackVersions(Flame::IndexedPack& pack, QJsonArray& arr)
|
|||||||
// pick the latest version supported
|
// pick the latest version supported
|
||||||
file.mcVersion = versionArray[0].toString();
|
file.mcVersion = versionArray[0].toString();
|
||||||
file.version = Json::requireString(version, "displayName");
|
file.version = Json::requireString(version, "displayName");
|
||||||
file.version_type = ModPlatform::IndexedVersionType(Json::requireInteger(version, "releaseType"));
|
|
||||||
|
ModPlatform::IndexedVersionType::VersionType ver_type;
|
||||||
|
switch (Json::requireInteger(version, "releaseType")) {
|
||||||
|
case 1:
|
||||||
|
ver_type = ModPlatform::IndexedVersionType::VersionType::Release;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ver_type = ModPlatform::IndexedVersionType::VersionType::Beta;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ver_type = ModPlatform::IndexedVersionType::VersionType::Alpha;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ver_type = ModPlatform::IndexedVersionType::VersionType::Unknown;
|
||||||
|
}
|
||||||
|
file.version_type = ModPlatform::IndexedVersionType(ver_type);
|
||||||
file.downloadUrl = Json::ensureString(version, "downloadUrl");
|
file.downloadUrl = Json::ensureString(version, "downloadUrl");
|
||||||
|
|
||||||
// only add if we have a download URL (third party distribution is enabled)
|
// only add if we have a download URL (third party distribution is enabled)
|
||||||
|
Loading…
Reference in New Issue
Block a user