feat: add (current) indicator to the currently installed version in MR
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
cba2608c1c
commit
1c567232e3
@ -127,10 +127,19 @@ void ModrinthManagedPackPage::parseManagedPack()
|
||||
}
|
||||
|
||||
for (auto version : m_pack.versions) {
|
||||
QString name;
|
||||
|
||||
if (!version.name.contains(version.version))
|
||||
ui->versionsComboBox->addItem(QString("%1 — %2").arg(version.name, version.version), QVariant(version.id));
|
||||
name = QString("%1 — %2").arg(version.name, version.version);
|
||||
else
|
||||
ui->versionsComboBox->addItem(version.name, QVariant(version.id));
|
||||
name = version.name;
|
||||
|
||||
// NOTE: the id from version isn't the same id in the modpack format spec...
|
||||
// e.g. HexMC's 4.4.0 has versionId 4.0.0 in the modpack index..............
|
||||
if (version.version == m_inst->getManagedPackVersionName())
|
||||
name.append(tr(" (Current)"));
|
||||
|
||||
ui->versionsComboBox->addItem(name, QVariant(version.id));
|
||||
}
|
||||
|
||||
suggestVersion();
|
||||
|
Loading…
Reference in New Issue
Block a user