Technic: Include the modpack version in instance title

This commit is contained in:
Jamie Mansfield 2021-12-24 15:10:42 +00:00
parent f267375ac2
commit 9d88f07955
No known key found for this signature in database
GPG Key ID: 36F61598F39F67B0
2 changed files with 4 additions and 2 deletions

View File

@ -36,6 +36,7 @@ struct Modpack {
QString websiteUrl; QString websiteUrl;
QString author; QString author;
QString description; QString description;
QString currentVersion;
}; };
} }

View File

@ -189,6 +189,7 @@ void TechnicPage::suggestCurrent()
current.websiteUrl = Json::ensureString(obj, "platformUrl", QString(), "__placeholder__"); current.websiteUrl = Json::ensureString(obj, "platformUrl", QString(), "__placeholder__");
current.author = Json::ensureString(obj, "user", QString(), "__placeholder__"); current.author = Json::ensureString(obj, "user", QString(), "__placeholder__");
current.description = Json::ensureString(obj, "description", QString(), "__placeholder__"); current.description = Json::ensureString(obj, "description", QString(), "__placeholder__");
current.currentVersion = Json::ensureString(obj, "version", QString(), "__placeholder__");
current.metadataLoaded = true; current.metadataLoaded = true;
metadataLoaded(); metadataLoaded();
}); });
@ -214,11 +215,11 @@ void TechnicPage::metadataLoaded()
ui->frame->setModDescription(current.description); ui->frame->setModDescription(current.description);
if (!current.isSolder) if (!current.isSolder)
{ {
dialog->setSuggestedPack(current.name, new Technic::SingleZipPackInstallTask(current.url, current.minecraftVersion)); dialog->setSuggestedPack(current.name + " " + current.currentVersion, new Technic::SingleZipPackInstallTask(current.url, current.minecraftVersion));
} }
else else
{ {
while (current.url.endsWith('/')) current.url.chop(1); while (current.url.endsWith('/')) current.url.chop(1);
dialog->setSuggestedPack(current.name, new Technic::SolderPackInstallTask(APPLICATION->network(), current.url + "/modpack/" + current.slug, current.minecraftVersion)); dialog->setSuggestedPack(current.name + " " + current.currentVersion, new Technic::SolderPackInstallTask(APPLICATION->network(), current.url + "/modpack/" + current.slug, current.minecraftVersion));
} }
} }