aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
Diffstat (limited to 'launcher')
-rw-r--r--launcher/Application.cpp45
-rw-r--r--launcher/Application.h11
-rw-r--r--launcher/BaseVersion.h19
-rw-r--r--launcher/CMakeLists.txt16
-rw-r--r--launcher/FileSystem.cpp69
-rw-r--r--launcher/FileSystem.h9
-rw-r--r--launcher/LaunchController.cpp9
-rw-r--r--launcher/MMCZip.cpp253
-rw-r--r--launcher/MMCZip.h254
-rw-r--r--launcher/VersionProxyModel.cpp30
-rw-r--r--launcher/java/JavaInstall.cpp51
-rw-r--r--launcher/java/JavaInstall.h57
-rw-r--r--launcher/meta/Index.cpp8
-rw-r--r--launcher/minecraft/MinecraftInstance.cpp26
-rw-r--r--launcher/minecraft/PackProfile.cpp3
-rw-r--r--launcher/minecraft/auth/AccountList.cpp12
-rw-r--r--launcher/minecraft/auth/AuthSession.cpp1
-rw-r--r--launcher/minecraft/auth/MinecraftAccount.cpp32
-rw-r--r--launcher/minecraft/auth/MinecraftAccount.h2
-rw-r--r--launcher/minecraft/auth/Yggdrasil.cpp1
-rw-r--r--launcher/minecraft/mod/DataPack.cpp2
-rw-r--r--launcher/minecraft/mod/Mod.cpp14
-rw-r--r--launcher/minecraft/mod/Mod.h3
-rw-r--r--launcher/minecraft/mod/ModFolderModel.cpp17
-rw-r--r--launcher/minecraft/mod/Resource.cpp11
-rw-r--r--launcher/minecraft/mod/Resource.h2
-rw-r--r--launcher/minecraft/mod/ResourceFolderModel.cpp89
-rw-r--r--launcher/minecraft/mod/ResourceFolderModel.h14
-rw-r--r--launcher/minecraft/mod/ResourcePack.cpp2
-rw-r--r--launcher/minecraft/mod/tasks/LocalResourceParse.cpp9
-rw-r--r--launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp2
-rw-r--r--launcher/modplatform/EnsureMetadataTask.cpp6
-rw-r--r--launcher/modplatform/ModIndex.cpp8
-rw-r--r--launcher/modplatform/ModIndex.h2
-rw-r--r--launcher/modplatform/flame/FileResolvingTask.cpp23
-rw-r--r--launcher/modplatform/flame/FlameAPI.h2
-rw-r--r--launcher/modplatform/flame/FlameInstanceCreationTask.cpp130
-rw-r--r--launcher/modplatform/flame/FlameInstanceCreationTask.h6
-rw-r--r--launcher/modplatform/flame/FlamePackExportTask.cpp473
-rw-r--r--launcher/modplatform/flame/FlamePackExportTask.h90
-rw-r--r--launcher/modplatform/flame/PackManifest.cpp9
-rw-r--r--launcher/modplatform/helpers/ExportToModList.cpp200
-rw-r--r--launcher/modplatform/helpers/ExportToModList.h33
-rw-r--r--launcher/modplatform/legacy_ftb/PackInstallTask.cpp86
-rw-r--r--launcher/modplatform/legacy_ftb/PackInstallTask.h27
-rw-r--r--launcher/modplatform/modrinth/ModrinthAPI.h6
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackExportTask.cpp55
-rw-r--r--launcher/translations/TranslationsModel.cpp31
-rw-r--r--launcher/translations/TranslationsModel.h29
-rw-r--r--launcher/ui/MainWindow.cpp566
-rw-r--r--launcher/ui/MainWindow.h2
-rw-r--r--launcher/ui/MainWindow.ui16
-rw-r--r--launcher/ui/dialogs/ExportInstanceDialog.cpp99
-rw-r--r--launcher/ui/dialogs/ExportInstanceDialog.h25
-rw-r--r--launcher/ui/dialogs/ExportPackDialog.cpp (renamed from launcher/ui/dialogs/ExportMrPackDialog.cpp)63
-rw-r--r--launcher/ui/dialogs/ExportPackDialog.h (renamed from launcher/ui/dialogs/ExportMrPackDialog.h)14
-rw-r--r--launcher/ui/dialogs/ExportPackDialog.ui (renamed from launcher/ui/dialogs/ExportMrPackDialog.ui)15
-rw-r--r--launcher/ui/dialogs/ExportToModListDialog.cpp223
-rw-r--r--launcher/ui/dialogs/ExportToModListDialog.h55
-rw-r--r--launcher/ui/dialogs/ExportToModListDialog.ui240
-rw-r--r--launcher/ui/dialogs/ProgressDialog.cpp48
-rw-r--r--launcher/ui/dialogs/ProgressDialog.h2
-rw-r--r--launcher/ui/dialogs/ResourceDownloadDialog.cpp9
-rw-r--r--launcher/ui/instanceview/AccessibleInstanceView.cpp2
-rw-r--r--launcher/ui/instanceview/InstanceView.cpp3
-rw-r--r--launcher/ui/instanceview/VisualGroup.cpp232
-rw-r--r--launcher/ui/instanceview/VisualGroup.h48
-rw-r--r--launcher/ui/pages/global/APIPage.cpp4
-rw-r--r--launcher/ui/pages/global/AccountListPage.cpp13
-rw-r--r--launcher/ui/pages/global/LauncherPage.cpp2
-rw-r--r--launcher/ui/pages/global/LauncherPage.ui2
-rw-r--r--launcher/ui/pages/global/MinecraftPage.cpp6
-rw-r--r--launcher/ui/pages/global/MinecraftPage.ui19
-rw-r--r--launcher/ui/pages/instance/ExternalResourcesPage.cpp33
-rw-r--r--launcher/ui/pages/instance/ExternalResourcesPage.h2
-rw-r--r--launcher/ui/pages/instance/ExternalResourcesPage.ui11
-rw-r--r--launcher/ui/pages/instance/InstanceSettingsPage.cpp28
-rw-r--r--launcher/ui/pages/instance/InstanceSettingsPage.h3
-rw-r--r--launcher/ui/pages/instance/InstanceSettingsPage.ui25
-rw-r--r--launcher/ui/pages/instance/ManagedPackPage.cpp25
-rw-r--r--launcher/ui/pages/instance/ModFolderPage.cpp68
-rw-r--r--launcher/ui/pages/instance/ModFolderPage.h5
-rw-r--r--launcher/ui/pages/instance/ResourcePackPage.cpp2
-rw-r--r--launcher/ui/pages/instance/ShaderPackPage.cpp3
-rw-r--r--launcher/ui/pages/instance/TexturePackPage.cpp2
-rw-r--r--launcher/ui/pages/instance/VersionPage.cpp306
-rw-r--r--launcher/ui/pages/instance/VersionPage.h55
-rw-r--r--launcher/ui/pages/instance/WorldListPage.cpp1
-rw-r--r--launcher/ui/pages/modplatform/ResourcePage.cpp1
-rw-r--r--launcher/ui/setupwizard/JavaWizardPage.cpp1
-rw-r--r--launcher/ui/setupwizard/ThemeWizardPage.cpp4
-rw-r--r--launcher/ui/setupwizard/ThemeWizardPage.h2
-rw-r--r--launcher/ui/themes/CatPack.cpp117
-rw-r--r--launcher/ui/themes/CatPack.h91
-rw-r--r--launcher/ui/themes/CustomTheme.cpp2
-rw-r--r--launcher/ui/themes/CustomTheme.h2
-rw-r--r--launcher/ui/themes/ITheme.cpp2
-rw-r--r--launcher/ui/themes/ITheme.h2
-rw-r--r--launcher/ui/themes/SystemTheme.cpp2
-rw-r--r--launcher/ui/themes/SystemTheme.h2
-rw-r--r--launcher/ui/themes/ThemeManager.cpp104
-rw-r--r--launcher/ui/themes/ThemeManager.h17
-rw-r--r--launcher/ui/widgets/InfoFrame.cpp203
-rw-r--r--launcher/ui/widgets/InfoFrame.h43
-rw-r--r--launcher/ui/widgets/LanguageSelectionWidget.cpp28
-rw-r--r--launcher/ui/widgets/LanguageSelectionWidget.h25
-rw-r--r--launcher/ui/widgets/ThemeCustomizationWidget.cpp19
-rw-r--r--launcher/ui/widgets/ThemeCustomizationWidget.h36
-rw-r--r--launcher/ui/widgets/WideBar.cpp13
109 files changed, 3585 insertions, 1697 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index 625cebd3..6772bedc 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -6,9 +6,10 @@
* Prism Launcher - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
* Copyright (C) 2022 Lenny McLennington <lenny@sneed.church>
- * Copyright (C) 2022 Tayou <tayou@gmx.net>
+ * Copyright (C) 2022 Tayou <git@tayou.org>
* Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>
* Copyright (C) 2023 Rachel Powers <508861+Ryex@users.noreply.github.com>
+ * Copyright (C) 2023 seth <getchoo at tuta dot io>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -433,7 +434,11 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
}
// seach root path
if(!foundLoggingRules) {
+#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
+ logRulesPath = FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME, logRulesFile);
+#else
logRulesPath = FS::PathCombine(m_rootPath, logRulesFile);
+#endif
qDebug() << "Testing" << logRulesPath << "...";
foundLoggingRules = QFile::exists(logRulesPath);
}
@@ -471,6 +476,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
qDebug() << BuildConfig.LAUNCHER_DISPLAYNAME << ", (c) 2013-2021 " << BuildConfig.LAUNCHER_COPYRIGHT;
qDebug() << "Version : " << BuildConfig.printableVersionString();
+ qDebug() << "Platform : " << BuildConfig.BUILD_PLATFORM;
qDebug() << "Git commit : " << BuildConfig.GIT_COMMIT;
qDebug() << "Git refspec : " << BuildConfig.GIT_REFSPEC;
if (adjustedBy.size())
@@ -568,6 +574,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
// Language
m_settings->registerSetting("Language", QString());
+ m_settings->registerSetting("UseSystemLocale", false);
// Console
m_settings->registerSetting("ShowConsole", false);
@@ -604,6 +611,9 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
m_settings->registerSetting("IgnoreJavaCompatibility", false);
m_settings->registerSetting("IgnoreJavaWizard", false);
+ // Mod loader settings
+ m_settings->registerSetting("DisableQuiltBeacon", false);
+
// Native library workarounds
m_settings->registerSetting("UseNativeOpenAL", false);
m_settings->registerSetting("UseNativeGLFW", false);
@@ -687,8 +697,16 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
m_settings->reset("PastebinCustomAPIBase");
}
}
- // meta URL
- m_settings->registerSetting("MetaURLOverride", "");
+ {
+ // Meta URL
+ m_settings->registerSetting("MetaURLOverride", "");
+
+ QUrl metaUrl(m_settings->get("MetaURLOverride").toString());
+
+ // get rid of invalid meta urls
+ if (!metaUrl.isValid() || metaUrl.scheme() != "http" || metaUrl.scheme() != "https")
+ m_settings->reset("MetaURLOverride");
+ }
m_settings->registerSetting("CloseAfterLaunch", false);
m_settings->registerSetting("QuitAfterGameStop", false);
@@ -910,12 +928,7 @@ bool Application::createSetupWizard()
}
return false;
}();
- bool languageRequired = [&]()
- {
- if (settings()->get("Language").toString().isEmpty())
- return true;
- return false;
- }();
+ bool languageRequired = settings()->get("Language").toString().isEmpty();
bool pasteInterventionRequired = settings()->get("PastebinURL") != "";
bool themeInterventionRequired = settings()->get("ApplicationTheme") == "";
bool wizardRequired = javaRequired || languageRequired || pasteInterventionRequired || themeInterventionRequired;
@@ -1172,7 +1185,17 @@ QIcon Application::getThemedIcon(const QString& name)
return QIcon::fromTheme(name);
}
-bool Application::openJsonEditor(const QString &filename)
+QList<CatPack*> Application::getValidCatPacks()
+{
+ return m_themeManager->getValidCatPacks();
+}
+
+QString Application::getCatPack(QString catName)
+{
+ return m_themeManager->getCatPack(catName);
+}
+
+bool Application::openJsonEditor(const QString& filename)
{
const QString file = QDir::current().absoluteFilePath(filename);
if (m_settings->get("JsonEditor").toString().isEmpty())
@@ -1556,7 +1579,7 @@ QString Application::getJarPath(QString jarFile)
{
QStringList potentialPaths = {
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
- FS::PathCombine(m_rootPath, "share/" + BuildConfig.LAUNCHER_APP_BINARY_NAME),
+ FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME),
#endif
FS::PathCombine(m_rootPath, "jars"),
FS::PathCombine(applicationDirPath(), "jars"),
diff --git a/launcher/Application.h b/launcher/Application.h
index b911edc1..769dc6a6 100644
--- a/launcher/Application.h
+++ b/launcher/Application.h
@@ -2,7 +2,7 @@
/*
* Prism Launcher - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
- * Copyright (C) 2022 Tayou <tayou@gmx.net>
+ * Copyright (C) 2022 Tayou <git@tayou.org>
* Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>
*
* This program is free software: you can redistribute it and/or modify
@@ -48,6 +48,7 @@
#include <BaseInstance.h>
#include "minecraft/launch/MinecraftServerTarget.h"
+#include "ui/themes/CatPack.h"
class LaunchController;
class LocalPeer;
@@ -126,9 +127,11 @@ public:
void setApplicationTheme(const QString& name);
- shared_qobject_ptr<ExternalUpdater> updater() {
- return m_updater;
- }
+ QList<CatPack*> getValidCatPacks();
+
+ QString getCatPack(QString catName = "");
+
+ shared_qobject_ptr<ExternalUpdater> updater() { return m_updater; }
void triggerUpdateCheck();
diff --git a/launcher/BaseVersion.h b/launcher/BaseVersion.h
index ca0e4502..c7cedbe1 100644
--- a/launcher/BaseVersion.h
+++ b/launcher/BaseVersion.h
@@ -15,16 +15,15 @@
#pragma once
-#include <memory>
-#include <QString>
#include <QMetaType>
+#include <QString>
+#include <memory>
/*!
* An abstract base class for versions.
*/
-class BaseVersion