More intuitive version changing for modpacks (#3841)

This commit is contained in:
Alexandru Ionut Tripon 2025-06-06 08:12:52 +03:00 committed by GitHub
commit 2d90144cd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 30 additions and 22 deletions

View file

@ -244,14 +244,8 @@ void ModrinthPage::onSelectionChanged(QModelIndex curr, [[maybe_unused]] QModelI
else
++it;
#endif
for (auto version : current.versions) {
auto release_type = version.version_type.isValid() ? QString(" [%1]").arg(version.version_type.toString()) : "";
auto mcVersion = !version.gameVersion.isEmpty() && !version.name.contains(version.gameVersion)
? QString(" for %1").arg(version.gameVersion)
: "";
auto versionStr = !version.name.contains(version.version) ? version.version : "";
ui->versionSelectionBox->addItem(QString("%1%2 — %3%4").arg(version.name, mcVersion, versionStr, release_type),
QVariant(version.id));
for (const auto& version : current.versions) {
ui->versionSelectionBox->addItem(Modrinth::getVersionDisplayString(version), QVariant(version.id));
}
QVariant current_updated;