From 21a8ac530a8bc315a2fdd7c6eb9bd93a4008fbaa Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Sat, 25 Oct 2025 14:34:42 +0100 Subject: [PATCH] Move credits to a HTML resource Signed-off-by: TheKodeToad --- launcher/resources/documents/credits.html | 41 ++++++++++++ launcher/resources/documents/documents.qrc | 1 + launcher/ui/dialogs/AboutDialog.cpp | 75 ++-------------------- 3 files changed, 47 insertions(+), 70 deletions(-) create mode 100644 launcher/resources/documents/credits.html diff --git a/launcher/resources/documents/credits.html b/launcher/resources/documents/credits.html new file mode 100644 index 000000000..7ff470a26 --- /dev/null +++ b/launcher/resources/documents/credits.html @@ -0,0 +1,41 @@ +
+

%1

+

Sefa Eyeoglu (Scrumplex) <Website>

+

d-513 <GitHub>

+

txtsd <Website>

+

timoreo <GitHub>

+

ZekeZ <GitHub>

+

cozyGalvinism <GitHub>

+

DioEgizio <GitHub>

+

flowln <GitHub>

+

ViRb3 <GitHub>

+

Rachel Powers (Ryex) <GitHub>

+

TayouVR <GitHub>

+

TheKodeToad <GitHub>

+

getchoo <GitHub>

+

Alexandru Tripon (Trial97) <GitHub>

+
+

%2

+

Andrew Okin <forkk@forkk.net>

+

Petr Mrázek <peterix@gmail.com>

+

Sky Welch <multimc@bunnies.io>

+

Jan (02JanDal) <02jandal@gmail.com>

+

RoboSky <@RoboSky_>

+
+

%3

+

Boba <Website>

+

AutiOne <Website>

+

Fulmine <Website>

+

ely <GitHub>

+

gon sawa <GitHub>

+

Pankakes

+

tobimori <GitHub>

+

Orochimarufan <orochimarufan.x3@gmail.com>

+

TakSuyu <taksuyu@gmail.com>

+

Kilobyte <stiepen22@gmx.de>

+

Rootbear75 <@rootbear75>

+

Zeker Zhayard <@Zeker_Zhayard>

+

Everyone who helped establish our branding!

+

And everyone else who contributed!

+
+
diff --git a/launcher/resources/documents/documents.qrc b/launcher/resources/documents/documents.qrc index 007efcde3..e1ee240ba 100644 --- a/launcher/resources/documents/documents.qrc +++ b/launcher/resources/documents/documents.qrc @@ -2,6 +2,7 @@ ../../../COPYING.md + credits.html diff --git a/launcher/ui/dialogs/AboutDialog.cpp b/launcher/ui/dialogs/AboutDialog.cpp index 0f3067719..786a739f5 100644 --- a/launcher/ui/dialogs/AboutDialog.cpp +++ b/launcher/ui/dialogs/AboutDialog.cpp @@ -45,80 +45,15 @@ #include namespace { -QString getLink(QString link, QString name) -{ - return QString("<%2>").arg(link).arg(name); -} - -QString getWebsite(QString link) -{ - return getLink(link, QObject::tr("Website")); -} - -QString getGitHub(QString username) -{ - return getLink("https://github.com/" + username, "GitHub"); -} - -// Credits -// This is a hack, but I can't think of a better way to do this easily without screwing with QTextDocument... QString getCreditsHtml() { - QString output; - QTextStream stream(&output); -#if QT_VERSION <= QT_VERSION_CHECK(6, 0, 0) - stream.setCodec(QTextCodec::codecForName("UTF-8")); -#endif - stream << "
\n"; + QFile dataFile(":/documents/credits.html"); + dataFile.open(QIODevice::ReadOnly); - //: %1 is the name of the launcher, determined at build time, e.g. "Prism Launcher Developers" - stream << "

" << QObject::tr("%1 Developers", "About Credits").arg(BuildConfig.LAUNCHER_DISPLAYNAME) << "

\n"; - stream << QString("

Sefa Eyeoglu (Scrumplex) %1

\n").arg(getWebsite("https://scrumplex.net")); - stream << QString("

d-513 %1

\n").arg(getGitHub("d-513")); - stream << QString("

txtsd %1

\n").arg(getWebsite("https://ihavea.quest")); - stream << QString("

timoreo %1

\n").arg(getGitHub("timoreo22")); - stream << QString("

ZekeZ %1

\n").arg(getGitHub("ZekeZDev")); - stream << QString("

cozyGalvinism %1

\n").arg(getGitHub("cozyGalvinism")); - stream << QString("

DioEgizio %1

\n").arg(getGitHub("DioEgizio")); - stream << QString("

flowln %1

\n").arg(getGitHub("flowln")); - stream << QString("

ViRb3 %1

\n").arg(getGitHub("ViRb3")); - stream << QString("

Rachel Powers (Ryex) %1

\n").arg(getGitHub("Ryex")); - stream << QString("

TayouVR %1

\n").arg(getGitHub("TayouVR")); - stream << QString("

TheKodeToad %1

\n").arg(getGitHub("TheKodeToad")); - stream << QString("

getchoo %1

\n").arg(getGitHub("getchoo")); - stream << QString("

Alexandru Tripon (Trial97) %1

\n").arg(getGitHub("Trial97")); - stream << "
\n"; + QString fileContent = QString::fromUtf8(dataFile.readAll()); - // TODO: possibly retrieve from git history at build time? - //: %1 is the name of the launcher, determined at build time, e.g. "Prism Launcher Developers" - stream << "

" << QObject::tr("%1 Developers", "About Credits").arg("MultiMC") << "

\n"; - stream << "

Andrew Okin <forkk@forkk.net>

\n"; - stream << QString("

Petr Mrázek <peterix@gmail.com>

\n"); - stream << "

Sky Welch <multimc@bunnies.io>

\n"; - stream << "

Jan (02JanDal) <02jandal@gmail.com>

\n"; - stream << "

RoboSky <@RoboSky_>

\n"; - stream << "
\n"; - - stream << "

" << QObject::tr("With thanks to", "About Credits") << "

\n"; - stream << QString("

Boba %1

\n").arg(getWebsite("https://bobaonline.neocities.org/")); - stream << QString("

AutiOne %1

\n").arg(getWebsite("https://auti.one/")); - stream << QString("

Fulmine %1

\n").arg(getWebsite("https://fulmine.xyz/")); - stream << QString("

ely %1

\n").arg(getGitHub("elyrodso")); - stream << QString("

gon sawa %1

\n").arg(getGitHub("gonsawa")); - stream << QString("

Pankakes

\n"); - stream << QString("

tobimori %1

\n").arg(getGitHub("tobimori")); - stream << "

Orochimarufan <orochimarufan.x3@gmail.com>

\n"; - stream << "

TakSuyu <taksuyu@gmail.com>

\n"; - stream << "

Kilobyte <stiepen22@gmx.de>

\n"; - stream << "

Rootbear75 <@rootbear75>

\n"; - stream << "

Zeker Zhayard <@Zeker_Zhayard>

\n"; - stream << "

Everyone who helped establish our branding!

\n"; - stream - << "

And everyone else who contributed!

\n"; - stream << "
\n"; - - stream << "
\n"; - return output; + return fileContent.arg(QObject::tr("%1 Developers").arg(BuildConfig.LAUNCHER_DISPLAYNAME), QObject::tr("MultiMC Developers"), + QObject::tr("With special thanks to")); } QString getLicenseHtml()