More intuitive version changing for modpacks

Signed-off-by: Yihe Li <winmikedows@hotmail.com>
This commit is contained in:
Yihe Li
2025-06-05 20:20:14 +08:00
parent 0136c2e82a
commit 58a28f319a
7 changed files with 30 additions and 22 deletions

View File

@@ -140,3 +140,11 @@ void Flame::loadIndexedPackVersions(Flame::IndexedPack& pack, QJsonArray& arr)
pack.versions = unsortedVersions;
pack.versionsLoaded = true;
}
auto Flame::getVersionDisplayString(const IndexedVersion& version) -> QString
{
auto release_type = version.version_type.isValid() ? QString(" [%1]").arg(version.version_type.toString()) : "";
auto mcVersion =
!version.mcVersion.isEmpty() && !version.version.contains(version.mcVersion) ? QObject::tr(" for %1").arg(version.mcVersion) : "";
return QString("%1%2%3").arg(version.version, mcVersion, release_type);
}