made release type visible

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-10-21 18:48:55 +03:00
parent 9e85297f7a
commit 9aac8e389f
9 changed files with 38 additions and 10 deletions

View File

@ -47,6 +47,7 @@
#include "minecraft/mod/ModDetails.h"
#include "minecraft/mod/Resource.h"
#include "minecraft/mod/tasks/LocalModParseTask.h"
#include "modplatform/ModIndex.h"
static ModPlatform::ProviderCapabilities ProviderCaps;
@ -132,6 +133,13 @@ std::pair<int, bool> Mod::compare(const Resource& other, SortType type) const
return { compare_result, type == SortType::MC_VERSIONS };
break;
}
case SortType::RELEASE_TYPE: {
if (releaseType() > cast_other->releaseType())
return { 1, type == SortType::RELEASE_TYPE };
else if (releaseType() < cast_other->releaseType())
return { -1, type == SortType::RELEASE_TYPE };
break;
}
}
return { 0, false };
}
@ -262,6 +270,13 @@ auto Mod::side() const -> Metadata::ModSide
return Metadata::ModSide::UniversalSide;
}
auto Mod::releaseType() const -> ModPlatform::IndexedVersionType
{
if (metadata())
return metadata()->releaseType;
return ModPlatform::IndexedVersionType::VersionType::Unknown;
}
auto Mod::loaders() const -> ModPlatform::ModLoaderTypes
{
if (metadata())