diff --git a/CMakeLists.txt b/CMakeLists.txt index ddc0956e..c723b04c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,6 +108,9 @@ set(Launcher_DISCORD_URL "" CACHE STRING "URL for the Discord guild.") # Subreddit URL set(Launcher_SUBREDDIT_URL "" CACHE STRING "URL for the subreddit.") +# Patreon URL +set(Launcher_PATREON_URL "" CACHE STRING "URL for the patreon.") + # Use the secrets library or a public stub? option(Launcher_EMBED_SECRETS "Determines whether to embed secrets. Secrets are separate and non-public." OFF) diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 8c04dd4d..3f970a7b 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -50,6 +50,7 @@ Config::Config() BUG_TRACKER_URL = "@Launcher_BUG_TRACKER_URL@"; DISCORD_URL = "@Launcher_DISCORD_URL@"; SUBREDDIT_URL = "@Launcher_SUBREDDIT_URL@"; + PATREON_URL = "@Launcher_PATREON_URL@"; } QString Config::printableVersionString() const diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index 7ab5b100..ab523770 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -88,6 +88,7 @@ public: QString BUG_TRACKER_URL; QString DISCORD_URL; QString SUBREDDIT_URL; + QString PATREON_URL; QString RESOURCE_BASE = "https://resources.download.minecraft.net/"; QString LIBRARY_BASE = "https://libraries.minecraft.net/"; diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 0a747734..77cd4de4 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -403,13 +403,16 @@ public: mainToolBar->addSeparator(); - actionPatreon = TranslatedAction(MainWindow); - actionPatreon->setObjectName(QStringLiteral("actionPatreon")); - actionPatreon->setIcon(APPLICATION->getThemedIcon("patreon")); - actionPatreon.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Support %1")); - actionPatreon.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the %1 Patreon page.")); - all_actions.append(&actionPatreon); - mainToolBar->addAction(actionPatreon); + if (!BuildConfig.PATREON_URL.isEmpty()) + { + actionPatreon = TranslatedAction(MainWindow); + actionPatreon->setObjectName(QStringLiteral("actionPatreon")); + actionPatreon->setIcon(APPLICATION->getThemedIcon("patreon")); + actionPatreon.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Support %1")); + actionPatreon.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the %1 Patreon page.")); + all_actions.append(&actionPatreon); + mainToolBar->addAction(actionPatreon); + } actionCAT = TranslatedAction(MainWindow); actionCAT->setObjectName(QStringLiteral("actionCAT")); @@ -1732,7 +1735,7 @@ void MainWindow::on_actionReportBug_triggered() void MainWindow::on_actionPatreon_triggered() { - DesktopServices::openUrl(QUrl("https://www.patreon.com/multimc")); + DesktopServices::openUrl(QUrl(BuildConfig.PATREON_URL)); } void MainWindow::on_actionMoreNews_triggered()