diff options
author | flow <flowlnlnln@gmail.com> | 2022-05-24 11:58:11 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-05-24 11:58:11 -0300 |
commit | ae2ef324f297adee33968b50e70d9cf5d8ed72fb (patch) | |
tree | 0443a66c186ac4e0f039cf4e8fe1510972b2a378 /launcher/ui/pages/modplatform | |
parent | d0337da8ea54c272aadfe30bfe0474ae82011109 (diff) | |
download | PrismLauncher-ae2ef324f297adee33968b50e70d9cf5d8ed72fb.tar.gz PrismLauncher-ae2ef324f297adee33968b50e70d9cf5d8ed72fb.tar.bz2 PrismLauncher-ae2ef324f297adee33968b50e70d9cf5d8ed72fb.zip |
feat: add remaining links to modrinth mods
Diffstat (limited to 'launcher/ui/pages/modplatform')
-rw-r--r-- | launcher/ui/pages/modplatform/ModPage.cpp | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp index 39e47edc..e0251160 100644 --- a/launcher/ui/pages/modplatform/ModPage.cpp +++ b/launcher/ui/pages/modplatform/ModPage.cpp @@ -215,19 +215,38 @@ void ModPage::updateUi() text += "<br>" + tr(" by ") + authorStrs.join(", "); } - if(!current.extraData.donate.isEmpty()) { - text += tr("<br><br>Donate information:<br>"); - auto donateToStr = [](ModPlatform::DonationData& donate) -> QString { - return QString("<a href=\"%1\">%2</a>").arg(donate.url, donate.platform); - }; - QStringList donates; - for (auto& donate : current.extraData.donate) { - donates.append(donateToStr(donate)); + + if(current.extraDataLoaded) { + if (!current.extraData.donate.isEmpty()) { + text += "<br><br>" + tr("Donate information: "); + auto donateToStr = [](ModPlatform::DonationData& donate) -> QString { + return QString("<a href=\"%1\">%2</a>").arg(donate.url, donate.platform); + }; + QStringList donates; + for (auto& donate : current.extraData.donate) { + donates.append(donateToStr(donate)); + } + text += donates.join(", "); } - text += donates.join(", "); + + if (!current.extraData.issuesUrl.isEmpty() + || !current.extraData.sourceUrl.isEmpty() + || !current.extraData.wikiUrl.isEmpty() + || !current.extraData.discordUrl.isEmpty()) { + text += "<br><br>" + tr("External links:") + "<br>"; + } + + if (!current.extraData.issuesUrl.isEmpty()) + text += "- " + tr("Issues: <a href=%1>%1</a>").arg(current.extraData.issuesUrl) + "<br>"; + if (!current.extraData.wikiUrl.isEmpty()) + text += "- " + tr("Wiki: <a href=%1>%1</a>").arg(current.extraData.wikiUrl) + "<br>"; + if (!current.extraData.sourceUrl.isEmpty()) + text += "- " + tr("Source code: <a href=%1>%1</a>").arg(current.extraData.sourceUrl) + "<br>"; + if (!current.extraData.discordUrl.isEmpty()) + text += "- " + tr("Discord: <a href=%1>%1</a>").arg(current.extraData.discordUrl) + "<br>"; } - text += "<br><br>"; + text += "<hr>"; ui->packDescription->setHtml(text + current.description); } |