diff options
author | flow <flowlnlnln@gmail.com> | 2022-05-24 09:46:58 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-05-24 09:46:58 -0300 |
commit | 22e0527502683a625c5963ec8155e07d9ec06d28 (patch) | |
tree | f3310ef89cd9dd6e0347818772dda460c8df4100 /launcher/ui | |
parent | ca3c6c5e8a5151ea50e51f09938b894e6a610626 (diff) | |
download | PrismLauncher-22e0527502683a625c5963ec8155e07d9ec06d28.tar.gz PrismLauncher-22e0527502683a625c5963ec8155e07d9ec06d28.tar.bz2 PrismLauncher-22e0527502683a625c5963ec8155e07d9ec06d28.zip |
feat: add donate info to modrinth modpacks
Diffstat (limited to 'launcher/ui')
-rw-r--r-- | launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp index 9bd24b57..f44d05f2 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp @@ -224,6 +224,18 @@ void ModrinthPage::updateUI() // TODO: Implement multiple authors with links text += "<br>" + tr(" by ") + QString("<a href=%1>%2</a>").arg(std::get<1>(current.author).toString(), std::get<0>(current.author)); + if(!current.extra.donate.isEmpty()) { + text += "<br><br>Donation information:<br>"; + auto donateToStr = [](Modrinth::DonationData& donate) -> QString { + return QString("<a href=\"%1\">%2</a>").arg(donate.url, donate.platform); + }; + QStringList donates; + for (auto& donate : current.extra.donate) { + donates.append(donateToStr(donate)); + } + text += donates.join(", "); + } + text += "<br>"; HoeDown h; |