From fda3f1352e203bc119f092e30b25356345342c18 Mon Sep 17 00:00:00 2001 From: flow Date: Tue, 11 Oct 2022 16:11:08 -0300 Subject: feat: add image support for the news reader :^) Signed-off-by: flow --- launcher/ui/dialogs/NewsDialog.cpp | 4 ++++ launcher/ui/dialogs/NewsDialog.ui | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'launcher/ui/dialogs') diff --git a/launcher/ui/dialogs/NewsDialog.cpp b/launcher/ui/dialogs/NewsDialog.cpp index d3b21627..e1b5dd74 100644 --- a/launcher/ui/dialogs/NewsDialog.cpp +++ b/launcher/ui/dialogs/NewsDialog.cpp @@ -20,7 +20,9 @@ NewsDialog::NewsDialog(QList entries, QWidget* parent) : QDialog(p auto article_entry = m_entries.constFind(first_item->text()).value(); ui->articleTitleLabel->setText(QString("%2").arg(article_entry->link, first_item->text())); + ui->currentArticleContentBrowser->setText(article_entry->content); + ui->currentArticleContentBrowser->flush(); } NewsDialog::~NewsDialog() @@ -33,7 +35,9 @@ void NewsDialog::selectedArticleChanged(const QString& new_title) auto const& article_entry = m_entries.constFind(new_title).value(); ui->articleTitleLabel->setText(QString("%2").arg(article_entry->link, new_title)); + ui->currentArticleContentBrowser->setText(article_entry->content); + ui->currentArticleContentBrowser->flush(); } void NewsDialog::toggleArticleList() diff --git a/launcher/ui/dialogs/NewsDialog.ui b/launcher/ui/dialogs/NewsDialog.ui index 2aaa08f1..08f35a0b 100644 --- a/launcher/ui/dialogs/NewsDialog.ui +++ b/launcher/ui/dialogs/NewsDialog.ui @@ -49,7 +49,7 @@ - + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse @@ -91,6 +91,13 @@ + + + ProjectDescriptionPage + QTextBrowser +
ui/widgets/ProjectDescriptionPage.h
+
+
-- cgit From f26be005716818b643a0c8b1373dbe83e4cdcfbf Mon Sep 17 00:00:00 2001 From: flow Date: Thu, 13 Oct 2022 13:49:06 -0300 Subject: fix: abort search if we're already trying to download a pack Meaning we don't have to wait for the searches to finish in the background to finally start the modpack download, when we have already selected it -_- Signed-off-by: flow --- launcher/ui/dialogs/NewInstanceDialog.cpp | 8 ++++++++ launcher/ui/pages/modplatform/ftb/FtbListModel.cpp | 11 +++++++++++ launcher/ui/pages/modplatform/ftb/FtbListModel.h | 5 +++++ launcher/ui/pages/modplatform/ftb/FtbPage.cpp | 6 ++++++ launcher/ui/pages/modplatform/ftb/FtbPage.h | 1 + 5 files changed, 31 insertions(+) (limited to 'launcher/ui/dialogs') diff --git a/launcher/ui/dialogs/NewInstanceDialog.cpp b/launcher/ui/dialogs/NewInstanceDialog.cpp index d203795a..df182f09 100644 --- a/launcher/ui/dialogs/NewInstanceDialog.cpp +++ b/launcher/ui/dialogs/NewInstanceDialog.cpp @@ -139,6 +139,10 @@ NewInstanceDialog::NewInstanceDialog(const QString & initialGroup, const QString void NewInstanceDialog::reject() { APPLICATION->settings()->set("NewInstanceGeometry", saveGeometry().toBase64()); + + // This is just so that the pages get the close() call and can react to it, if needed. + m_container->prepareToClose(); + QDialog::reject(); } @@ -146,6 +150,10 @@ void NewInstanceDialog::accept() { APPLICATION->settings()->set("NewInstanceGeometry", saveGeometry().toBase64()); importIconNow(); + + // This is just so that the pages get the close() call and can react to it, if needed. + m_container->prepareToClose(); + QDialog::accept(); } diff --git a/launcher/ui/pages/modplatform/ftb/FtbListModel.cpp b/launcher/ui/pages/modplatform/ftb/FtbListModel.cpp index ad15b6e6..3a149944 100644 --- a/launcher/ui/pages/modplatform/ftb/FtbListModel.cpp +++ b/launcher/ui/pages/modplatform/ftb/FtbListModel.cpp @@ -103,6 +103,8 @@ void ListModel::getLogo(const QString &logo, const QString &logoUrl, LogoCallbac void ListModel::request() { + m_aborted = false; + beginResetModel(); modpacks.clear(); endResetModel(); @@ -117,6 +119,12 @@ void ListModel::request() QObject::connect(netJob, &NetJob::failed, this, &ListModel::requestFailed); } +void ListModel::abortRequest() +{ + m_aborted = jobPtr->abort(); + jobPtr.reset(); +} + void ListModel::requestFinished() { jobPtr.reset(); @@ -162,6 +170,9 @@ void ListModel::requestPack() void ListModel::packRequestFinished() { + if (!jobPtr || m_aborted) + return; + jobPtr.reset(); remainingPacks.removeOne(currentPack); diff --git a/launcher/ui/pages/modplatform/ftb/FtbListModel.h b/launcher/ui/pages/modplatform/ftb/FtbListModel.h index 314cb789..cbf215c4 100644 --- a/launcher/ui/pages/modplatform/ftb/FtbListModel.h +++ b/launcher/ui/pages/modplatform/ftb/FtbListModel.h @@ -47,9 +47,12 @@ public: QVariant data(const QModelIndex &index, int role) const override; void request(); + void abortRequest(); void getLogo(const QString &logo, const QString &logoUrl, LogoCallback callback); + [[nodiscard]] bool isMakingRequest() const { return jobPtr.get(); } + private slots: void requestFinished(); void requestFailed(QString reason); @@ -65,6 +68,8 @@ private: void requestLogo(QString file, QString url); private: + bool m_aborted = false; + QList modpacks; LogoMap m_logoMap; diff --git a/launcher/ui/pages/modplatform/ftb/FtbPage.cpp b/launcher/ui/pages/modplatform/ftb/FtbPage.cpp index 8975d74e..1fe28124 100644 --- a/launcher/ui/pages/modplatform/ftb/FtbPage.cpp +++ b/launcher/ui/pages/modplatform/ftb/FtbPage.cpp @@ -114,6 +114,12 @@ void FtbPage::openedImpl() suggestCurrent(); } +void FtbPage::closedImpl() +{ + if (listModel->isMakingRequest()) + listModel->abortRequest(); +} + void FtbPage::suggestCurrent() { if(!isOpened) diff --git a/launcher/ui/pages/modplatform/ftb/FtbPage.h b/launcher/ui/pages/modplatform/ftb/FtbPage.h index 90c8e7fd..631ae7f5 100644 --- a/launcher/ui/pages/modplatform/ftb/FtbPage.h +++ b/launcher/ui/pages/modplatform/ftb/FtbPage.h @@ -78,6 +78,7 @@ public: void retranslate() override; void openedImpl() override; + void closedImpl() override; bool eventFilter(QObject * watched, QEvent * event) override; -- cgit From dfa220ef02f23ff734dec6247f4a124a7a144c7a Mon Sep 17 00:00:00 2001 From: flow Date: Thu, 13 Oct 2022 15:10:35 -0300 Subject: fix: issues with aborts (again) i hate it Signed-off-by: flow --- launcher/modplatform/flame/FileResolvingTask.cpp | 5 +++-- launcher/modplatform/modpacksch/FTBPackInstallTask.cpp | 15 +++++++++++---- launcher/ui/dialogs/ProgressDialog.cpp | 5 +++-- launcher/ui/pages/modplatform/ftb/FtbListModel.h | 1 + launcher/ui/pages/modplatform/ftb/FtbPage.cpp | 2 +- 5 files changed, 19 insertions(+), 9 deletions(-) (limited to 'launcher/ui/dialogs') diff --git a/launcher/modplatform/flame/FileResolvingTask.cpp b/launcher/modplatform/flame/FileResolvingTask.cpp index 058d2471..1e7f5559 100644 --- a/launcher/modplatform/flame/FileResolvingTask.cpp +++ b/launcher/modplatform/flame/FileResolvingTask.cpp @@ -9,9 +9,10 @@ Flame::FileResolvingTask::FileResolvingTask(const shared_qobject_ptrabort(); - return true; + aborted &= m_dljob->abort(); + return aborted ? Task::abort() : false; } void Flame::FileResolvingTask::executeTask() diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp index cc926d45..7b112d8f 100644 --- a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp +++ b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp @@ -73,8 +73,8 @@ bool PackInstallTask::abort() void PackInstallTask::executeTask() { - setAbortable(true); setStatus(tr("Getting the manifest...")); + setAbortable(false); // Find pack version auto version_it = std::find_if(m_pack.versions.constBegin(), m_pack.versions.constEnd(), @@ -94,10 +94,12 @@ void PackInstallTask::executeTask() QObject::connect(netJob, &NetJob::succeeded, this, &PackInstallTask::onManifestDownloadSucceeded); QObject::connect(netJob, &NetJob::failed, this, &PackInstallTask::onManifestDownloadFailed); + QObject::connect(netJob, &NetJob::aborted, this, &PackInstallTask::abort); QObject::connect(netJob, &NetJob::progress, this, &PackInstallTask::setProgress); m_net_job = netJob; + setAbortable(true); netJob->start(); } @@ -130,8 +132,8 @@ void PackInstallTask::onManifestDownloadSucceeded() void PackInstallTask::resolveMods() { - setAbortable(true); setStatus(tr("Resolving mods...")); + setAbortable(false); setProgress(0, 100); m_file_id_map.clear(); @@ -164,8 +166,11 @@ void PackInstallTask::resolveMods() connect(m_mod_id_resolver_task.get(), &Flame::FileResolvingTask::succeeded, this, &PackInstallTask::onResolveModsSucceeded); connect(m_mod_id_resolver_task.get(), &Flame::FileResolvingTask::failed, this, &PackInstallTask::onResolveModsFailed); + connect(m_mod_id_resolver_task.get(), &Flame::FileResolvingTask::aborted, this, &PackInstallTask::abort); connect(m_mod_id_resolver_task.get(), &Flame::FileResolvingTask::progress, this, &PackInstallTask::setProgress); + setAbortable(true); + m_mod_id_resolver_task->start(); } @@ -279,9 +284,8 @@ void PackInstallTask::onCreateInstanceSucceeded() void PackInstallTask::downloadPack() { - setAbortable(true); - setStatus(tr("Downloading mods...")); + setAbortable(false); auto* jobPtr = new NetJob(tr("Mod download"), APPLICATION->network()); for (auto const& file : m_version.files) { @@ -304,9 +308,12 @@ void PackInstallTask::downloadPack() connect(jobPtr, &NetJob::succeeded, this, &PackInstallTask::onModDownloadSucceeded); connect(jobPtr, &NetJob::failed, this, &PackInstallTask::onModDownloadFailed); + connect(jobPtr, &NetJob::aborted, this, &PackInstallTask::abort); connect(jobPtr, &NetJob::progress, this, &PackInstallTask::setProgress); m_net_job = jobPtr; + + setAbortable(true); jobPtr->start(); } diff --git a/launcher/ui/dialogs/ProgressDialog.cpp b/launcher/ui/dialogs/ProgressDialog.cpp index 258a32e4..68dd4d17 100644 --- a/launcher/ui/dialogs/ProgressDialog.cpp +++ b/launcher/ui/dialogs/ProgressDialog.cpp @@ -25,6 +25,7 @@ ProgressDialog::ProgressDialog(QWidget* parent) : QDialog(parent), ui(new Ui::Pr { ui->setupUi(this); this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); + setAttribute(Qt::WidgetAttribute::WA_QuitOnClose, true); setSkipButton(false); changeProgress(0, 100); } @@ -67,7 +68,7 @@ int ProgressDialog::execWithTask(Task* task) return QDialog::DialogCode::Accepted; } - QDialog::DialogCode result; + QDialog::DialogCode result {}; if (handleImmediateResult(result)) { return result; } @@ -80,7 +81,7 @@ int ProgressDialog::execWithTask(Task* task) connect(task, &Task::stepStatus, this, &ProgressDialog::changeStatus); connect(task, &Task::progress, this, &ProgressDialog::changeProgress); - connect(task, &Task::aborted, [this] { QDialog::reject(); }); + connect(task, &Task::aborted, this, &ProgressDialog::hide); connect(task, &Task::abortStatusChanged, ui->skipButton, &QPushButton::setEnabled); m_is_multi_step = task->isMultiStep(); diff --git a/launcher/ui/pages/modplatform/ftb/FtbListModel.h b/launcher/ui/pages/modplatform/ftb/FtbListModel.h index cbf215c4..d7a120f0 100644 --- a/launcher/ui/pages/modplatform/ftb/FtbListModel.h +++ b/launcher/ui/pages/modplatform/ftb/FtbListModel.h @@ -52,6 +52,7 @@ public: void getLogo(const QString &logo, const QString &logoUrl, LogoCallback callback); [[nodiscard]] bool isMakingRequest() const { return jobPtr.get(); } + [[nodiscard]] bool wasAborted() const { return m_aborted; } private slots: void requestFinished(); diff --git a/launcher/ui/pages/modplatform/ftb/FtbPage.cpp b/launcher/ui/pages/modplatform/ftb/FtbPage.cpp index 1fe28124..34a3d1c0 100644 --- a/launcher/ui/pages/modplatform/ftb/FtbPage.cpp +++ b/launcher/ui/pages/modplatform/ftb/FtbPage.cpp @@ -105,7 +105,7 @@ void FtbPage::retranslate() void FtbPage::openedImpl() { - if(!initialised) + if(!initialised || listModel->wasAborted()) { listModel->request(); initialised = true; -- cgit From 8201d1df0279693ab70a00e205a2612878b1d6b5 Mon Sep 17 00:00:00 2001 From: Samisafool Date: Tue, 18 Oct 2022 20:07:04 +0530 Subject: Rename Signed-off-by: Samisafool --- launcher/java/JavaUtils.cpp | 2 +- launcher/minecraft/Library.h | 14 +- launcher/minecraft/VersionFile.h | 30 ++-- launcher/minecraft/auth/AccountList.h | 2 +- launcher/minecraft/auth/MinecraftAccount.h | 2 +- launcher/minecraft/launch/LauncherPartLaunch.cpp | 2 +- .../minecraft/launch/MinecraftServerTarget.cpp | 2 +- launcher/settings/Setting.h | 2 +- launcher/ui/MainWindow.cpp | 2 +- launcher/ui/dialogs/AboutDialog.cpp | 8 +- launcher/ui/dialogs/UpdateDialog.cpp | 8 +- launcher/updater/DownloadTask.h | 2 +- launcher/updater/GoUpdate.cpp | 2 +- libraries/README.md | 4 +- libraries/katabasis/README.md | 2 +- libraries/launcher/CMakeLists.txt | 20 +-- libraries/launcher/org/polymc/EntryPoint.java | 164 ------------------ libraries/launcher/org/polymc/Launcher.java | 23 --- libraries/launcher/org/polymc/LauncherFactory.java | 80 --------- .../launcher/org/polymc/applet/LegacyFrame.java | 163 ------------------ .../exception/ParameterNotFoundException.java | 25 --- .../org/polymc/exception/ParseException.java | 25 --- .../launcher/org/polymc/impl/OneSixLauncher.java | 190 --------------------- .../launcher/org/polymc/utils/Parameters.java | 78 --------- libraries/launcher/org/polymc/utils/Utils.java | 49 ------ .../launcher/org/prismlauncher/EntryPoint.java | 164 ++++++++++++++++++ libraries/launcher/org/prismlauncher/Launcher.java | 23 +++ .../org/prismlauncher/LauncherFactory.java | 80 +++++++++ .../org/prismlauncher/applet/LegacyFrame.java | 163 ++++++++++++++++++ .../exception/ParameterNotFoundException.java | 25 +++ .../prismlauncher/exception/ParseException.java | 25 +++ .../org/prismlauncher/impl/OneSixLauncher.java | 190 +++++++++++++++++++++ .../org/prismlauncher/utils/Parameters.java | 78 +++++++++ .../launcher/org/prismlauncher/utils/Utils.java | 49 ++++++ nix/NIX.md | 16 +- program_info/prismlauncher.6.scd | 22 +-- 36 files changed, 868 insertions(+), 868 deletions(-) delete mode 100644 libraries/launcher/org/polymc/EntryPoint.java delete mode 100644 libraries/launcher/org/polymc/Launcher.java delete mode 100644 libraries/launcher/org/polymc/LauncherFactory.java delete mode 100644 libraries/launcher/org/polymc/applet/LegacyFrame.java delete mode 100644 libraries/launcher/org/polymc/exception/ParameterNotFoundException.java delete mode 100644 libraries/launcher/org/polymc/exception/ParseException.java delete mode 100644 libraries/launcher/org/polymc/impl/OneSixLauncher.java delete mode 100644 libraries/launcher/org/polymc/utils/Parameters.java delete mode 100644 libraries/launcher/org/polymc/utils/Utils.java create mode 100644 libraries/launcher/org/prismlauncher/EntryPoint.java create mode 100644 libraries/launcher/org/prismlauncher/Launcher.java create mode 100644 libraries/launcher/org/prismlauncher/LauncherFactory.java create mode 100644 libraries/launcher/org/prismlauncher/applet/LegacyFrame.java create mode 100644 libraries/launcher/org/prismlauncher/exception/ParameterNotFoundException.java create mode 100644 libraries/launcher/org/prismlauncher/exception/ParseException.java create mode 100644 libraries/launcher/org/prismlauncher/impl/OneSixLauncher.java create mode 100644 libraries/launcher/org/prismlauncher/utils/Parameters.java create mode 100644 libraries/launcher/org/prismlauncher/utils/Utils.java (limited to 'launcher/ui/dialogs') diff --git a/launcher/java/JavaUtils.cpp b/launcher/java/JavaUtils.cpp index 6096e812..040fe821 100644 --- a/launcher/java/JavaUtils.cpp +++ b/launcher/java/JavaUtils.cpp @@ -441,7 +441,7 @@ QList JavaUtils::FindJavaPaths() scanJavaDir("/usr/lib/jvm"); scanJavaDir("/usr/lib64/jvm"); scanJavaDir("/usr/lib32/jvm"); - // javas stored in PolyMC's folder + // javas stored in Prism Launcher's folder scanJavaDir("java"); // manually installed JDKs in /opt scanJavaDir("/opt/jdk"); diff --git a/launcher/minecraft/Library.h b/launcher/minecraft/Library.h index 950aec9d..26dbf962 100644 --- a/launcher/minecraft/Library.h +++ b/launcher/minecraft/Library.h @@ -194,7 +194,7 @@ public: /* methods */ QString getCompatibleNative(const RuntimeContext & runtimeContext) const; private: /* methods */ - /// the default storage prefix used by PolyMC + /// the default storage prefix used by Prism Launcher static QString defaultStoragePrefix(); /// Get the prefix - root of the storage to be used @@ -215,23 +215,23 @@ protected: /* data */ /// DEPRECATED URL prefix of the maven repo where the file can be downloaded QString m_repositoryURL; - /// DEPRECATED: PolyMC-specific absolute URL. takes precedence over the implicit maven repo URL, if defined + /// DEPRECATED: Prism Launcher-specific absolute URL. takes precedence over the implicit maven repo URL, if defined QString m_absoluteURL; - /// PolyMC extension - filename override + /// Prism Launcher extension - filename override QString m_filename; - /// DEPRECATED PolyMC extension - display name + /// DEPRECATED Prism Launcher extension - display name QString m_displayname; /** - * PolyMC-specific type hint - modifies how the library is treated + * Prism Launcher-specific type hint - modifies how the library is treated */ QString m_hint; /** - * storage - by default the local libraries folder in polymc, but could be elsewhere - * PolyMC specific, because of FTB. + * storage - by default the local libraries folder in Prism Launcher, but could be elsewhere + * Prism Launcher specific, because of FTB. */ QString m_storagePrefix; diff --git a/launcher/minecraft/VersionFile.h b/launcher/minecraft/VersionFile.h index e1b62f6a..11c5a3af 100644 --- a/launcher/minecraft/VersionFile.h +++ b/launcher/minecraft/VersionFile.h @@ -62,19 +62,19 @@ public: /* methods */ void applyTo(LaunchProfile* profile, const RuntimeContext & runtimeContext); public: /* data */ - /// PolyMC: order hint for this version file if no explicit order is set + /// Prism Launcher: order hint for this version file if no explicit order is set int order = 0; - /// PolyMC: human readable name of this package + /// Prism Launcher: human readable name of this package QString name; - /// PolyMC: package ID of this package + /// Prism Launcher: package ID of this package QString uid; - /// PolyMC: version of this package + /// Prism Launcher: version of this package QString version; - /// PolyMC: DEPRECATED dependency on a Minecraft version + /// Prism Launcher: DEPRECATED dependency on a Minecraft version QString dependsOnMinecraftVersion; /// Mojang: DEPRECATED used to version the Mojang version format @@ -86,13 +86,13 @@ public: /* data */ /// Mojang: class to launch Minecraft with QString mainClass; - /// PolyMC: class to launch legacy Minecraft with (embed in a custom window) + /// Prism Launcher: class to launch legacy Minecraft with (embed in a custom window) QString appletClass; /// Mojang: Minecraft launch arguments (may contain placeholders for variable substitution) QString minecraftArguments; - /// PolyMC: Additional JVM launch arguments + /// Prism Launcher: Additional JVM launch arguments QStringList addnJvmArguments; /// Mojang: list of compatible java majors @@ -110,38 +110,38 @@ public: /* data */ /// Mojang: DEPRECATED asset group to be used with Minecraft QString assets; - /// PolyMC: list of tweaker mod arguments for launchwrapper + /// Prism Launcher: list of tweaker mod arguments for launchwrapper QStringList addTweakers; /// Mojang: list of libraries to add to the version QList libraries; - /// PolyMC: list of maven files to put in the libraries folder, but not in classpath + /// Prism Launcher: list of maven files to put in the libraries folder, but not in classpath QList mavenFiles; - /// PolyMC: list of agents to add to JVM arguments + /// Prism Launcher: list of agents to add to JVM arguments QList agents; /// The main jar (Minecraft version library, normally) LibraryPtr mainJar; - /// PolyMC: list of attached traits of this version file - used to enable features + /// Prism Launcher: list of attached traits of this version file - used to enable features QSet traits; - /// PolyMC: list of jar mods added to this version + /// Prism Launcher: list of jar mods added to this version QList jarMods; - /// PolyMC: list of mods added to this version + /// Prism Launcher: list of mods added to this version QList mods; /** - * PolyMC: set of packages this depends on + * Prism Launcher: set of packages this depends on * NOTE: this is shared with the meta format!!! */ Meta::RequireSet requires; /** - * PolyMC: set of packages this conflicts with + * Prism Launcher: set of packages this conflicts with * NOTE: this is shared with the meta format!!! */ Meta::RequireSet conflicts; diff --git a/launcher/minecraft/auth/AccountList.h b/launcher/minecraft/auth/AccountList.h index 8136a92e..a8c3529a 100644 --- a/launcher/minecraft/auth/AccountList.h +++ b/launcher/minecraft/auth/AccountList.h @@ -44,7 +44,7 @@ /*! * List of available Mojang accounts. - * This should be loaded in the background by PolyMC on startup. + * This should be loaded in the background by Prism Launcher on startup. */ class AccountList : public QAbstractListModel { diff --git a/launcher/minecraft/auth/MinecraftAccount.h b/launcher/minecraft/auth/MinecraftAccount.h index 7777f846..0dcaeb53 100644 --- a/launcher/minecraft/auth/MinecraftAccount.h +++ b/launcher/minecraft/auth/MinecraftAccount.h @@ -61,7 +61,7 @@ Q_DECLARE_METATYPE(MinecraftAccountPtr) * A profile within someone's Mojang account. * * Currently, the profile system has not been implemented by Mojang yet, - * but we might as well add some things for it in PolyMC right now so + * but we might as well add some things for it in Prism Launcher right now so * we don't have to rip the code to pieces to add it later. */ struct AccountProfile diff --git a/launcher/minecraft/launch/LauncherPartLaunch.cpp b/launcher/minecraft/launch/LauncherPartLaunch.cpp index ce477ad7..1d8d7083 100644 --- a/launcher/minecraft/launch/LauncherPartLaunch.cpp +++ b/launcher/minecraft/launch/LauncherPartLaunch.cpp @@ -154,7 +154,7 @@ void LauncherPartLaunch::executeTask() #else args << classPath.join(':'); #endif - args << "org.polymc.EntryPoint"; + args << "org.prismlauncher.EntryPoint"; qDebug() << args.join(' '); diff --git a/launcher/minecraft/launch/MinecraftServerTarget.cpp b/launcher/minecraft/launch/MinecraftServerTarget.cpp index 78a33359..a3383ec0 100644 --- a/launcher/minecraft/launch/MinecraftServerTarget.cpp +++ b/launcher/minecraft/launch/MinecraftServerTarget.cpp @@ -23,7 +23,7 @@ MinecraftServerTarget MinecraftServerTarget::parse(const QString &fullAddress) { // The logic below replicates the exact logic minecraft uses for parsing server addresses. // While the conversion is not lossless and eats errors, it ensures the same behavior - // within Minecraft and PolyMC when entering server addresses. + // within Minecraft and Prism Launcher when entering server addresses. if (fullAddress.startsWith("[")) { int bracket = fullAddress.indexOf("]"); diff --git a/launcher/settings/Setting.h b/launcher/settings/Setting.h index 9a5b8210..86007c13 100644 --- a/launcher/settings/Setting.h +++ b/launcher/settings/Setting.h @@ -33,7 +33,7 @@ public: * Construct a Setting * * Synonyms are all the possible names used in the settings object, in order of preference. - * First synonym is the ID, which identifies the setting in PolyMC. + * First synonym is the ID, which identifies the setting in Prism Launcher. * * defVal is the default value that will be returned when the settings object * doesn't have any value for this setting. diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 603eaa97..0fab0202 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1860,7 +1860,7 @@ void MainWindow::globalSettingsClosed() updateToolsMenu(); updateStatusCenter(); // This needs to be done to prevent UI elements disappearing in the event the config is changed - // but PolyMC exits abnormally, causing the window state to never be saved: + // but Prism Launcher exits abnormally, causing the window state to never be saved: APPLICATION->settings()->set("MainWindowState", saveState().toBase64()); update(); } diff --git a/launcher/ui/dialogs/AboutDialog.cpp b/launcher/ui/dialogs/AboutDialog.cpp index 47f204b3..460d25b9 100644 --- a/launcher/ui/dialogs/AboutDialog.cpp +++ b/launcher/ui/dialogs/AboutDialog.cpp @@ -69,7 +69,7 @@ QString getCreditsHtml() #endif stream << "
\n"; - //: %1 is the name of the launcher, determined at build time, e.g. "PolyMC Developers" + //: %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("

dada513 %1

\n") .arg(getGitHub("dada513")); @@ -79,7 +79,7 @@ QString getCreditsHtml() stream << QString("

cozyGalvinism %1

\n") .arg(getGitHub("cozyGalvinism")); stream << "
\n"; - //: %1 is the name of the launcher, determined at build time, e.g. "PolyMC Contributors" + //: %1 is the name of the launcher, determined at build time, e.g. "Prism Launcher Contributors" stream << "

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

\n"; stream << QString("

DioEgizio %1

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

flowln %1

\n") .arg(getGitHub("flowln")); @@ -87,7 +87,7 @@ QString getCreditsHtml() stream << "
\n"; // TODO: possibly retrieve from git history at build time? - //: %1 is the name of the launcher, determined at build time, e.g. "PolyMC Developers" + //: %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"); @@ -102,7 +102,7 @@ QString getCreditsHtml() stream << "

Kilobyte <stiepen22@gmx.de>

\n"; stream << "

Rootbear75 <@rootbear75>

\n"; stream << "

Zeker Zhayard <@Zeker_Zhayard>

\n"; - stream << "

Everyone else who contributed!

\n"; + stream << "

Everyone else who contributed!

\n"; stream << "
\n"; stream << "
\n"; diff --git a/launcher/ui/dialogs/UpdateDialog.cpp b/launcher/ui/dialogs/UpdateDialog.cpp index e0c5a495..9e82531a 100644 --- a/launcher/ui/dialogs/UpdateDialog.cpp +++ b/launcher/ui/dialogs/UpdateDialog.cpp @@ -73,12 +73,12 @@ void UpdateDialog::loadChangelog() QString url; if(channel == "stable") { - url = QString("https://raw.githubusercontent.com/PolyMC/PolyMC/%1/changelog.md").arg(channel); + url = QString("https://raw.githubusercontent.com/PrismLauncher/PrismLauncher/%1/changelog.md").arg(channel); m_changelogType = CHANGELOG_MARKDOWN; } else { - url = QString("https://api.github.com/repos/PolyMC/PolyMC/compare/%1...%2").arg(BuildConfig.GIT_COMMIT, channel); + url = QString("https://api.github.com/repos/PrismLauncher/PrismLauncher/compare/%1...%2").arg(BuildConfig.GIT_COMMIT, channel); m_changelogType = CHANGELOG_COMMITS; } dljob->addNetAction(Net::Download::makeByteArray(QUrl(url), &changelogData)); @@ -93,7 +93,7 @@ QString reprocessMarkdown(QByteArray markdown) QString output = hoedown.process(markdown); // HACK: easier than customizing hoedown - output.replace(QRegularExpression("GH-([0-9]+)"), "GH-\\1"); + output.replace(QRegularExpression("GH-([0-9]+)"), "GH-\\1"); qDebug() << output; return output; } @@ -135,7 +135,7 @@ QString reprocessCommits(QByteArray json) result += ""; if(issuenr.length()) { - result += QString("GH-%2").arg(issuenr, issuenr); + result += QString("GH-%2").arg(issuenr, issuenr); } else if(prefix.length()) { diff --git a/launcher/updater/DownloadTask.h b/launcher/updater/DownloadTask.h index f47a3048..19a6265c 100644 --- a/launcher/updater/DownloadTask.h +++ b/launcher/updater/DownloadTask.h @@ -54,7 +54,7 @@ protected: /*! * Downloads the version info files from the repository. * The files for both the current build, and the build that we're updating to need to be downloaded. - * If the current version's info file can't be found, PolyMC will not delete files that + * If the current version's info file can't be found, Prism Launcher will not delete files that * were removed between versions. It will still replace files that have changed, however. * Note that although the repository URL for the current version is not given to the update task, * the task will attempt to look it up in the UpdateChecker's channel list. diff --git a/launcher/updater/GoUpdate.cpp b/launcher/updater/GoUpdate.cpp index 91f30b5d..4bc7dfa9 100644 --- a/launcher/updater/GoUpdate.cpp +++ b/launcher/updater/GoUpdate.cpp @@ -104,7 +104,7 @@ bool processFileLists } } - // Next, check each file in PolyMC's folder and see if we need to update them. + // Next, check each file in Prism Launcher's folder and see if we need to update them. for (VersionFileEntry entry : newVersion) { // TODO: Let's not MD5sum a ton of files on the GUI thread. We should probably find a diff --git a/libraries/README.md b/libraries/README.md index 9a26dd69..dc38477b 100644 --- a/libraries/README.md +++ b/libraries/README.md @@ -173,7 +173,7 @@ Available either under LGPL version 2.1 or later. ## systeminfo -A PolyMC-specific library for probing system information. +A Prism Launcher-specific library for probing system information. Apache 2.0 @@ -183,4 +183,4 @@ A TOML language parser. Used by Forge 1.14+ to store mod metadata. See [github repo](https://github.com/marzer/tomlplusplus). -Licenced under the MIT licence. \ No newline at end of file +Licenced under the MIT licence. diff --git a/libraries/katabasis/README.md b/libraries/katabasis/README.md index 621446e1..fe6dd4ac 100644 --- a/libraries/katabasis/README.md +++ b/libraries/katabasis/README.md @@ -10,7 +10,7 @@ Notes to contributors: * Please follow the coding style of the existing source, where reasonable * Code contributions are released under Simplified BSD License, as specified in LICENSE. Do not contribute if this license does not suit your code -* If you are interested in working on this, come to the PolyMC Discord server and talk first +* If you are interested in working on this, come to the Prism Launcher Discord server and talk first ## Installation diff --git a/libraries/launcher/CMakeLists.txt b/libraries/launcher/CMakeLists.txt index c4dfa5b7..df25414f 100644 --- a/libraries/launcher/CMakeLists.txt +++ b/libraries/launcher/CMakeLists.txt @@ -3,19 +3,19 @@ project(launcher Java) find_package(Java 1.7 REQUIRED COMPONENTS Development) include(UseJava) -set(CMAKE_JAVA_JAR_ENTRY_POINT org.polymc.EntryPoint) +set(CMAKE_JAVA_JAR_ENTRY_POINT org.prismlauncher.EntryPoint) set(CMAKE_JAVA_COMPILE_FLAGS -target 7 -source 7 -Xlint:deprecation -Xlint:unchecked) set(SRC - org/polymc/EntryPoint.java - org/polymc/Launcher.java - org/polymc/LauncherFactory.java - org/polymc/impl/OneSixLauncher.java - org/polymc/applet/LegacyFrame.java - org/polymc/exception/ParameterNotFoundException.java - org/polymc/exception/ParseException.java - org/polymc/utils/Parameters.java - org/polymc/utils/Utils.java + org/prismlauncher/EntryPoint.java + org/prismlauncher/Launcher.java + org/prismlauncher/LauncherFactory.java + org/prismlauncher/impl/OneSixLauncher.java + org/prismlauncher/applet/LegacyFrame.java + org/prismlauncher/exception/ParameterNotFoundException.java + org/prismlauncher/exception/ParseException.java + org/prismlauncher/utils/Parameters.java + org/prismlauncher/utils/Utils.java net/minecraft/Launcher.java ) add_jar(NewLaunch ${SRC}) diff --git a/libraries/launcher/org/polymc/EntryPoint.java b/libraries/launcher/org/polymc/EntryPoint.java deleted file mode 100644 index 20f418eb..00000000 --- a/libraries/launcher/org/polymc/EntryPoint.java +++ /dev/null @@ -1,164 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -/* - * PolyMC - Minecraft Launcher - * Copyright (C) 2022 icelimetea, - * - * 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 - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * conditions of the GNU General Public License cover the whole - * combination. - * - * As a special exception, the copyright holders of this library give - * you permission to link this library with independent modules to - * produce an executable, regardless of the license terms of these - * independent modules, and to copy and distribute the resulting - * executable under terms of your choice, provided that you also meet, - * for each linked independent module, the terms and conditions of the - * license of that module. An independent module is a module which is - * not derived from or based on this library. If you modify this - * library, you may extend this exception to your version of the - * library, but you are not obliged to do so. If you do not wish to do - * so, delete this exception statement from your version. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * This file incorporates work covered by the following copyright and - * permission notice: - * - * Copyright 2013-2021 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.polymc; - -import org.polymc.exception.ParseException; -import org.polymc.utils.Parameters; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.util.logging.Level; -import java.util.logging.Logger; - -public final class EntryPoint { - - private static final Logger LOGGER = Logger.getLogger("EntryPoint"); - - private final Parameters params = new Parameters(); - - public static void main(String[] args) { - EntryPoint listener = new EntryPoint(); - - int retCode = listener.listen(); - - if (retCode != 0) { - LOGGER.info("Exiting with " + retCode); - - System.exit(retCode); - } - } - - private Action parseLine(String inData) throws ParseException { - String[] tokens = inData.split("\\s+", 2); - - if (tokens.length == 0) - throw new ParseException("Unexpected empty string!"); - - switch (tokens[0]) { - case "launch": { - return Action.Launch; - } - - case "abort": { - return Action.Abort; - } - - default: { - if (tokens.length != 2) - throw new ParseException("Error while parsing:" + inData); - - params.add(tokens[0], tokens[1]); - - return Action.Proceed; - } - } - } - - public int listen() { - Action action = Action.Proceed; - - try (BufferedReader reader = new BufferedReader(new InputStreamReader( - System.in, - StandardCharsets.UTF_8 - ))) { - String line; - - while (action == Action.Proceed) { - if ((line = reader.readLine()) != null) { - action = parseLine(line); - } else { - action = Action.Abort; - } - } - } catch (IOException | ParseException e) { - LOGGER.log(Level.SEVERE, "Launcher ABORT due to exception:", e); - - return 1; - } - - // Main loop - if (action == Action.Abort) { - LOGGER.info("Launch aborted by the launcher."); - - return 1; - } - - try { - Launcher launcher = - LauncherFactory - .getInstance() - .createLauncher(params); - - launcher.launch(); - - return 0; - } catch (IllegalArgumentException e) { - LOGGER.log(Level.SEVERE, "Wrong argument.", e); - - return 1; - } catch (Exception e) { - LOGGER.log(Level.SEVERE, "Exception caught from launcher.", e); - - return 1; - } - } - - private enum Action { - Proceed, - Launch, - Abort - } - -} diff --git a/libraries/launcher/org/polymc/Launcher.java b/libraries/launcher/org/polymc/Launcher.java deleted file mode 100644 index 5bff123e..00000000 --- a/libraries/launcher/org/polymc/Launcher.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2012-2021 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.polymc; - -public interface Launcher { - - void launch() throws Exception; - -} diff --git a/libraries/launcher/org/polymc/LauncherFactory.java b/libraries/launcher/org/polymc/LauncherFactory.java deleted file mode 100644 index 86862929..00000000 --- a/libraries/launcher/org/polymc/LauncherFactory.java +++ /dev/null @@ -1,80 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -/* - * PolyMC - Minecraft Launcher - * Copyright (C) 2022 icelimetea, - * - * 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 - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Linking this library statically or dynamically with other modules is - * making a combined work based on this library. Thus, the terms and - * conditions of the GNU General Public License cover the whole - * combination. - * - * As a special exception, the copyright holders of this library give - * you permission to link this library with independent modules to - * produce an executable, regardless of the license terms of these - * independent modules, and to copy and distribute the resulting - * executable under terms of your choice, provided that you also meet, - * for each linked independent module, the terms and conditions of the - * license of that module. An independent module is a module which is - * not derived from or based on this library. If you modify this - * library, you may extend this exception to your version of the - * library, but you are not obliged to do so. If you do not wish to do - * so, delete this exception statement from your version. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.polymc; - -import org.polymc.impl.OneSixLauncher; -import org.polymc.utils.Parameters; - -import java.util.HashMap; -import java.util.Map; - -public final class LauncherFactory { - - private static final LauncherFactory INSTANCE = new LauncherFactory(); - - private final Map launcherRegistry = new HashMap<>(); - - private LauncherFactory() { - launcherRegistry.put("onesix", new LauncherProvider() { - @Override - public Launcher provide(Parameters parameters) { - return new OneSixLauncher(parameters); - } - }); - } - - public Launcher createLauncher(Parameters parameters) { - String name = parameters.first("launcher"); - - LauncherProvider launcherProvider = launcherRegistry.get(name); - - if (launcherProvider == null) - throw new IllegalArgumentException("Invalid launcher type: " + name); - - return launcherProvider.provide(parameters); - } - - public static LauncherFactory getInstance() { - return INSTANCE; - } - - public interface LauncherProvider { - - Launcher provide(Parameters parameters); - - } - -} diff --git a/libraries/launcher/org/polymc/applet/LegacyFrame.java b/libraries/launcher/org/polymc/applet/LegacyFrame.java deleted file mode 100644 index 7ae56e60..00000000 --- a/libraries/launcher/org/polymc/applet/LegacyFrame.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright 2012-2021 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.polymc.applet; - -import net.minecraft.Launcher; - -import javax.imageio.ImageIO; -import java.applet.Applet; -import java.awt.*; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; - -public final class LegacyFrame extends Frame { - - private static final Logger LOGGER = Logger.getLogger("LegacyFrame"); - - private final Launcher appletWrap; - - public LegacyFrame(String title, Applet mcApplet) { - super(title); - - appletWrap = new Launcher(mcApplet); - - mcApplet.setStub(appletWrap); - - try { - setIconImage(ImageIO.read(new File("icon.png"))); - } catch (IOException e) { - LOGGER.log(Level.WARNING, "Unable to read Minecraft icon!", e); - } - - addWindowListener(new ForceExitHandler()); - } - - public void start ( - String user, - String session, - int winSizeW, - int winSizeH, - boolean maximize, - String serverAddress, - String serverPort, - boolean isDemo - ) { - // Implements support for launching in to multiplayer on classic servers using a mpticket - // file generated by an external program and stored in the instance's root folder. - - Path mpticketFile = - Paths.get(System.getProperty("user.dir"), "..", "mpticket"); - - Path mpticketFileCorrupt = - Paths.get(System.getProperty("user.dir"), "..", "mpticket.corrupt"); - - if (Files.exists(mpticketFile)) { - try { - List lines = Files.readAllLines(mpticketFile, StandardCharsets.UTF_8); - - if (lines.size() < 3) { - Files.move( - mpticketFile, - mpticketFileCorrupt, - StandardCopyOption.REPLACE_EXISTING - ); - - LOGGER.warning("Mpticket file is corrupted!"); - } else { - // Assumes parameters are valid and in the correct order - appletWrap.setParameter("server", lines.get(0)); - appletWrap.setParameter("port", lines.get(1)); - appletWrap.setParameter("mppass", lines.get(2)); - } - } catch (IOException e) { - LOGGER.log(Level.WARNING, "Unable to read mpticket file!", e); - } - } - - if (serverAddress != null) { - appletWrap.setParameter("server", serverAddress); - appletWrap.setParameter("port", serverPort); - } - - appletWrap.setParameter("username", user); - appletWrap.setParameter("sessionid", session); - appletWrap.setParameter("stand-alone", "true"); // Show the quit button. - appletWrap.setParameter("haspaid", "true"); // Some old versions need this for world saves to work. - appletWrap.setParameter("demo", isDemo ? "true" : "false"); - appletWrap.setParameter("fullscreen", "false"); - - add(appletWrap); - - appletWrap.setPreferredSize(new Dimension(winSizeW, winSizeH)); - - pack(); - - setLocationRelativeTo(null); - setResizable(true); - - if (maximize) - this.setExtendedState(MAXIMIZED_BOTH); - - validate(); - - appletWrap.init(); - appletWrap.start(); - - setVisible(true); - } - - private final class ForceExitHandler extends WindowAdapter { - - @Override - public void windowClosing(WindowEvent e) { - new Thread(new Runnable() { - @Override - public void run() { - try { - Thread.sleep(30000L); - } catch (InterruptedException localInterruptedException) { - localInterruptedException.printStackTrace(); - } - - LOGGER.info("Forcing exit!"); - - System.exit(0); - } - }).start(); - - if (appletWrap != null) { - appletWrap.stop(); - appletWrap.destroy(); - } - - // old minecraft versions can hang without this >_< - System.exit(0); - } - - } - -} diff --git a/libraries/launcher/org/polymc/exception/ParameterNotFoundException.java b/libraries/launcher/org/polymc/exception/ParameterNotFoundException.java deleted file mode 100644 index 2044814e..00000000 --- a/libraries/launcher/org/polymc/exception/ParameterNotFoundException.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012-2021 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.polymc.exception; - -public final class ParameterNotFoundException extends IllegalArgumentException { - - public ParameterNotFoundException(String key) { - super("Unknown parameter name: " + key); - } - -} diff --git a/libraries/launcher/org/polymc/exception/ParseException.java b/libraries/launcher/org/polymc/exception/ParseException.java deleted file mode 100644 index 2f2f8294..00000000 --- a/libraries/launcher/org/polymc/exception/ParseException.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012-2021 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.polymc.exception; - -public final class ParseException extends IllegalArgumentException { - - public ParseException(String message) { - super(message); - } - -} diff --git a/libraries/launcher/org/polymc/impl/OneSixLauncher.java b/libraries/launcher/org/polymc/impl/OneSixLauncher.java deleted file mode 100644 index d43101eb..00000000 --- a/libraries/launcher/org/polymc/impl/OneSixLauncher.java +++ /dev/null @@ -1,190 +0,0 @@ -/* Copyright 2012-2021 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.polymc.impl; - -import org.polymc.Launcher; -import org.polymc.applet.LegacyFrame; -import org.polymc.utils.Parameters; -import org.polymc.utils.Utils; - -import java.applet.Applet; -import java.io.File; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.List; -import java.util.ArrayList; -import java.util.logging.Level; -import java.util.logging.Logger; - -public final class OneSixLauncher implements Launcher { - - private static final int DEFAULT_WINDOW_WIDTH = 854; - private static final int DEFAULT_WINDOW_HEIGHT = 480; - - private static final Logger LOGGER = Logger.getLogger("OneSixLauncher"); - - // parameters, separated from ParamBucket - private final List mcParams; - private final List traits; - private final String appletClass; - private final String mainClass; - private final String userName, sessionId; - private final String windowTitle; - - // secondary parameters - private final int winSizeW; - private final int winSizeH; - private final boolean maximize; - private final String cwd; - - private final String serverAddress; - private final String serverPort; - - private final ClassLoader classLoader; - - public OneSixLauncher(Parameters params) { - classLoader = ClassLoader.getSystemClassLoader(); - - mcParams = params.allSafe("param", new ArrayList()); - mainClass = params.firstSafe("mainClass", "net.minecraft.client.Minecraft"); - appletClass = params.firstSafe("appletClass", "net.minecraft.client.MinecraftApplet"); - traits = params.allSafe("traits", new ArrayList()); - - userName = params.first("userName"); - sessionId = params.first("sessionId"); - windowTitle = params.firstSafe("windowTitle", "Minecraft"); - - serverAddress = params.firstSafe("serverAddress", null); - serverPort = params.firstSafe("serverPort", null); - - cwd = System.getProperty("user.dir"); - - String windowParams = params.firstSafe("windowParams", null); - - if (windowParams != null) { - String[] dimStrings = windowParams.split("x"); - - if (windowParams.equalsIgnoreCase("max")) { - maximize = true; - - winSizeW = DEFAULT_WINDOW_WIDTH; - winSizeH = DEFAULT_WINDOW_HEIGHT; - } else if (dimStrings.length == 2) { - maximize = false; - - winSizeW = Integer.parseInt(dimStrings[0]); - winSizeH = Integer.parseInt(dimStrings[1]); - } else { - throw new IllegalArgumentException("Unexpected window size parameter value: " + windowParams); - } - } else { - maximize = false; - - winSizeW = DEFAULT_WINDOW_WIDTH; - winSizeH = DEFAULT_WINDOW_HEIGHT; - } - } - - private void invokeMain(Class mainClass) throws Exception { - Method method = mainClass.getMethod("main", String[].class); - - method.invoke(null, (Object) mcParams.toArray(new String[0])); - } - - private void legacyLaunch() throws Exception { - // Get the Minecraft Class and set the base folder - Class minecraftClass = classLoader.loadClass(mainClass); - - Field baseDirField = Utils.getMinecraftBaseDirField(minecraftClass); - - if (baseDirField == null) { - LOGGER.warning("Could not find Minecraft path field."); - } else { - baseDirField.setAccessible(true); - - baseDirField.set(null, new File(cwd)); - } - - System.setProperty("minecraft.applet.TargetDirectory", cwd); - - if (!traits.contains("noapplet")) { - LOGGER.info("Launching with applet wrapper..."); - - try { - Class mcAppletClass = classLoader.loadClass(appletClass); - - Applet mcApplet = (Applet) mcAppletClass.getConstructor().newInstance(); - - LegacyFrame mcWindow = new LegacyFrame(windowTitle, mcApplet); - - mcWindow.start( - userName, - sessionId, - winSizeW, - winSizeH, - maximize, - serverAddress, - serverPort, - mcParams.contains("--demo") - ); - - return; - } catch (Exception e) { - LOGGER.log(Level.SEVERE, "Applet wrapper failed: ", e); - - LOGGER.warning("Falling back to using main class."); - } - } - - invokeMain(minecraftClass); - } - - private void launchWithMainClass() throws Exception { - // window size, title and state, onesix - - // FIXME: there is no good way to maximize the minecraft window in onesix. - // the following often breaks linux screen setups - // mcparams.add("--fullscreen"); - - if (!maximize) { - mcParams.add("--width"); - mcParams.add(Integer.toString(winSizeW)); - mcParams.add("--height"); - mcParams.add(Integer.toString(winSizeH)); - } - - if (serverAddress != null) { - mcParams.add("--server"); - mcParams.add(serverAddress); - mcParams.add("--port"); - mcParams.add(serverPort); - } - - invokeMain(classLoader.loadClass(mainClass)); - } - - @Override - public void launch() throws Exception { - if (traits.contains("legacyLaunch") || traits.contains("alphaLaunch")) { - // legacy launch uses the applet wrapper - legacyLaunch(); - } else { - // normal launch just calls main() - launchWithMainClass(); - } - } - -} diff --git a/libraries/launcher/org/polymc/utils/Parameters.java b/libraries/launcher/org/polymc/utils/Parameters.java deleted file mode 100644 index 864d3cd2..00000000 --- a/libraries/launcher/org/polymc/utils/Parameters.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2012-2021 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.polymc.utils; - -import org.polymc.exception.ParameterNotFoundException; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public final class Parameters { - - private final Map> paramsMap = new HashMap<>(); - - public void add(String key, String value) { - List params = paramsMap.get(key); - - if (params == null) { - params = new ArrayList<>(); - - paramsMap.put(key, params); - } - - params.add(value); - } - - public List all(String key) throws ParameterNotFoundException { - List params = paramsMap.get(key); - - if (params == null) - throw new ParameterNotFoundException(key); - - return params; - } - - public List allSafe(String key, List def) { - List params = paramsMap.get(key); - - if (params == null || params.isEmpty()) - return def; - - return params; - } - - public String first(String key) throws ParameterNotFoundException { - List list = all(key); - - if (list.isEmpty()) - throw new ParameterNotFoundException(key); - - return list.get(0); - } - - public String firstSafe(String key, String def) { - List params = paramsMap.get(key); - - if (params == null || params.isEmpty()) - return def; - - return params.get(0); - } - -} diff --git a/libraries/launcher/org/polymc/utils/Utils.java b/libraries/launcher/org/polymc/utils/Utils.java deleted file mode 100644 index 12d6e1aa..00000000 --- a/libraries/launcher/org/polymc/utils/Utils.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012-2021 MultiMC Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.polymc.utils; - -import java.io.File; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; - -public final class Utils { - - private Utils() {} - - /** - * Finds a field that looks like a Minecraft base folder in a supplied class - * - * @param clazz the class to scan - */ - public static Field getMinecraftBaseDirField(Class clazz) { - for (Field f : clazz.getDeclaredFields()) { - // Has to be File - if (f.getType() != File.class) - continue; - - // And Private Static. - if (!Modifier.isStatic(f.getModifiers()) || !Modifier.isPrivate(f.getModifiers())) - continue; - - return f; - } - - return null; - } - -} - diff --git a/libraries/launcher/org/prismlauncher/EntryPoint.java b/libraries/launcher/org/prismlauncher/EntryPoint.java new file mode 100644 index 00000000..9144e1f1 --- /dev/null +++ b/libraries/launcher/org/prismlauncher/EntryPoint.java @@ -0,0 +1,164 @@ +// SPDX-License-Identifier: GPL-3.0-only +/* + * PolyMC - Minecraft Launcher + * Copyright (C) 2022 icelimetea, + * + * 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 + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Linking this library statically or dynamically with other modules is + * making a combined work based on this library. Thus, the terms and + * conditions of the GNU General Public License cover the whole + * combination. + * + * As a special exception, the copyright holders of this library give + * you permission to link this library with independent modules to + * produce an executable, regardless of the license terms of these + * independent modules, and to copy and distribute the resulting + * executable under terms of your choice, provided that you also meet, + * for each linked independent module, the terms and conditions of the + * license of that module. An independent module is a module which is + * not derived from or based on this library. If you modify this + * library, you may extend this exception to your version of the + * library, but you are not obliged to do so. If you do not wish to do + * so, delete this exception statement from your version. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright 2013-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.prismlauncher; + +import org.prismlauncher.exception.ParseException; +import org.prismlauncher.utils.Parameters; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.logging.Level; +import java.util.logging.Logger; + +public final class EntryPoint { + + private static final Logger LOGGER = Logger.getLogger("EntryPoint"); + + private final Parameters params = new Parameters(); + + public static void main(String[] args) { + EntryPoint listener = new EntryPoint(); + + int retCode = listener.listen(); + + if (retCode != 0) { + LOGGER.info("Exiting with " + retCode); + + System.exit(retCode); + } + } + + private Action parseLine(String inData) throws ParseException { + String[] tokens = inData.split("\\s+", 2); + + if (tokens.length == 0) + throw new ParseException("Unexpected empty string!"); + + switch (tokens[0]) { + case "launch": { + return Action.Launch; + } + + case "abort": { + return Action.Abort; + } + + default: { + if (tokens.length != 2) + throw new ParseException("Error while parsing:" + inData); + + params.add(tokens[0], tokens[1]); + + return Action.Proceed; + } + } + } + + public int listen() { + Action action = Action.Proceed; + + try (BufferedReader reader = new BufferedReader(new InputStreamReader( + System.in, + StandardCharsets.UTF_8 + ))) { + String line; + + while (action == Action.Proceed) { + if ((line = reader.readLine()) != null) { + action = parseLine(line); + } else { + action = Action.Abort; + } + } + } catch (IOException | ParseException e) { + LOGGER.log(Level.SEVERE, "Launcher ABORT due to exception:", e); + + return 1; + } + + // Main loop + if (action == Action.Abort) { + LOGGER.info("Launch aborted by the launcher."); + + return 1; + } + + try { + Launcher launcher = + LauncherFactory + .getInstance() + .createLauncher(params); + + launcher.launch(); + + return 0; + } catch (IllegalArgumentException e) { + LOGGER.log(Level.SEVERE, "Wrong argument.", e); + + return 1; + } catch (Exception e) { + LOGGER.log(Level.SEVERE, "Exception caught from launcher.", e); + + return 1; + } + } + + private enum Action { + Proceed, + Launch, + Abort + } + +} diff --git a/libraries/launcher/org/prismlauncher/Launcher.java b/libraries/launcher/org/prismlauncher/Launcher.java new file mode 100644 index 00000000..7f25717b --- /dev/null +++ b/libraries/launcher/org/prismlauncher/Launcher.java @@ -0,0 +1,23 @@ +/* + * Copyright 2012-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.prismlauncher; + +public interface Launcher { + + void launch() throws Exception; + +} diff --git a/libraries/launcher/org/prismlauncher/LauncherFactory.java b/libraries/launcher/org/prismlauncher/LauncherFactory.java new file mode 100644 index 00000000..98f2bbba --- /dev/null +++ b/libraries/launcher/org/prismlauncher/LauncherFactory.java @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: GPL-3.0-only +/* + * PolyMC - Minecraft Launcher + * Copyright (C) 2022 icelimetea, + * + * 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 + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Linking this library statically or dynamically with other modules is + * making a combined work based on this library. Thus, the terms and + * conditions of the GNU General Public License cover the whole + * combination. + * + * As a special exception, the copyright holders of this library give + * you permission to link this library with independent modules to + * produce an executable, regardless of the license terms of these + * independent modules, and to copy and distribute the resulting + * executable under terms of your choice, provided that you also meet, + * for each linked independent module, the terms and conditions of the + * license of that module. An independent module is a module which is + * not derived from or based on this library. If you modify this + * library, you may extend this exception to your version of the + * library, but you are not obliged to do so. If you do not wish to do + * so, delete this exception statement from your version. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.prismlauncher; + +import org.prismlauncher.impl.OneSixLauncher; +import org.prismlauncher.utils.Parameters; + +import java.util.HashMap; +import java.util.Map; + +public final class LauncherFactory { + + private static final LauncherFactory INSTANCE = new LauncherFactory(); + + private final Map launcherRegistry = new HashMap<>(); + + private LauncherFactory() { + launcherRegistry.put("onesix", new LauncherProvider() { + @Override + public Launcher provide(Parameters parameters) { + return new OneSixLauncher(parameters); + } + }); + } + + public Launcher createLauncher(Parameters parameters) { + String name = parameters.first("launcher"); + + LauncherProvider launcherProvider = launcherRegistry.get(name); + + if (launcherProvider == null) + throw new IllegalArgumentException("Invalid launcher type: " + name); + + return launcherProvider.provide(parameters); + } + + public static LauncherFactory getInstance() { + return INSTANCE; + } + + public interface LauncherProvider { + + Launcher provide(Parameters parameters); + + } + +} diff --git a/libraries/launcher/org/prismlauncher/applet/LegacyFrame.java b/libraries/launcher/org/prismlauncher/applet/LegacyFrame.java new file mode 100644 index 00000000..4413efa8 --- /dev/null +++ b/libraries/launcher/org/prismlauncher/applet/LegacyFrame.java @@ -0,0 +1,163 @@ +/* + * Copyright 2012-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.prismlauncher.applet; + +import net.minecraft.Launcher; + +import javax.imageio.ImageIO; +import java.applet.Applet; +import java.awt.*; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +public final class LegacyFrame extends Frame { + + private static final Logger LOGGER = Logger.getLogger("LegacyFrame"); + + private final Launcher appletWrap; + + public LegacyFrame(String title, Applet mcApplet) { + super(title); + + appletWrap = new Launcher(mcApplet); + + mcApplet.setStub(appletWrap); + + try { + setIconImage(ImageIO.read(new File("icon.png"))); + } catch (IOException e) { + LOGGER.log(Level.WARNING, "Unable to read Minecraft icon!", e); + } + + addWindowListener(new ForceExitHandler()); + } + + public void start ( + String user, + String session, + int winSizeW, + int winSizeH, + boolean maximize, + String serverAddress, + String serverPort, + boolean isDemo + ) { + // Implements support for launching in to multiplayer on classic servers using a mpticket + // file generated by an external program and stored in the instance's root folder. + + Path mpticketFile = + Paths.get(System.getProperty("user.dir"), "..", "mpticket"); + + Path mpticketFileCorrupt = + Paths.get(System.getProperty("user.dir"), "..", "mpticket.corrupt"); + + if (Files.exists(mpticketFile)) { + try { + List lines = Files.readAllLines(mpticketFile, StandardCharsets.UTF_8); + + if (lines.size() < 3) { + Files.move( + mpticketFile, + mpticketFileCorrupt, + StandardCopyOption.REPLACE_EXISTING + ); + + LOGGER.warning("Mpticket file is corrupted!"); + } else { + // Assumes parameters are valid and in the correct order + appletWrap.setParameter("server", lines.get(0)); + appletWrap.setParameter("port", lines.get(1)); + appletWrap.setParameter("mppass", lines.get(2)); + } + } catch (IOException e) { + LOGGER.log(Level.WARNING, "Unable to read mpticket file!", e); + } + } + + if (serverAddress != null) { + appletWrap.setParameter("server", serverAddress); + appletWrap.setParameter("port", serverPort); + } + + appletWrap.setParameter("username", user); + appletWrap.setParameter("sessionid", session); + appletWrap.setParameter("stand-alone", "true"); // Show the quit button. + appletWrap.setParameter("haspaid", "true"); // Some old versions need this for world saves to work. + appletWrap.setParameter("demo", isDemo ? "true" : "false"); + appletWrap.setParameter("fullscreen", "false"); + + add(appletWrap); + + appletWrap.setPreferredSize(new Dimension(winSizeW, winSizeH)); + + pack(); + + setLocationRelativeTo(null); + setResizable(true); + + if (maximize) + this.setExtendedState(MAXIMIZED_BOTH); + + validate(); + + appletWrap.init(); + appletWrap.start(); + + setVisible(true); + } + + private final class ForceExitHandler extends WindowAdapter { + + @Override + public void windowClosing(WindowEvent e) { + new Thread(new Runnable() { + @Override + public void run() { + try { + Thread.sleep(30000L); + } catch (InterruptedException localInterruptedException) { + localInterruptedException.printStackTrace(); + } + + LOGGER.info("Forcing exit!"); + + System.exit(0); + } + }).start(); + + if (appletWrap != null) { + appletWrap.stop(); + appletWrap.destroy(); + } + + // old minecraft versions can hang without this >_< + System.exit(0); + } + + } + +} diff --git a/libraries/launcher/org/prismlauncher/exception/ParameterNotFoundException.java b/libraries/launcher/org/prismlauncher/exception/ParameterNotFoundException.java new file mode 100644 index 00000000..641e0c99 --- /dev/null +++ b/libraries/launcher/org/prismlauncher/exception/ParameterNotFoundException.java @@ -0,0 +1,25 @@ +/* + * Copyright 2012-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.prismlauncher.exception; + +public final class ParameterNotFoundException extends IllegalArgumentException { + + public ParameterNotFoundException(String key) { + super("Unknown parameter name: " + key); + } + +} diff --git a/libraries/launcher/org/prismlauncher/exception/ParseException.java b/libraries/launcher/org/prismlauncher/exception/ParseException.java new file mode 100644 index 00000000..51d25a62 --- /dev/null +++ b/libraries/launcher/org/prismlauncher/exception/ParseException.java @@ -0,0 +1,25 @@ +/* + * Copyright 2012-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.prismlauncher.exception; + +public final class ParseException extends IllegalArgumentException { + + public ParseException(String message) { + super(message); + } + +} diff --git a/libraries/launcher/org/prismlauncher/impl/OneSixLauncher.java b/libraries/launcher/org/prismlauncher/impl/OneSixLauncher.java new file mode 100644 index 00000000..d6443826 --- /dev/null +++ b/libraries/launcher/org/prismlauncher/impl/OneSixLauncher.java @@ -0,0 +1,190 @@ +/* Copyright 2012-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.prismlauncher.impl; + +import org.prismlauncher.Launcher; +import org.prismlauncher.applet.LegacyFrame; +import org.prismlauncher.utils.Parameters; +import org.prismlauncher.utils.Utils; + +import java.applet.Applet; +import java.io.File; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.List; +import java.util.ArrayList; +import java.util.logging.Level; +import java.util.logging.Logger; + +public final class OneSixLauncher implements Launcher { + + private static final int DEFAULT_WINDOW_WIDTH = 854; + private static final int DEFAULT_WINDOW_HEIGHT = 480; + + private static final Logger LOGGER = Logger.getLogger("OneSixLauncher"); + + // parameters, separated from ParamBucket + private final List mcParams; + private final List traits; + private final String appletClass; + private final String mainClass; + private final String userName, sessionId; + private final String windowTitle; + + // secondary parameters + private final int winSizeW; + private final int winSizeH; + private final boolean maximize; + private final String cwd; + + private final String serverAddress; + private final String serverPort; + + private final ClassLoader classLoader; + + public OneSixLauncher(Parameters params) { + classLoader = ClassLoader.getSystemClassLoader(); + + mcParams = params.allSafe("param", new ArrayList()); + mainClass = params.firstSafe("mainClass", "net.minecraft.client.Minecraft"); + appletClass = params.firstSafe("appletClass", "net.minecraft.client.MinecraftApplet"); + traits = params.allSafe("traits", new ArrayList()); + + userName = params.first("userName"); + sessionId = params.first("sessionId"); + windowTitle = params.firstSafe("windowTitle", "Minecraft"); + + serverAddress = params.firstSafe("serverAddress", null); + serverPort = params.firstSafe("serverPort", null); + + cwd = System.getProperty("user.dir"); + + String windowParams = params.firstSafe("windowParams", null); + + if (windowParams != null) { + String[] dimStrings = windowParams.split("x"); + + if (windowParams.equalsIgnoreCase("max")) { + maximize = true; + + winSizeW = DEFAULT_WINDOW_WIDTH; + winSizeH = DEFAULT_WINDOW_HEIGHT; + } else if (dimStrings.length == 2) { + maximize = false; + + winSizeW = Integer.parseInt(dimStrings[0]); + winSizeH = Integer.parseInt(dimStrings[1]); + } else { + throw new IllegalArgumentException("Unexpected window size parameter value: " + windowParams); + } + } else { + maximize = false; + + winSizeW = DEFAULT_WINDOW_WIDTH; + winSizeH = DEFAULT_WINDOW_HEIGHT; + } + } + + private void invokeMain(Class mainClass) throws Exception { + Method method = mainClass.getMethod("main", String[].class); + + method.invoke(null, (Object) mcParams.toArray(new String[0])); + } + + private void legacyLaunch() throws Exception { + // Get the Minecraft Class and set the base folder + Class minecraftClass = classLoader.loadClass(mainClass); + + Field baseDirField = Utils.getMinecraftBaseDirField(minecraftClass); + + if (baseDirField == null) { + LOGGER.warning("Could not find Minecraft path field."); + } else { + baseDirField.setAccessible(true); + + baseDirField.set(null, new File(cwd)); + } + + System.setProperty("minecraft.applet.TargetDirectory", cwd); + + if (!traits.contains("noapplet")) { + LOGGER.info("Launching with applet wrapper..."); + + try { + Class mcAppletClass = classLoader.loadClass(appletClass); + + Applet mcApplet = (Applet) mcAppletClass.getConstructor().newInstance(); + + LegacyFrame mcWindow = new LegacyFrame(windowTitle, mcApplet); + + mcWindow.start( + userName, + sessionId, + winSizeW, + winSizeH, + maximize, + serverAddress, + serverPort, + mcParams.contains("--demo") + ); + + return; + } catch (Exception e) { + LOGGER.log(Level.SEVERE, "Applet wrapper failed: ", e); + + LOGGER.warning("Falling back to using main class."); + } + } + + invokeMain(minecraftClass); + } + + private void launchWithMainClass() throws Exception { + // window size, title and state, onesix + + // FIXME: there is no good way to maximize the minecraft window in onesix. + // the following often breaks linux screen setups + // mcparams.add("--fullscreen"); + + if (!maximize) { + mcParams.add("--width"); + mcParams.add(Integer.toString(winSizeW)); + mcParams.add("--height"); + mcParams.add(Integer.toString(winSizeH)); + } + + if (serverAddress != null) { + mcParams.add("--server"); + mcParams.add(serverAddress); + mcParams.add("--port"); + mcParams.add(serverPort); + } + + invokeMain(classLoader.loadClass(mainClass)); + } + + @Override + public void launch() throws Exception { + if (traits.contains("legacyLaunch") || traits.contains("alphaLaunch")) { + // legacy launch uses the applet wrapper + legacyLaunch(); + } else { + // normal launch just calls main() + launchWithMainClass(); + } + } + +} diff --git a/libraries/launcher/org/prismlauncher/utils/Parameters.java b/libraries/launcher/org/prismlauncher/utils/Parameters.java new file mode 100644 index 00000000..98a40c28 --- /dev/null +++ b/libraries/launcher/org/prismlauncher/utils/Parameters.java @@ -0,0 +1,78 @@ +/* + * Copyright 2012-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.prismlauncher.utils; + +import org.prismlauncher.exception.ParameterNotFoundException; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public final class Parameters { + + private final Map> paramsMap = new HashMap<>(); + + public void add(String key, String value) { + List params = paramsMap.get(key); + + if (params == null) { + params = new ArrayList<>(); + + paramsMap.put(key, params); + } + + params.add(value); + } + + public List all(String key) throws ParameterNotFoundException { + List params = paramsMap.get(key); + + if (params == null) + throw new ParameterNotFoundException(key); + + return params; + } + + public List allSafe(String key, List def) { + List params = paramsMap.get(key); + + if (params == null || params.isEmpty()) + return def; + + return params; + } + + public String first(String key) throws ParameterNotFoundException { + List list = all(key); + + if (list.isEmpty()) + throw new ParameterNotFoundException(key); + + return list.get(0); + } + + public String firstSafe(String key, String def) { + List params = paramsMap.get(key); + + if (params == null || params.isEmpty()) + return def; + + return params.get(0); + } + +} diff --git a/libraries/launcher/org/prismlauncher/utils/Utils.java b/libraries/launcher/org/prismlauncher/utils/Utils.java new file mode 100644 index 00000000..ae9a4de2 --- /dev/null +++ b/libraries/launcher/org/prismlauncher/utils/Utils.java @@ -0,0 +1,49 @@ +/* + * Copyright 2012-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.prismlauncher.utils; + +import java.io.File; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +public final class Utils { + + private Utils() {} + + /** + * Finds a field that looks like a Minecraft base folder in a supplied class + * + * @param clazz the class to scan + */ + public static Field getMinecraftBaseDirField(Class clazz) { + for (Field f : clazz.getDeclaredFields()) { + // Has to be File + if (f.getType() != File.class) + continue; + + // And Private Static. + if (!Modifier.isStatic(f.getModifiers()) || !Modifier.isPrivate(f.getModifiers())) + continue; + + return f; + } + + return null; + } + +} + diff --git a/nix/NIX.md b/nix/NIX.md index 047dd82f..e57d5be7 100644 --- a/nix/NIX.md +++ b/nix/NIX.md @@ -5,22 +5,22 @@ To import with flakes use ```nix { inputs = { - polymc.url = "github:PolyMC/PolyMC"; + prismlauncher.url = "github:PrismLauncher/PrismLauncher"; }; ... - nixpkgs.overlays = [ inputs.polymc.overlay ]; ## Within configuration.nix - environment.systemPackages = with pkgs; [ polymc ]; ## + nixpkgs.overlays = [ inputs.prismlauncher.overlay ]; ## Within configuration.nix + environment.systemPackages = with pkgs; [ prismlauncher ]; ## } ``` To import without flakes use channels: ```sh -nix-channel --add https://github.com/PolyMC/PolyMC/archive/master.tar.gz polymc -nix-channel --update polymc -nix-env -iA polymc +nix-channel --add https://github.com/PrismLauncher/PrismLauncher/archive/master.tar.gz prismlauncher +nix-channel --update prismlauncher +nix-env -iA prismlauncher ``` or alternatively you can use @@ -28,9 +28,9 @@ or alternatively you can use ```nix { nixpkgs.overlays = [ - (import (builtins.fetchTarball "https://github.com/PolyMC/PolyMC/archive/develop.tar.gz")).overlay + (import (builtins.fetchTarball "https://github.com/PrismLauncher/PrismLauncher/archive/develop.tar.gz")).overlay ]; - environment.systemPackages = with pkgs; [ polymc ]; + environment.systemPackages = with pkgs; [ prismlauncher ]; } ``` diff --git a/program_info/prismlauncher.6.scd b/program_info/prismlauncher.6.scd index f0628cc9..e3c7de86 100644 --- a/program_info/prismlauncher.6.scd +++ b/program_info/prismlauncher.6.scd @@ -1,33 +1,33 @@ -polymc(6) +prismlauncher(6) # NAME -polymc - a launcher and instance manager for Minecraft. +prismlauncher - a launcher and instance manager for Minecraft. # SYNOPSIS -*polymc* [OPTIONS...] +*prismlauncher* [OPTIONS...] # DESCRIPTION -PolyMC is a custom launcher for Minecraft that allows you to easily manage +Prism Launcher is a custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once. It also allows you to easily install and remove mods by simply dragging and dropping. -Here are the current features of PolyMC. +Here are the current features of Prism Launcher. # OPTIONS *-d, --dir*=DIRECTORY - Use DIRECTORY as the PolyMC root. + Use DIRECTORY as the Prism Launcher root. *-l, --launch*=INSTANCE_ID Launch the instance specified by INSTANCE_ID. *--alive* - Write a small 'live.check' file after PolyMC starts. + Write a small 'live.check' file after Prism Launcher starts. *-h, --help* Display help text and exit. @@ -48,14 +48,14 @@ Here are the current features of PolyMC. # BUGS -https://github.com/PolyMC/PolyMC/issues +https://github.com/PrismLauncher/PrismLauncher/issues # RESOURCES -GitHub: https://github.com/PolyMC/PolyMC +GitHub: https://github.com/PrismLauncher/PrismLauncher -Main website: https://polymc.org +Main website: https://prismlauncher.org # AUTHORS -PolyMC Contributors +Prism Launcher Contributors -- cgit From 61fbc5a7919c6c7747ee8e2e551fb63f3a4c59fb Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Tue, 18 Oct 2022 23:13:46 +0200 Subject: refactor: replace with new logo Signed-off-by: Sefa Eyeoglu --- README.md | 7 +- launcher/resources/OSX/scalable/launcher.svg | 66 +++- launcher/resources/flat/scalable/launcher.svg | 66 +++- launcher/resources/iOS/scalable/launcher.svg | 66 +++- launcher/resources/multimc/multimc.qrc | 2 +- .../multimc/scalable/instances/polymc.svg | 21 -- .../multimc/scalable/instances/prismlauncher.svg | 18 + launcher/resources/multimc/scalable/launcher.svg | 66 +++- launcher/resources/pe_blue/scalable/launcher.svg | 66 +++- .../resources/pe_colored/scalable/launcher.svg | 66 +++- launcher/resources/pe_dark/scalable/launcher.svg | 66 +++- launcher/resources/pe_light/scalable/launcher.svg | 66 +++- launcher/ui/dialogs/AboutDialog.cpp | 16 +- .../org.prismlauncher.PrismLauncher.Social.svg | 60 ++++ .../org.prismlauncher.PrismLauncher.Source.svg | 400 +++++++++------------ .../org.prismlauncher.PrismLauncher.bigsur.svg | 390 ++++++++++++-------- ...g.prismlauncher.PrismLauncher.logo-darkmode.svg | 212 +++++++++++ ...org.prismlauncher.PrismLauncher.logo.source.svg | 256 +++++++++++++ .../org.prismlauncher.PrismLauncher.logo.svg | 72 ++++ program_info/org.prismlauncher.PrismLauncher.svg | 70 +++- program_info/prismlauncher-header-black.svg | 23 -- program_info/prismlauncher-header.Source.svg | 139 ------- program_info/prismlauncher-header.svg | 23 -- program_info/prismlauncher-monochrome.Source.svg | 207 +++++++++++ program_info/prismlauncher.icns | Bin 518794 -> 400974 bytes program_info/prismlauncher.ico | Bin 102134 -> 102134 bytes 26 files changed, 1703 insertions(+), 741 deletions(-) delete mode 100644 launcher/resources/multimc/scalable/instances/polymc.svg create mode 100644 launcher/resources/multimc/scalable/instances/prismlauncher.svg create mode 100644 program_info/org.prismlauncher.PrismLauncher.Social.svg create mode 100644 program_info/org.prismlauncher.PrismLauncher.logo-darkmode.svg create mode 100644 program_info/org.prismlauncher.PrismLauncher.logo.source.svg create mode 100644 program_info/org.prismlauncher.PrismLauncher.logo.svg delete mode 100644 program_info/prismlauncher-header-black.svg delete mode 100644 program_info/prismlauncher-header.Source.svg delete mode 100644 program_info/prismlauncher-header.svg create mode 100644 program_info/prismlauncher-monochrome.Source.svg (limited to 'launcher/ui/dialogs') diff --git a/README.md b/README.md index 25509222..47fbcc62 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ -# Prism Launcher +

+Prism Launcher logo +Prism Launcher logo +

Prism Launcher is a custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once. -We are working on a website and other media, for more info we have a [Discord server](https://discord.gg/prismlauncher). Logo and branding are also coming soon. +We are working on a website and other media, for more info we have a [Discord server](https://discord.gg/prismlauncher). ## Installation diff --git a/launcher/resources/OSX/scalable/launcher.svg b/launcher/resources/OSX/scalable/launcher.svg index c192d503..69dd84b1 100644 --- a/launcher/resources/OSX/scalable/launcher.svg +++ b/launcher/resources/OSX/scalable/launcher.svg @@ -1,21 +1,53 @@ - - - - - - - - - - - - - - - - + + Prism Launcher Logo + + + + + + + + + + + - + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + CC BY-SA 4.0 + + + + + Prism Launcher + + + + + diff --git a/launcher/resources/flat/scalable/launcher.svg b/launcher/resources/flat/scalable/launcher.svg index c192d503..69dd84b1 100644 --- a/launcher/resources/flat/scalable/launcher.svg +++ b/launcher/resources/flat/scalable/launcher.svg @@ -1,21 +1,53 @@ - - - - - - - - - - - - - - - - + + Prism Launcher Logo + + + + + + + + + + + - + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + CC BY-SA 4.0 + + + + + Prism Launcher + + + + + diff --git a/launcher/resources/iOS/scalable/launcher.svg b/launcher/resources/iOS/scalable/launcher.svg index c192d503..69dd84b1 100644 --- a/launcher/resources/iOS/scalable/launcher.svg +++ b/launcher/resources/iOS/scalable/launcher.svg @@ -1,21 +1,53 @@ - - - - - - - - - - - - - - - - + + Prism Launcher Logo + + + + + + + + + + + - + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + CC BY-SA 4.0 + + + + + Prism Launcher + + + + + diff --git a/launcher/resources/multimc/multimc.qrc b/launcher/resources/multimc/multimc.qrc index 2337acd6..3f3d22fc 100644 --- a/launcher/resources/multimc/multimc.qrc +++ b/launcher/resources/multimc/multimc.qrc @@ -311,6 +311,6 @@ scalable/instances/fox.svg scalable/instances/bee.svg - scalable/instances/polymc.svg + scalable/instances/prismlauncher.svg diff --git a/launcher/resources/multimc/scalable/instances/polymc.svg b/launcher/resources/multimc/scalable/instances/polymc.svg deleted file mode 100644 index c192d503..00000000 --- a/launcher/resources/multimc/scalable/instances/polymc.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/launcher/resources/multimc/scalable/instances/prismlauncher.svg b/launcher/resources/multimc/scalable/instances/prismlauncher.svg new file mode 100644 index 00000000..93493aab --- /dev/null +++ b/launcher/resources/multimc/scalable/instances/prismlauncher.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/launcher/resources/multimc/scalable/launcher.svg b/launcher/resources/multimc/scalable/launcher.svg index c192d503..69dd84b1 100644 --- a/launcher/resources/multimc/scalable/launcher.svg +++ b/launcher/resources/multimc/scalable/launcher.svg @@ -1,21 +1,53 @@ - - - - - - - - - - - - - - - - + + Prism Launcher Logo + + + + + + + + + + + - + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + CC BY-SA 4.0 + + + + + Prism Launcher + + + + + diff --git a/launcher/resources/pe_blue/scalable/launcher.svg b/launcher/resources/pe_blue/scalable/launcher.svg index c192d503..69dd84b1 100644 --- a/launcher/resources/pe_blue/scalable/launcher.svg +++ b/launcher/resources/pe_blue/scalable/launcher.svg @@ -1,21 +1,53 @@ - - - - - - - - - - - - - - - - + + Prism Launcher Logo + + + + + + + + + + + - + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + CC BY-SA 4.0 + + + + + Prism Launcher + + + + + diff --git a/launcher/resources/pe_colored/scalable/launcher.svg b/launcher/resources/pe_colored/scalable/launcher.svg index c192d503..69dd84b1 100644 --- a/launcher/resources/pe_colored/scalable/launcher.svg +++ b/launcher/resources/pe_colored/scalable/launcher.svg @@ -1,21 +1,53 @@ - - - - - - - - - - - - - - - - + + Prism Launcher Logo + + + + + + + + + + + - + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + CC BY-SA 4.0 + + + + + Prism Launcher + + + + + diff --git a/launcher/resources/pe_dark/scalable/launcher.svg b/launcher/resources/pe_dark/scalable/launcher.svg index c192d503..69dd84b1 100644 --- a/launcher/resources/pe_dark/scalable/launcher.svg +++ b/launcher/resources/pe_dark/scalable/launcher.svg @@ -1,21 +1,53 @@ - - - - - - - - - - - - - - - - + + Prism Launcher Logo + + + + + + + + + + + - + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + CC BY-SA 4.0 + + + + + Prism Launcher + + + + + diff --git a/launcher/resources/pe_light/scalable/launcher.svg b/launcher/resources/pe_light/scalable/launcher.svg index a9dfe87a..69dd84b1 100644 --- a/launcher/resources/pe_light/scalable/launcher.svg +++ b/launcher/resources/pe_light/scalable/launcher.svg @@ -1,21 +1,53 @@ - - - - - - - - - - - - - - - - + + Prism Launcher Logo + + + + + + + + + + + - + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + CC BY-SA 4.0 + + + + + Prism Launcher + + + + + diff --git a/launcher/ui/dialogs/AboutDialog.cpp b/launcher/ui/dialogs/AboutDialog.cpp index 460d25b9..2970d47d 100644 --- a/launcher/ui/dialogs/AboutDialog.cpp +++ b/launcher/ui/dialogs/AboutDialog.cpp @@ -81,9 +81,9 @@ QString getCreditsHtml() //: %1 is the name of the launcher, determined at build time, e.g. "Prism Launcher Contributors" stream << "

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

\n"; - stream << QString("

DioEgizio %1

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

flowln %1

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

swirl %1

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

DioEgizio %1

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

flowln %1

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

swirl %1

\n") .arg(getWebsite("https://swurl.xyz/")); stream << "
\n"; // TODO: possibly retrieve from git history at build time? @@ -97,12 +97,20 @@ QString getCreditsHtml() stream << "
\n"; stream << "

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

\n"; + stream << QString("

Boba %1

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

Davi Rafael %1

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

Fulmine %1

\n") .arg(getWebsite("https://www.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 else who contributed!

\n"; + stream << "

Everyone who helped establish our branding!

\n"; + stream << "

And everyone else who contributed!

\n"; stream << "
\n"; stream << "\n"; diff --git a/program_info/org.prismlauncher.PrismLauncher.Social.svg b/program_info/org.prismlauncher.PrismLauncher.Social.svg new file mode 100644 index 00000000..4a4da230 --- /dev/null +++ b/program_info/org.prismlauncher.PrismLauncher.Social.svg @@ -0,0 +1,60 @@ + + + + Prism Launcher Logo + + + + + + + + + + + + + + + + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + Prism Launcher + + + + + + + + + + + + + + + diff --git a/program_info/org.prismlauncher.PrismLauncher.Source.svg b/program_info/org.prismlauncher.PrismLauncher.Source.svg index 0614cde2..ee5dc724 100644 --- a/program_info/org.prismlauncher.PrismLauncher.Source.svg +++ b/program_info/org.prismlauncher.PrismLauncher.Source.svg @@ -2,260 +2,202 @@ + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + Prism Launcher Logo - + inkscape:current-layer="layer1"> + id="guide4870" + inkscape:locked="false" /> + position="12.170833,12.170833" + orientation="0,-1" + id="guide4872" + inkscape:locked="false" /> - - + id="guide4874" + inkscape:locked="false" /> - - + id="guide4876" + inkscape:locked="false" /> + position="13.692187,21.332031" + orientation="0,-1" + id="guide6489" + inkscape:locked="false" /> + position="6.3500002,12.170833" + orientation="1,0" + id="guide6491" + inkscape:locked="false" /> + position="6.3500002,6.3499993" + orientation="-0.49999657,-0.86602738" + id="guide9375" + inkscape:locked="false" /> + position="6.3500002,6.3499993" + orientation="-0.49999666,0.86602733" + id="guide9377" + inkscape:locked="false" /> - - - - - - - - - - - + id="defs3603" /> - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + Prism Launcher + + + + + + + + + + + + + + diff --git a/program_info/org.prismlauncher.PrismLauncher.bigsur.svg b/program_info/org.prismlauncher.PrismLauncher.bigsur.svg index e9582f5d..524cf11a 100644 --- a/program_info/org.prismlauncher.PrismLauncher.bigsur.svg +++ b/program_info/org.prismlauncher.PrismLauncher.bigsur.svg @@ -1,174 +1,272 @@ + - + width="1024" + height="1024" + viewBox="0 0 1024 1024" + fill="none" + version="1.1" + id="svg76" + sodipodi:docname="org.prismlauncher.PrismLauncher.bigsur.svg" + inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + + + fill-rule="evenodd" + clip-rule="evenodd" + d="M924 354.627C924 344.845 924.004 335.062 923.944 325.279C923.895 317.038 923.8 308.799 923.576 300.562C923.092 282.609 922.033 264.502 918.84 246.749C915.602 228.741 910.314 211.98 901.981 195.617C893.789 179.534 883.088 164.817 870.32 152.058C857.555 139.299 842.834 128.605 826.746 120.418C810.366 112.083 793.587 106.797 775.558 103.56C757.803 100.372 739.691 99.315 721.738 98.83C713.495 98.607 705.253 98.513 697.008 98.462C687.22 98.402 677.432 98.407 667.644 98.407L553.997 98H468.997L357.361 98.407C347.554 98.407 337.747 98.402 327.94 98.462C319.678 98.513 311.42 98.607 303.161 98.83C285.167 99.315 267.014 100.373 249.217 103.565C231.164 106.801 214.36 112.085 197.958 120.414C181.835 128.602 167.083 139.297 154.291 152.058C141.501 164.816 130.78 179.53 122.573 195.61C114.217 211.981 108.919 228.752 105.673 246.77C102.477 264.516 101.418 282.617 100.931 300.562C100.709 308.8 100.613 317.039 100.563 325.279C100.503 335.063 100 347.216 100 356.999L100.003 467.089L100 552.998L100.508 665.427C100.508 675.223 100.504 685.019 100.563 694.815C100.613 703.067 100.709 711.317 100.932 719.566C101.418 737.542 102.479 755.675 105.678 773.452C108.923 791.484 114.22 808.269 122.569 824.653C130.777 840.759 141.5 855.495 154.291 868.272C167.082 881.049 181.83 891.757 197.95 899.956C214.362 908.302 231.174 913.595 249.238 916.836C267.027 920.029 285.174 921.088 303.161 921.573C311.42 921.796 319.679 921.891 327.941 921.941C337.748 922.001 347.554 921.997 357.361 921.997L470.006 922H555.217L667.644 921.996C677.432 921.996 687.22 922.001 697.008 921.941C705.253 921.891 713.495 921.796 721.738 921.573C739.698 921.087 757.816 920.027 775.579 916.832C793.597 913.591 810.368 908.3 826.739 899.959C842.831 891.761 857.554 881.051 870.32 868.272C883.086 855.497 893.786 840.763 901.978 824.66C910.316 808.268 915.604 791.475 918.844 773.431C922.034 755.661 923.092 737.535 923.577 719.566C923.8 711.316 923.895 703.066 923.944 694.815C924.005 685.019 924 675.223 924 665.427C924 665.427 923.994 554.983 923.994 552.998V466.999C923.994 465.533 924 354.627 924 354.627Z" + fill="url(#paint0_linear_102_69)" + id="path2" /> + id="mask0_102_69" + style="mask-type: alpha" + maskUnits="userSpaceOnUse" + x="100" + y="98" + width="824" + height="824"> + fill-rule="evenodd" + clip-rule="evenodd" + d="M924 354.627C924 344.845 924.004 335.062 923.944 325.279C923.895 317.038 923.8 308.799 923.576 300.562C923.092 282.609 922.033 264.502 918.84 246.749C915.602 228.741 910.314 211.98 901.981 195.617C893.789 179.534 883.088 164.817 870.32 152.058C857.555 139.299 842.834 128.605 826.746 120.418C810.366 112.083 793.587 106.797 775.558 103.56C757.803 100.372 739.691 99.315 721.738 98.83C713.495 98.607 705.253 98.513 697.008 98.462C687.22 98.402 677.432 98.407 667.644 98.407L553.997 98H468.997L357.361 98.407C347.554 98.407 337.747 98.402 327.94 98.462C319.678 98.513 311.42 98.607 303.161 98.83C285.167 99.315 267.014 100.373 249.217 103.565C231.164 106.801 214.36 112.085 197.958 120.414C181.835 128.602 167.083 139.297 154.291 152.058C141.501 164.816 130.78 179.53 122.573 195.61C114.217 211.981 108.919 228.752 105.673 246.77C102.477 264.516 101.418 282.617 100.931 300.562C100.709 308.8 100.613 317.039 100.563 325.279C100.503 335.063 100 347.216 100 356.999L100.003 467.089L100 552.998L100.508 665.427C100.508 675.223 100.504 685.019 100.563 694.815C100.613 703.067 100.709 711.317 100.932 719.566C101.418 737.542 102.479 755.675 105.678 773.452C108.923 791.484 114.22 808.269 122.569 824.653C130.777 840.759 141.5 855.495 154.291 868.272C167.082 881.049 181.83 891.757 197.95 899.956C214.362 908.302 231.174 913.595 249.238 916.836C267.027 920.029 285.174 921.088 303.161 921.573C311.42 921.796 319.679 921.891 327.941 921.941C337.748 922.001 347.554 921.997 357.361 921.997L470.006 922H555.217L667.644 921.996C677.432 921.996 687.22 922.001 697.008 921.941C705.253 921.891 713.495 921.796 721.738 921.573C739.698 921.087 757.816 920.027 775.579 916.832C793.597 913.591 810.368 908.3 826.739 899.959C842.831 891.761 857.554 881.051 870.32 868.272C883.086 855.497 893.786 840.763 901.978 824.66C910.316 808.268 915.604 791.475 918.844 773.431C922.034 755.661 923.092 737.535 923.577 719.566C923.8 711.316 923.895 703.066 923.944 694.815C924.005 685.019 924 675.223 924 665.427C924 665.427 923.994 554.983 923.994 552.998V466.999C923.994 465.533 924 354.627 924 354.627Z" + fill="white" + id="path6" /> - + - + x="42" + y="36" + width="914" + height="914" + fill="url(#paint1_linear_102_69)" + id="rect9" /> + + x="100" + y="98" + width="824" + height="824" + rx="126" + fill="black" + fill-opacity="0.01" + id="rect11" /> - - - - - - - - + - + id="filter0_d_102_69" + x="90" + y="98" + width="844" + height="844" + filterUnits="userSpaceOnUse" + color-interpolation-filters="sRGB"> + - - + in="SourceAlpha" + type="matrix" + values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" + result="hardAlpha" + id="feColorMatrix33" /> + + + type="matrix" + values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0" + id="feColorMatrix39" /> + mode="normal" + in2="BackgroundImageFix" + result="effect1_dropShadow_102_69" + id="feBlend41" /> + mode="normal" + in="SourceGraphic" + in2="effect1_dropShadow_102_69" + result="shape" + id="feBlend43" /> - - + id="filter1_b_102_69" + x="89.1269" + y="87.1269" + width="845.746" + height="845.746" + filterUnits="userSpaceOnUse" + color-interpolation-filters="sRGB"> + + + in2="SourceAlpha" + operator="in" + result="effect1_backgroundBlur_102_69" + id="feComposite50" /> + mode="normal" + in="SourceGraphic" + in2="effect1_backgroundBlur_102_69" + result="shape" + id="feBlend52" /> - - - + id="paint0_linear_102_69" + x1="-181.14" + y1="98" + x2="-181.14" + y2="1484.28" + gradientUnits="userSpaceOnUse"> + + + - - + id="paint1_linear_102_69" + x1="928.377" + y1="992.826" + x2="928.377" + y2="134.072" + gradientUnits="userSpaceOnUse"> + + - - - + id="paint2_linear_102_69" + x1="394.815" + y1="372.239" + x2="629.182" + y2="542.528" + gradientUnits="userSpaceOnUse"> + + + + + + + + + + + + + + + + + + + + + + diff --git a/program_info/org.prismlauncher.PrismLauncher.logo-darkmode.svg b/program_info/org.prismlauncher.PrismLauncher.logo-darkmode.svg new file mode 100644 index 00000000..208d6f08 --- /dev/null +++ b/program_info/org.prismlauncher.PrismLauncher.logo-darkmode.svg @@ -0,0 +1,212 @@ + + + + + + + Prism Launcher Logo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + Prism Launcher + + + + + + + + + + + + + + + diff --git a/program_info/org.prismlauncher.PrismLauncher.logo.source.svg b/program_info/org.prismlauncher.PrismLauncher.logo.source.svg new file mode 100644 index 00000000..56db4258 --- /dev/null +++ b/program_info/org.prismlauncher.PrismLauncher.logo.source.svg @@ -0,0 +1,256 @@ + + + + + Prism Launcher Logo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + Prism Launcher + + + + + + + + + + + + + + + diff --git a/program_info/org.prismlauncher.PrismLauncher.logo.svg b/program_info/org.prismlauncher.PrismLauncher.logo.svg new file mode 100644 index 00000000..efaf3931 --- /dev/null +++ b/program_info/org.prismlauncher.PrismLauncher.logo.svg @@ -0,0 +1,72 @@ + + + + Prism Launcher Logo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + Prism Launcher + + + + + + + + + + + + + + + diff --git a/program_info/org.prismlauncher.PrismLauncher.svg b/program_info/org.prismlauncher.PrismLauncher.svg index c192d503..aeee8433 100644 --- a/program_info/org.prismlauncher.PrismLauncher.svg +++ b/program_info/org.prismlauncher.PrismLauncher.svg @@ -1,21 +1,57 @@ - - - - - - - - - - - - - - - - + + Prism Launcher Logo + + + + + + + + + + + - + + + + + + + + + + + Prism Launcher Logo + 19/10/2022 + + + Prism Launcher + + + + + AutiOne, Boba, ely, Fulmine, gon sawa, Pankakes, tobimori, Zeke + + + https://github.com/PrismLauncher/PrismLauncher + + + Prism Launcher + + + + + + + + + + + + + + diff --git a/program_info/prismlauncher-header-black.svg b/program_info/prismlauncher-header-black.svg deleted file mode 100644 index e9e7c3e2..00000000 --- a/program_info/prismlauncher-header-black.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/program_info/prismlauncher-header.Source.svg b/program_info/prismlauncher-header.Source.svg deleted file mode 100644 index c960f33b..00000000 --- a/program_info/prismlauncher-header.Source.svg +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - PolyMC - - - - diff --git a/program_info/prismlauncher-header.svg b/program_info/prismlauncher-header.svg deleted file mode 100644 index 837004e1..00000000 --- a/program_info/prismlauncher-header.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/program_info/prismlauncher-monochrome.Source.svg b/program_info/prismlauncher-monochrome.Source.svg new file mode 100644 index 00000000..7e8c8798 --- /dev/null +++ b/program_info/prismlauncher-monochrome.Source.svg @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/program_info/prismlauncher.icns b/program_info/prismlauncher.icns index 231fa22a..a4c0f7ea 100644 Binary files a/program_info/prismlauncher.icns and b/program_info/prismlauncher.icns differ diff --git a/program_info/prismlauncher.ico b/program_info/prismlauncher.ico index d56313f3..e4529f93 100644 Binary files a/program_info/prismlauncher.ico and b/program_info/prismlauncher.ico differ -- cgit From 88341b923a8d59b64aebb03e9f8bbaed47d1d0ad Mon Sep 17 00:00:00 2001 From: Chrono-byte Date: Thu, 20 Oct 2022 15:14:26 -0400 Subject: fix contributor notices in AboutDialog.cpp for license compliance Signed-off-by: Chrono-byte --- launcher/ui/dialogs/AboutDialog.cpp | 2 +- program_info/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'launcher/ui/dialogs') diff --git a/launcher/ui/dialogs/AboutDialog.cpp b/launcher/ui/dialogs/AboutDialog.cpp index 2970d47d..cecda1df 100644 --- a/launcher/ui/dialogs/AboutDialog.cpp +++ b/launcher/ui/dialogs/AboutDialog.cpp @@ -172,7 +172,7 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia QString urlText("

%1

"); ui->urlLabel->setText(urlText.arg(BuildConfig.LAUNCHER_GIT)); - QString copyText("© 2021-2022 %1"); + QString copyText("© 2022 %1"); ui->copyLabel->setText(copyText.arg(BuildConfig.LAUNCHER_COPYRIGHT)); connect(ui->closeButton, SIGNAL(clicked()), SLOT(close())); diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 62a01231..8cbc2d36 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -14,7 +14,7 @@ set(Launcher_DisplayName "Prism Launcher") set(Launcher_Name "${Launcher_CommonName}" PARENT_SCOPE) set(Launcher_DisplayName "${Launcher_DisplayName}" PARENT_SCOPE) -set(Launcher_Copyright "Prism Launcher Contributors\\n© 2012-2021 MultiMC Contributors") +set(Launcher_Copyright "Prism Launcher Contributors\\n © 2021-2022 PolyMC Contributors \\n© 2012-2021 MultiMC Contributors") set(Launcher_Copyright "${Launcher_Copyright}" PARENT_SCOPE) set(Launcher_Domain "prismlauncher.org" PARENT_SCOPE) set(Launcher_UserAgent "${Launcher_CommonName}/${Launcher_VERSION_NAME}" PARENT_SCOPE) -- cgit From 0a7383a4e1c36b0dbbdc615433a30665d1777f64 Mon Sep 17 00:00:00 2001 From: flow Date: Thu, 20 Oct 2022 16:54:39 -0300 Subject: fix: hide ProgressDialog when failing/succeeding tasks WHY IS QT LIKE THAT AAAAAAAA Signed-off-by: flow --- launcher/ui/dialogs/ProgressDialog.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'launcher/ui/dialogs') diff --git a/launcher/ui/dialogs/ProgressDialog.cpp b/launcher/ui/dialogs/ProgressDialog.cpp index 68dd4d17..05269f62 100644 --- a/launcher/ui/dialogs/ProgressDialog.cpp +++ b/launcher/ui/dialogs/ProgressDialog.cpp @@ -136,11 +136,13 @@ void ProgressDialog::onTaskStarted() {} void ProgressDialog::onTaskFailed(QString failure) { reject(); + hide(); } void ProgressDialog::onTaskSucceeded() { accept(); + hide(); } void ProgressDialog::changeStatus(const QString& status) -- cgit