From ea3be17220697326d3e508fc8c77d4e9bfbcf59f Mon Sep 17 00:00:00 2001 From: flow Date: Tue, 2 Aug 2022 15:17:54 -0300 Subject: feat: add widget for a text browser with image support Signed-off-by: flow --- launcher/CMakeLists.txt | 4 + launcher/ui/widgets/ProjectDescriptionPage.cpp | 17 ++++ launcher/ui/widgets/ProjectDescriptionPage.h | 24 +++++ launcher/ui/widgets/VariableSizedImageObject.cpp | 118 +++++++++++++++++++++++ launcher/ui/widgets/VariableSizedImageObject.h | 55 +++++++++++ 5 files changed, 218 insertions(+) create mode 100644 launcher/ui/widgets/ProjectDescriptionPage.cpp create mode 100644 launcher/ui/widgets/ProjectDescriptionPage.h create mode 100644 launcher/ui/widgets/VariableSizedImageObject.cpp create mode 100644 launcher/ui/widgets/VariableSizedImageObject.h diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 0bdfcd44..044160a4 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -855,6 +855,10 @@ SET(LAUNCHER_SOURCES ui/widgets/PageContainer.cpp ui/widgets/PageContainer.h ui/widgets/PageContainer_p.h + ui/widgets/ProjectDescriptionPage.h + ui/widgets/ProjectDescriptionPage.cpp + ui/widgets/VariableSizedImageObject.h + ui/widgets/VariableSizedImageObject.cpp ui/widgets/ProjectItem.h ui/widgets/ProjectItem.cpp ui/widgets/VersionListView.cpp diff --git a/launcher/ui/widgets/ProjectDescriptionPage.cpp b/launcher/ui/widgets/ProjectDescriptionPage.cpp new file mode 100644 index 00000000..2e6f6d97 --- /dev/null +++ b/launcher/ui/widgets/ProjectDescriptionPage.cpp @@ -0,0 +1,17 @@ +#include "ProjectDescriptionPage.h" + +#include "VariableSizedImageObject.h" + +#include + +ProjectDescriptionPage::ProjectDescriptionPage(QWidget* parent) : QTextBrowser(parent), m_image_text_object(new VariableSizedImageObject) +{ + m_image_text_object->setParent(this); + document()->documentLayout()->registerHandler(QTextFormat::ImageObject, m_image_text_object.get()); +} + +void ProjectDescriptionPage::setMetaEntry(QString entry) +{ + if (m_image_text_object) + m_image_text_object->setMetaEntry(entry); +} diff --git a/launcher/ui/widgets/ProjectDescriptionPage.h b/launcher/ui/widgets/ProjectDescriptionPage.h new file mode 100644 index 00000000..8387d3fb --- /dev/null +++ b/launcher/ui/widgets/ProjectDescriptionPage.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "QObjectPtr.h" + +QT_BEGIN_NAMESPACE +class VariableSizedImageObject; +QT_END_NAMESPACE + +/** This subclasses QTextBrowser to provide additional capabilities + * to it, like allowing for images to be shown. + */ +class ProjectDescriptionPage final : public QTextBrowser { + Q_OBJECT + + public: + ProjectDescriptionPage(QWidget* parent = nullptr); + + void setMetaEntry(QString entry); + + private: + shared_qobject_ptr m_image_text_object; +}; diff --git a/launcher/ui/widgets/VariableSizedImageObject.cpp b/launcher/ui/widgets/VariableSizedImageObject.cpp new file mode 100644 index 00000000..0efdecab --- /dev/null +++ b/launcher/ui/widgets/VariableSizedImageObject.cpp @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: GPL-3.0-only +/* + * PolyMC - Minecraft Launcher + * Copyright (c) 2022 flowln + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "VariableSizedImageObject.h" + +#include +#include +#include +#include + +#include "Application.h" + +#include "net/NetJob.h" + +enum FormatProperties { ImageData = QTextFormat::UserProperty + 1 }; + +QSizeF VariableSizedImageObject::intrinsicSize(QTextDocument* doc, int posInDocument, const QTextFormat& format) +{ + Q_UNUSED(posInDocument); + + auto image = qvariant_cast(format.property(ImageData)); + auto size = image.size(); + + // Get the width of the text content to make the image similar sized. + // doc->textWidth() includes the margin, so we need to remove it. + auto doc_width = doc->textWidth() - 2 * doc->documentMargin(); + + if (size.width() > doc_width) + size *= doc_width / (double)size.width(); + + return { size }; +} +void VariableSizedImageObject::drawObject(QPainter* painter, + const QRectF& rect, + QTextDocument* doc, + int posInDocument, + const QTextFormat& format) +{ + if (!format.hasProperty(ImageData)) { + QUrl image_url{ qvariant_cast(format.property(QTextFormat::ImageName)) }; + if (m_fetching_images.contains(image_url)) + return; + + loadImage(doc, image_url, posInDocument); + return; + } + + auto image = qvariant_cast(format.property(ImageData)); + + painter->setRenderHint(QPainter::RenderHint::SmoothPixmapTransform); + painter->drawImage(rect, image); +} + +void VariableSizedImageObject::parseImage(QTextDocument* doc, QImage image, int posInDocument) +{ + QTextCursor cursor(doc); + cursor.setPosition(posInDocument); + cursor.setKeepPositionOnInsert(true); + + auto image_char_format = cursor.charFormat(); + + image_char_format.setObjectType(QTextFormat::ImageObject); + image_char_format.setProperty(ImageData, image); + + // Qt doesn't allow us to modify the properties of an existing object in the document. + // So we remove the old one and add the new one with the ImageData property set. + cursor.deleteChar(); + cursor.insertText(QString(QChar::ObjectReplacementCharacter), image_char_format); +} + +void VariableSizedImageObject::loadImage(QTextDocument* doc, const QUrl& source, int posInDocument) +{ + m_fetching_images.append(source); + + MetaEntryPtr entry = APPLICATION->metacache()->resolveEntry( + m_meta_entry, + QString("images/%1").arg(QString(QCryptographicHash::hash(source.toEncoded(), QCryptographicHash::Algorithm::Sha1).toHex()))); + + auto job = new NetJob(QString("Load Image: %1").arg(source.fileName()), APPLICATION->network()); + job->addNetAction(Net::Download::makeCached(source, entry)); + + auto full_entry_path = entry->getFullPath(); + auto source_url = source; + connect(job, &NetJob::succeeded, [this, doc, full_entry_path, source_url, posInDocument] { + qDebug() << "Loaded resource at" << full_entry_path; + + QImage image(full_entry_path); + doc->addResource(QTextDocument::ImageResource, source_url, image); + + parseImage(doc, image, posInDocument); + + // This size hack is needed to prevent the content from being laid out in an area smaller + // than the total width available (weird). + auto size = doc->pageSize(); + doc->adjustSize(); + doc->setPageSize(size); + + m_fetching_images.removeOne(source_url); + }); + connect(job, &NetJob::finished, job, &NetJob::deleteLater); + + job->start(); +} diff --git a/launcher/ui/widgets/VariableSizedImageObject.h b/launcher/ui/widgets/VariableSizedImageObject.h new file mode 100644 index 00000000..11563a37 --- /dev/null +++ b/launcher/ui/widgets/VariableSizedImageObject.h @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: GPL-3.0-only +/* + * PolyMC - Minecraft Launcher + * Copyright (c) 2022 flowln + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include +#include +#include + +/** Custom image text object to be used instead of the normal one in ProjectDescriptionPage. + * + * Why? Because we want to re-scale images dynamically based on the document's size, in order to + * not have images being weirdly cropped out in different resolutions. + */ +class VariableSizedImageObject : public QObject, public QTextObjectInterface { + Q_OBJECT + Q_INTERFACES(QTextObjectInterface) + + public: + QSizeF intrinsicSize(QTextDocument* doc, int posInDocument, const QTextFormat& format) override; + void drawObject(QPainter* painter, const QRectF& rect, QTextDocument* doc, int posInDocument, const QTextFormat& format) override; + + void setMetaEntry(QString meta_entry) { m_meta_entry = meta_entry; } + + protected: + /** Adds the image to the document, in the given position. + */ + void parseImage(QTextDocument* doc, QImage image, int posInDocument); + + /** Loads an image from an external source, and adds it to the document. + * + * This uses m_meta_entry to cache the image. + */ + void loadImage(QTextDocument* doc, const QUrl& source, int posInDocument); + + QString m_meta_entry; + + QList m_fetching_images; +}; -- cgit From db158a5735e18442f76118f1f6a060e6c3680e33 Mon Sep 17 00:00:00 2001 From: flow Date: Sat, 10 Sep 2022 18:49:00 -0300 Subject: feat: add image support for mod pages Signed-off-by: flow --- launcher/ui/pages/modplatform/ModPage.ui | 9 ++++++++- launcher/ui/pages/modplatform/flame/FlameModPage.cpp | 2 ++ launcher/ui/pages/modplatform/modrinth/ModrinthModPage.cpp | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/launcher/ui/pages/modplatform/ModPage.ui b/launcher/ui/pages/modplatform/ModPage.ui index afcd9bb7..943f02aa 100644 --- a/launcher/ui/pages/modplatform/ModPage.ui +++ b/launcher/ui/pages/modplatform/ModPage.ui @@ -14,7 +14,7 @@ - + true @@ -98,6 +98,13 @@ + + + ProjectDescriptionPage + QTextBrowser +
ui/widgets/ProjectDescriptionPage.h
+
+
searchEdit searchButton diff --git a/launcher/ui/pages/modplatform/flame/FlameModPage.cpp b/launcher/ui/pages/modplatform/flame/FlameModPage.cpp index 772fd2e0..b497d1fe 100644 --- a/launcher/ui/pages/modplatform/flame/FlameModPage.cpp +++ b/launcher/ui/pages/modplatform/flame/FlameModPage.cpp @@ -59,6 +59,8 @@ FlameModPage::FlameModPage(ModDownloadDialog* dialog, BaseInstance* instance) connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &FlameModPage::onSelectionChanged); connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &FlameModPage::onVersionSelectionChanged); connect(ui->modSelectionButton, &QPushButton::clicked, this, &FlameModPage::onModSelected); + + ui->packDescription->setMetaEntry(metaEntryBase()); } auto FlameModPage::validateVersion(ModPlatform::IndexedVersion& ver, QString mineVer, ModAPI::ModLoaderTypes loaders) const -> bool diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModPage.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthModPage.cpp index 5fa00b9b..62e417c8 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthModPage.cpp +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthModPage.cpp @@ -59,6 +59,8 @@ ModrinthModPage::ModrinthModPage(ModDownloadDialog* dialog, BaseInstance* instan connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &ModrinthModPage::onSelectionChanged); connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &ModrinthModPage::onVersionSelectionChanged); connect(ui->modSelectionButton, &QPushButton::clicked, this, &ModrinthModPage::onModSelected); + + ui->packDescription->setMetaEntry(metaEntryBase()); } auto ModrinthModPage::validateVersion(ModPlatform::IndexedVersion& ver, QString mineVer, ModAPI::ModLoaderTypes loaders) const -> bool -- cgit From d99976f5d7e13f0e2432028b9dd8b38ded8bcc18 Mon Sep 17 00:00:00 2001 From: flow Date: Tue, 2 Aug 2022 15:14:25 -0300 Subject: fix: make mod and modpack caches separate for Modrinth This makes it similar to CF mods / modpacks. The mods cache is maintained with the same name because it most likely has more data it in, so this commit will affect existing caches as minimally as possible. Signed-off-by: flow --- launcher/Application.cpp | 1 + launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index e08ea7f4..64adc6e9 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -809,6 +809,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_metacache->addBase("FlamePacks", QDir("cache/FlamePacks").absolutePath()); m_metacache->addBase("FlameMods", QDir("cache/FlameMods").absolutePath()); m_metacache->addBase("ModrinthPacks", QDir("cache/ModrinthPacks").absolutePath()); + m_metacache->addBase("ModrinthModpacks", QDir("cache/ModrinthModpacks").absolutePath()); m_metacache->addBase("root", QDir::currentPath()); m_metacache->addBase("translations", QDir("translations").absolutePath()); m_metacache->addBase("icons", QDir("cache/icons").absolutePath()); diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp index fd7a3537..a0e9ab19 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp @@ -218,7 +218,7 @@ void ModpackListModel::getLogo(const QString& logo, const QString& logoUrl, Logo { if (m_logoMap.contains(logo)) { callback(APPLICATION->metacache() - ->resolveEntry("ModrinthPacks", QString("logos/%1").arg(logo.section(".", 0, 0))) + ->resolveEntry(m_parent->metaEntryBase(), QString("logos/%1").arg(logo.section(".", 0, 0))) ->getFullPath()); } else { requestLogo(logo, logoUrl); @@ -232,7 +232,7 @@ void ModpackListModel::requestLogo(QString logo, QString url) } MetaEntryPtr entry = - APPLICATION->metacache()->resolveEntry("ModrinthPacks", QString("logos/%1").arg(logo.section(".", 0, 0))); + APPLICATION->metacache()->resolveEntry(m_parent->metaEntryBase(), QString("logos/%1").arg(logo.section(".", 0, 0))); auto job = new NetJob(QString("%1 Icon Download %2").arg(m_parent->debugName()).arg(logo), APPLICATION->network()); job->addNetAction(Net::Download::makeCached(QUrl(url), entry)); -- cgit From 60f19f305e4e4540f337a4dbcc96536c14e23e82 Mon Sep 17 00:00:00 2001 From: flow Date: Sat, 10 Sep 2022 18:49:31 -0300 Subject: feat: add image support for modrinth modpack pages Signed-off-by: flow --- launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp | 1 + launcher/ui/pages/modplatform/modrinth/ModrinthPage.ui | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp index cea6cdee..70f1388a 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp @@ -74,6 +74,7 @@ ModrinthPage::ModrinthPage(NewInstanceDialog* dialog, QWidget* parent) : QWidget connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &ModrinthPage::onVersionSelectionChanged); ui->packView->setItemDelegate(new ProjectItemDelegate(this)); + ui->packDescription->setMetaEntry(metaEntryBase()); } ModrinthPage::~ModrinthPage() diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.ui b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.ui index 6a34701d..6d8b2b67 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.ui +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.ui @@ -66,7 +66,7 @@
- + true @@ -99,6 +99,13 @@ + + + ProjectDescriptionPage + QTextBrowser +
ui/widgets/ProjectDescriptionPage.h
+
+
searchEdit searchButton -- cgit From d7992ab29d07c6d26377f6db1cfca6059aace471 Mon Sep 17 00:00:00 2001 From: flow Date: Sat, 10 Sep 2022 19:00:47 -0300 Subject: feat: add image support for FTB packs Signed-off-by: flow --- launcher/ui/pages/modplatform/ftb/FtbPage.cpp | 2 ++ launcher/ui/pages/modplatform/ftb/FtbPage.ui | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/launcher/ui/pages/modplatform/ftb/FtbPage.cpp b/launcher/ui/pages/modplatform/ftb/FtbPage.cpp index 8975d74e..34734eaf 100644 --- a/launcher/ui/pages/modplatform/ftb/FtbPage.cpp +++ b/launcher/ui/pages/modplatform/ftb/FtbPage.cpp @@ -73,6 +73,8 @@ FtbPage::FtbPage(NewInstanceDialog* dialog, QWidget *parent) connect(ui->sortByBox, &QComboBox::currentTextChanged, this, &FtbPage::onSortingSelectionChanged); connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &FtbPage::onSelectionChanged); connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &FtbPage::onVersionSelectionChanged); + + ui->packDescription->setMetaEntry("FTBPacks"); } FtbPage::~FtbPage() diff --git a/launcher/ui/pages/modplatform/ftb/FtbPage.ui b/launcher/ui/pages/modplatform/ftb/FtbPage.ui index 850bf091..8de0f4e6 100644 --- a/launcher/ui/pages/modplatform/ftb/FtbPage.ui +++ b/launcher/ui/pages/modplatform/ftb/FtbPage.ui @@ -57,7 +57,7 @@ - + true @@ -70,6 +70,13 @@ + + + ProjectDescriptionPage + QTextBrowser +
ui/widgets/ProjectDescriptionPage.h
+
+
searchEdit versionSelectionBox -- cgit From d194b02e28132df3ea3da961299e969614b8a185 Mon Sep 17 00:00:00 2001 From: flow Date: Tue, 11 Oct 2022 14:19:29 -0300 Subject: fix: prevent images overriding content when changing pages Signed-off-by: flow --- launcher/ui/pages/modplatform/ModPage.cpp | 1 + launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp | 1 + launcher/ui/widgets/ProjectDescriptionPage.cpp | 6 ++++++ launcher/ui/widgets/ProjectDescriptionPage.h | 8 ++++++++ launcher/ui/widgets/VariableSizedImageObject.cpp | 13 +++++++++++-- launcher/ui/widgets/VariableSizedImageObject.h | 15 ++++++++++++--- 6 files changed, 39 insertions(+), 5 deletions(-) diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp index 4fce0242..153bb049 100644 --- a/launcher/ui/pages/modplatform/ModPage.cpp +++ b/launcher/ui/pages/modplatform/ModPage.cpp @@ -350,4 +350,5 @@ void ModPage::updateUi() HoeDown h; ui->packDescription->setHtml(text + (current.extraData.body.isEmpty() ? current.description : h.process(current.extraData.body.toUtf8()))); + ui->packDescription->flush(); } diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp index 70f1388a..4482774c 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp @@ -284,6 +284,7 @@ void ModrinthPage::updateUI() text += h.process(current.extra.body.toUtf8()); ui->packDescription->setHtml(text + current.description); + ui->packDescription->flush(); } void ModrinthPage::suggestCurrent() diff --git a/launcher/ui/widgets/ProjectDescriptionPage.cpp b/launcher/ui/widgets/ProjectDescriptionPage.cpp index 2e6f6d97..c7e79a17 100644 --- a/launcher/ui/widgets/ProjectDescriptionPage.cpp +++ b/launcher/ui/widgets/ProjectDescriptionPage.cpp @@ -15,3 +15,9 @@ void ProjectDescriptionPage::setMetaEntry(QString entry) if (m_image_text_object) m_image_text_object->setMetaEntry(entry); } + +void ProjectDescriptionPage::flush() +{ + if (m_image_text_object) + m_image_text_object->flush(); +} diff --git a/launcher/ui/widgets/ProjectDescriptionPage.h b/launcher/ui/widgets/ProjectDescriptionPage.h index 8387d3fb..3dd85302 100644 --- a/launcher/ui/widgets/ProjectDescriptionPage.h +++ b/launcher/ui/widgets/ProjectDescriptionPage.h @@ -19,6 +19,14 @@ class ProjectDescriptionPage final : public QTextBrowser { void setMetaEntry(QString entry); + public slots: + /** Flushes the current processing happening in the page. + * + * Should be called when changing the page's content entirely, to + * prevent old tasks from changing the new content. + */ + void flush(); + private: shared_qobject_ptr m_image_text_object; }; diff --git a/launcher/ui/widgets/VariableSizedImageObject.cpp b/launcher/ui/widgets/VariableSizedImageObject.cpp index 0efdecab..e57f7e95 100644 --- a/launcher/ui/widgets/VariableSizedImageObject.cpp +++ b/launcher/ui/widgets/VariableSizedImageObject.cpp @@ -66,6 +66,11 @@ void VariableSizedImageObject::drawObject(QPainter* painter, painter->drawImage(rect, image); } +void VariableSizedImageObject::flush() +{ + m_fetching_images.clear(); +} + void VariableSizedImageObject::parseImage(QTextDocument* doc, QImage image, int posInDocument) { QTextCursor cursor(doc); @@ -85,7 +90,7 @@ void VariableSizedImageObject::parseImage(QTextDocument* doc, QImage image, int void VariableSizedImageObject::loadImage(QTextDocument* doc, const QUrl& source, int posInDocument) { - m_fetching_images.append(source); + m_fetching_images.insert(source); MetaEntryPtr entry = APPLICATION->metacache()->resolveEntry( m_meta_entry, @@ -99,6 +104,10 @@ void VariableSizedImageObject::loadImage(QTextDocument* doc, const QUrl& source, connect(job, &NetJob::succeeded, [this, doc, full_entry_path, source_url, posInDocument] { qDebug() << "Loaded resource at" << full_entry_path; + // If we flushed, don't proceed. + if (!m_fetching_images.contains(source_url)) + return; + QImage image(full_entry_path); doc->addResource(QTextDocument::ImageResource, source_url, image); @@ -110,7 +119,7 @@ void VariableSizedImageObject::loadImage(QTextDocument* doc, const QUrl& source, doc->adjustSize(); doc->setPageSize(size); - m_fetching_images.removeOne(source_url); + m_fetching_images.remove(source_url); }); connect(job, &NetJob::finished, job, &NetJob::deleteLater); diff --git a/launcher/ui/widgets/VariableSizedImageObject.h b/launcher/ui/widgets/VariableSizedImageObject.h index 11563a37..137487ee 100644 --- a/launcher/ui/widgets/VariableSizedImageObject.h +++ b/launcher/ui/widgets/VariableSizedImageObject.h @@ -28,7 +28,7 @@ * Why? Because we want to re-scale images dynamically based on the document's size, in order to * not have images being weirdly cropped out in different resolutions. */ -class VariableSizedImageObject : public QObject, public QTextObjectInterface { +class VariableSizedImageObject final : public QObject, public QTextObjectInterface { Q_OBJECT Q_INTERFACES(QTextObjectInterface) @@ -38,7 +38,15 @@ class VariableSizedImageObject : public QObject, public QTextObjectInterface { void setMetaEntry(QString meta_entry) { m_meta_entry = meta_entry; } - protected: + public slots: + /** Stops all currently loading images from modifying the document. + * + * This does not stop the ongoing network tasks, it only prevents their result + * from impacting the document any further. + */ + void flush(); + + private: /** Adds the image to the document, in the given position. */ void parseImage(QTextDocument* doc, QImage image, int posInDocument); @@ -49,7 +57,8 @@ class VariableSizedImageObject : public QObject, public QTextObjectInterface { */ void loadImage(QTextDocument* doc, const QUrl& source, int posInDocument); + private: QString m_meta_entry; - QList m_fetching_images; + QSet m_fetching_images; }; -- cgit 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(-) 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 83654a193e8856e00bcdbe4f87d209e52c380a62 Mon Sep 17 00:00:00 2001 From: flow Date: Thu, 13 Oct 2022 13:27:52 -0300 Subject: refactor+fix: Make FTB install task similar to other install tasks In particular, this changes the order so that the instance gets created before downloading the mods (like other install tasks), and the mod download directly puts the files in the staging folder (like the others), instead of that weird makeCached and copy stuff. This fixes some issues with modpack downloads from FTB, like creating an instance with no mods in it. Signed-off-by: flow --- .../modplatform/modpacksch/FTBPackInstallTask.cpp | 144 +++++++++------------ .../modplatform/modpacksch/FTBPackInstallTask.h | 7 +- 2 files changed, 64 insertions(+), 87 deletions(-) diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp index 97ce1dc6..cc926d45 100644 --- a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp +++ b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp @@ -58,6 +58,9 @@ PackInstallTask::PackInstallTask(Modpack pack, QString version, QWidget* parent) bool PackInstallTask::abort() { + if (!canAbort()) + return false; + bool aborted = true; if (m_net_job) @@ -65,14 +68,12 @@ bool PackInstallTask::abort() if (m_mod_id_resolver_task) aborted &= m_mod_id_resolver_task->abort(); - if (aborted) - emitAborted(); - - return aborted; + return aborted ? InstanceTask::abort() : false; } void PackInstallTask::executeTask() { + setAbortable(true); setStatus(tr("Getting the manifest...")); // Find pack version @@ -129,6 +130,7 @@ void PackInstallTask::onManifestDownloadSucceeded() void PackInstallTask::resolveMods() { + setAbortable(true); setStatus(tr("Resolving mods...")); setProgress(0, 100); @@ -169,8 +171,6 @@ void PackInstallTask::resolveMods() void PackInstallTask::onResolveModsSucceeded() { - m_abortable = false; - QString text; QList urls; auto anyBlocked = false; @@ -209,94 +209,23 @@ void PackInstallTask::onResolveModsSucceeded() urls); if (message_dialog->exec() == QDialog::Accepted) - downloadPack(); + createInstance(); else abort(); } else { - downloadPack(); - } -} - -void PackInstallTask::downloadPack() -{ - setStatus(tr("Downloading mods...")); - - auto* jobPtr = new NetJob(tr("Mod download"), APPLICATION->network()); - for (auto const& file : m_version.files) { - if (file.serverOnly || file.url.isEmpty()) - continue; - - QFileInfo file_info(file.name); - auto cacheName = file_info.completeBaseName() + "-" + file.sha1 + "." + file_info.suffix(); - - auto entry = APPLICATION->metacache()->resolveEntry("ModpacksCHPacks", cacheName); - entry->setStale(true); - - auto relpath = FS::PathCombine("minecraft", file.path, file.name); - auto path = FS::PathCombine(m_stagingPath, relpath); - - if (m_files_to_copy.contains(path)) { - qWarning() << "Ignoring" << file.url << "as a file of that path is already downloading."; - continue; - } - - qDebug() << "Will download" << file.url << "to" << path; - m_files_to_copy[path] = entry->getFullPath(); - - auto dl = Net::Download::makeCached(file.url, entry); - if (!file.sha1.isEmpty()) { - auto rawSha1 = QByteArray::fromHex(file.sha1.toLatin1()); - dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawSha1)); - } - - jobPtr->addNetAction(dl); + createInstance(); } - - connect(jobPtr, &NetJob::succeeded, this, &PackInstallTask::onModDownloadSucceeded); - connect(jobPtr, &NetJob::failed, this, &PackInstallTask::onModDownloadFailed); - connect(jobPtr, &NetJob::progress, this, &PackInstallTask::setProgress); - - m_net_job = jobPtr; - jobPtr->start(); - - m_abortable = true; } -void PackInstallTask::onModDownloadSucceeded() +void PackInstallTask::createInstance() { - m_net_job.reset(); - install(); -} - -void PackInstallTask::install() -{ - setStatus(tr("Copying modpack files...")); - setProgress(0, m_files_to_copy.size()); - QCoreApplication::processEvents(); - - m_abortable = false; - - int i = 0; - for (auto iter = m_files_to_copy.constBegin(); iter != m_files_to_copy.constEnd(); iter++) { - auto& to = iter.key(); - auto& from = iter.value(); - FS::copy fileCopyOperation(from, to); - if (!fileCopyOperation()) { - qWarning() << "Failed to copy" << from << "to" << to; - emitFailed(tr("Failed to copy files")); - return; - } - - setProgress(i++, m_files_to_copy.size()); - QCoreApplication::processEvents(); - } + setAbortable(false); - setStatus(tr("Installing modpack...")); + setStatus(tr("Creating the instance...")); QCoreApplication::processEvents(); auto instanceConfigPath = FS::PathCombine(m_stagingPath, "instance.cfg"); auto instanceSettings = std::make_shared(instanceConfigPath); - instanceSettings->suspendSave(); MinecraftInstance instance(m_globalSettings, instanceSettings, m_stagingPath); auto components = instance.getPackProfile(); @@ -337,8 +266,53 @@ void PackInstallTask::install() instance.setName(name()); instance.setIconKey(m_instIcon); instance.setManagedPack("modpacksch", QString::number(m_pack.id), m_pack.name, QString::number(m_version.id), m_version.name); - instanceSettings->resumeSave(); + instance.saveNow(); + + onCreateInstanceSucceeded(); +} + +void PackInstallTask::onCreateInstanceSucceeded() +{ + downloadPack(); +} + +void PackInstallTask::downloadPack() +{ + setAbortable(true); + + setStatus(tr("Downloading mods...")); + + auto* jobPtr = new NetJob(tr("Mod download"), APPLICATION->network()); + for (auto const& file : m_version.files) { + if (file.serverOnly || file.url.isEmpty()) + continue; + + auto path = FS::PathCombine(m_stagingPath, ".minecraft", file.path, file.name); + qDebug() << "Will try to download" << file.url << "to" << path; + + QFileInfo file_info(file.name); + + auto dl = Net::Download::makeFile(file.url, path); + if (!file.sha1.isEmpty()) { + auto rawSha1 = QByteArray::fromHex(file.sha1.toLatin1()); + dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawSha1)); + } + + jobPtr->addNetAction(dl); + } + + connect(jobPtr, &NetJob::succeeded, this, &PackInstallTask::onModDownloadSucceeded); + connect(jobPtr, &NetJob::failed, this, &PackInstallTask::onModDownloadFailed); + connect(jobPtr, &NetJob::progress, this, &PackInstallTask::setProgress); + + m_net_job = jobPtr; + jobPtr->start(); +} + +void PackInstallTask::onModDownloadSucceeded() +{ + m_net_job.reset(); emitSucceeded(); } @@ -352,6 +326,10 @@ void PackInstallTask::onResolveModsFailed(QString reason) m_net_job.reset(); emitFailed(reason); } +void PackInstallTask::onCreateInstanceFailed(QString reason) +{ + emitFailed(reason); +} void PackInstallTask::onModDownloadFailed(QString reason) { m_net_job.reset(); diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.h b/launcher/modplatform/modpacksch/FTBPackInstallTask.h index e63ca0df..7c6fbeb9 100644 --- a/launcher/modplatform/modpacksch/FTBPackInstallTask.h +++ b/launcher/modplatform/modpacksch/FTBPackInstallTask.h @@ -56,7 +56,6 @@ public: explicit PackInstallTask(Modpack pack, QString version, QWidget* parent = nullptr); ~PackInstallTask() override = default; - bool canAbort() const override { return m_abortable; } bool abort() override; protected: @@ -65,20 +64,20 @@ protected: private slots: void onManifestDownloadSucceeded(); void onResolveModsSucceeded(); + void onCreateInstanceSucceeded(); void onModDownloadSucceeded(); void onManifestDownloadFailed(QString reason); void onResolveModsFailed(QString reason); + void onCreateInstanceFailed(QString reason); void onModDownloadFailed(QString reason); private: void resolveMods(); + void createInstance(); void downloadPack(); - void install(); private: - bool m_abortable = true; - NetJob::Ptr m_net_job = nullptr; shared_qobject_ptr m_mod_id_resolver_task = nullptr; -- 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(+) 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(-) 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 c90a88b6b6cf1b7d0fe2b6784de880762201f4a9 Mon Sep 17 00:00:00 2001 From: flow Date: Fri, 14 Oct 2022 12:18:06 -0300 Subject: fix: correct ftb legacy too Signed-off-by: flow --- .../modplatform/legacy_ftb/PackInstallTask.cpp | 41 ++++++++++------------ 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/launcher/modplatform/legacy_ftb/PackInstallTask.cpp b/launcher/modplatform/legacy_ftb/PackInstallTask.cpp index 209ad884..06b3788b 100644 --- a/launcher/modplatform/legacy_ftb/PackInstallTask.cpp +++ b/launcher/modplatform/legacy_ftb/PackInstallTask.cpp @@ -65,48 +65,42 @@ void PackInstallTask::executeTask() void PackInstallTask::downloadPack() { setStatus(tr("Downloading zip for %1").arg(m_pack.name)); + setAbortable(false); - auto packoffset = QString("%1/%2/%3").arg(m_pack.dir, m_version.replace(".", "_"), m_pack.file); - auto entry = APPLICATION->metacache()->resolveEntry("FTBPacks", packoffset); - netJobContainer = new NetJob("Download FTB Pack", m_network); + archivePath = QString("%1/%2/%3").arg(m_pack.dir, m_version.replace(".", "_"), m_pack.file); - entry->setStale(true); + netJobContainer = new NetJob("Download FTB Pack", m_network); QString url; - if(m_pack.type == PackType::Private) - { - url = QString(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "privatepacks/%1").arg(packoffset); + if (m_pack.type == PackType::Private) { + url = QString(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "privatepacks/%1").arg(archivePath); + } else { + url = QString(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "modpacks/%1").arg(archivePath); } - else - { - url = QString(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "modpacks/%1").arg(packoffset); - } - netJobContainer->addNetAction(Net::Download::makeCached(url, entry)); - archivePath = entry->getFullPath(); + netJobContainer->addNetAction(Net::Download::makeFile(url, archivePath)); connect(netJobContainer.get(), &NetJob::succeeded, this, &PackInstallTask::onDownloadSucceeded); connect(netJobContainer.get(), &NetJob::failed, this, &PackInstallTask::onDownloadFailed); connect(netJobContainer.get(), &NetJob::progress, this, &PackInstallTask::onDownloadProgress); connect(netJobContainer.get(), &NetJob::aborted, this, &PackInstallTask::onDownloadAborted); + netJobContainer->start(); + setAbortable(true); progress(1, 4); } void PackInstallTask::onDownloadSucceeded() { - abortable = false; unzip(); } void PackInstallTask::onDownloadFailed(QString reason) { - abortable = false; emitFailed(reason); } void PackInstallTask::onDownloadProgress(qint64 current, qint64 total) { - abortable = true; progress(current, total * 4); setStatus(tr("Downloading zip for %1 (%2%)").arg(m_pack.name).arg(current / 10)); } @@ -118,8 +112,10 @@ void PackInstallTask::onDownloadAborted() void PackInstallTask::unzip() { - progress(2, 4); setStatus(tr("Extracting modpack")); + setAbortable(false); + progress(2, 4); + QDir extractDir(m_stagingPath); m_packZip.reset(new QuaZip(archivePath)); @@ -151,8 +147,8 @@ void PackInstallTask::onUnzipCanceled() void PackInstallTask::install() { - progress(3, 4); setStatus(tr("Installing modpack")); + progress(3, 4); QDir unzipMcDir(m_stagingPath + "/unzip/minecraft"); if(unzipMcDir.exists()) { @@ -247,11 +243,12 @@ void PackInstallTask::install() bool PackInstallTask::abort() { - if(abortable) - { - return netJobContainer->abort(); + if (!canAbort()) { + return false; } - return false; + + netJobContainer->abort(); + return InstanceTask::abort(); } } -- cgit From 801e7da5ee07521b81f405dae1af5097be45fccf Mon Sep 17 00:00:00 2001 From: flow Date: Tue, 18 Oct 2022 11:00:28 -0300 Subject: feat: allow specifying fallbacks to INI files Signed-off-by: flow --- launcher/settings/INISettingsObject.cpp | 23 ++++++++++++++++++++++- launcher/settings/INISettingsObject.h | 5 ++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/launcher/settings/INISettingsObject.cpp b/launcher/settings/INISettingsObject.cpp index 12513403..3677e238 100644 --- a/launcher/settings/INISettingsObject.cpp +++ b/launcher/settings/INISettingsObject.cpp @@ -16,7 +16,28 @@ #include "INISettingsObject.h" #include "Setting.h" -INISettingsObject::INISettingsObject(const QString &path, QObject *parent) +#include +#include + +INISettingsObject::INISettingsObject(QStringList paths, QObject *parent) + : SettingsObject(parent) +{ + auto first_path = paths.constFirst(); + auto path = paths.takeFirst(); + while (!QFile::exists(path)) + path = paths.takeFirst(); + + if (path != first_path && QFile::exists(path)) { + // Copy the fallback to the preferred path. + QFile::copy(path, first_path); + qDebug() << "Copied settings from" << path << "to" << first_path; + } + + m_filePath = first_path; + m_ini.loadFile(first_path); +} + +INISettingsObject::INISettingsObject(QString path, QObject* parent) : SettingsObject(parent) { m_filePath = path; diff --git a/launcher/settings/INISettingsObject.h b/launcher/settings/INISettingsObject.h index 26cc32e5..d2f448a9 100644 --- a/launcher/settings/INISettingsObject.h +++ b/launcher/settings/INISettingsObject.h @@ -28,7 +28,10 @@ class INISettingsObject : public SettingsObject { Q_OBJECT public: - explicit INISettingsObject(const QString &path, QObject *parent = 0); + /** 'paths' is a list of INI files to try, in order, for fallback support. */ + explicit INISettingsObject(QStringList paths, QObject* parent = nullptr); + + explicit INISettingsObject(QString path, QObject* parent = nullptr); /*! * \brief Gets the path to the INI file. -- cgit From 32cdfb871c5cb0008cd34b5d5c1ff133920382d9 Mon Sep 17 00:00:00 2001 From: flow Date: Tue, 18 Oct 2022 12:00:47 -0300 Subject: fix: add fallback for polymc.cfg Signed-off-by: flow --- launcher/Application.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index e94e96a9..b85729f0 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -488,7 +488,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) // Initialize application settings { - m_settings.reset(new INISettingsObject(BuildConfig.LAUNCHER_CONFIGFILE, this)); + // Provide a fallback for migration from PolyMC + m_settings.reset(new INISettingsObject({ BuildConfig.LAUNCHER_CONFIGFILE, "polymc.cfg" }, this)); // Updates // Multiple channels are separated by spaces m_settings->registerSetting("UpdateChannel", BuildConfig.VERSION_CHANNEL); -- cgit From 83ceb26151ff7cd406bb6b741e40870629626674 Mon Sep 17 00:00:00 2001 From: Cleo John Date: Tue, 18 Oct 2022 17:28:23 +0200 Subject: Streamline Button changes to improve source readability. --- launcher/ui/pages/instance/ExternalResourcesPage.cpp | 4 ---- launcher/ui/pages/instance/ModFolderPage.cpp | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/launcher/ui/pages/instance/ExternalResourcesPage.cpp b/launcher/ui/pages/instance/ExternalResourcesPage.cpp index f31e8325..b6c873cc 100644 --- a/launcher/ui/pages/instance/ExternalResourcesPage.cpp +++ b/launcher/ui/pages/instance/ExternalResourcesPage.cpp @@ -103,10 +103,6 @@ void ExternalResourcesPage::runningStateChanged(bool running) return; m_controlsEnabled = !running; - ui->actionAddItem->setEnabled(m_controlsEnabled); - ui->actionDisableItem->setEnabled(m_controlsEnabled); - ui->actionEnableItem->setEnabled(m_controlsEnabled); - ui->actionRemoveItem->setEnabled(m_controlsEnabled); } bool ExternalResourcesPage::shouldDisplay() const diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index 28a874c2..f0106066 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -117,6 +117,10 @@ void ModFolderPage::runningStateChanged(bool running) ExternalResourcesPage::runningStateChanged(running); ui->actionDownloadItem->setEnabled(!running); ui->actionUpdateItem->setEnabled(!running); + ui->actionAddItem->setEnabled(!running); + ui->actionEnableItem->setEnabled(!running); + ui->actionDisableItem->setEnabled(!running); + ui->actionRemoveItem->setEnabled(!running); } bool ModFolderPage::shouldDisplay() const -- cgit From 1f0ca9ed92bf081e4bf6604293df38c311d74d6b Mon Sep 17 00:00:00 2001 From: Jitter <64605731+jitterdev@users.noreply.github.com> Date: Tue, 18 Oct 2022 10:34:11 -0500 Subject: Update README.md Signed-off-by: Jitter <64605731+jitterdev@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dbcf809c..72599cd8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 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/hX4g537UNE). Logo and branding also coming soon. +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. ## Installation @@ -17,7 +17,7 @@ Portable builds are provided for AppImage on Linux, Windows, and macOS. ## Help & Support -- Join the [Discord Server](https://discord.gg/hX4g537UNE) for now. +- Join the [Discord Server](https://discord.gg/prismlauncher) for now. ## License -- cgit From 6befd2be81152049bff589bad798140332aa50ef Mon Sep 17 00:00:00 2001 From: Jitter <64605731+jitterdev@users.noreply.github.com> Date: Tue, 18 Oct 2022 10:34:27 -0500 Subject: Update README.md Signed-off-by: Jitter <64605731+jitterdev@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 72599cd8..b35e2a01 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 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). Logo and branding are also coming soon. ## Installation -- cgit From 54281e53a1c9ce89827c649fb429062f38aa359e Mon Sep 17 00:00:00 2001 From: Jitter <64605731+jitterdev@users.noreply.github.com> Date: Tue, 18 Oct 2022 10:35:00 -0500 Subject: Update README.md Signed-off-by: Jitter <64605731+jitterdev@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b35e2a01..a7b09f26 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ We are working on a website and other media, for more info we have a [Discord Se ## Installation - All downloads and instructions for Prism Launcher will soon be available. -- Last build status: +- Last build status can be found [here](https://github.com/PrismLauncher/PrismLauncher/actions). ### Development Builds -- cgit From aec3e7b0fc840a4daec6ed7661f862f4d4495410 Mon Sep 17 00:00:00 2001 From: Jitter <64605731+jitterdev@users.noreply.github.com> Date: Tue, 18 Oct 2022 11:14:27 -0500 Subject: correct non-proper noun Signed-off-by: Jitter <64605731+jitterdev@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7b09f26..046473b8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 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). Logo and branding are also coming soon. ## Installation @@ -17,7 +17,7 @@ Portable builds are provided for AppImage on Linux, Windows, and macOS. ## Help & Support -- Join the [Discord Server](https://discord.gg/prismlauncher) for now. +- Join the [Discord server](https://discord.gg/prismlauncher) for now. ## License -- cgit From b1b85313ae61192c8c84ee49007c2de34956edd6 Mon Sep 17 00:00:00 2001 From: 雪鈴 SnowLin <113241163+nightsnowlinouo@users.noreply.github.com> Date: Wed, 19 Oct 2022 01:03:00 +0800 Subject: Fix hosted weblate translation website URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 雪鈴 SnowLin <113241163+nightsnowlinouo@users.noreply.github.com> --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e149ce1..a3b74a73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,7 +99,7 @@ set(Launcher_IMGUR_CLIENT_ID "5b97b0713fba4a3" CACHE STRING "Client ID you can g set(Launcher_BUG_TRACKER_URL "https://github.com/PrismLauncher/PrismLauncher/issues" CACHE STRING "URL for the bug tracker.") # Translations Platform URL -set(Launcher_TRANSLATIONS_URL "https://hosted.weblate.org/projects/prismlauncher/prismlauncher/" CACHE STRING "URL for the translations platform.") +set(Launcher_TRANSLATIONS_URL "https://hosted.weblate.org/projects/prismlauncher/launcher/" CACHE STRING "URL for the translations platform.") # Matrix Space set(Launcher_MATRIX_URL "https://matrix.to/#/#prismlauncher:matrix.org" CACHE STRING "URL to the Matrix Space") -- cgit From 5eec7cc7886f50cb25d1ded73f5bd50fa7a0aec7 Mon Sep 17 00:00:00 2001 From: Gideon9212 Date: Tue, 18 Oct 2022 11:40:23 -0700 Subject: Change discord invite to a banner To help direct people to support with a big banner. Signed-off-by: Gideon9212 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dbcf809c..9126b9a3 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Portable builds are provided for AppImage on Linux, Windows, and macOS. ## Help & Support -- Join the [Discord Server](https://discord.gg/hX4g537UNE) for now. +[![Support server invite](https://discordapp.com/api/guilds/1031648380885147709/widget.png?style=banner3)](https://discord.gg/hX4g537UNE) ## License -- cgit From c4edffb38811bd0c05e7b48ffa32e464308eab70 Mon Sep 17 00:00:00 2001 From: Gideon9212 Date: Tue, 18 Oct 2022 12:10:29 -0700 Subject: Update banner Changed to Join instead of Support server. Signed-off-by: Gideon9212 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9126b9a3..e06193dc 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Portable builds are provided for AppImage on Linux, Windows, and macOS. ## Help & Support -[![Support server invite](https://discordapp.com/api/guilds/1031648380885147709/widget.png?style=banner3)](https://discord.gg/hX4g537UNE) +[![Join the Discord Server](https://discordapp.com/api/guilds/1031648380885147709/widget.png?style=banner3)](https://discord.gg/hX4g537UNE) ## License -- cgit From 3a95a3b7c18519943b6f6d13f43710f708553db3 Mon Sep 17 00:00:00 2001 From: flow Date: Tue, 18 Oct 2022 16:51:42 -0300 Subject: fix: don't take item from a possibly empty list The list gets destroyed when we take the last object, so things explode. :pensive: Signed-off-by: flow --- launcher/settings/INISettingsObject.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/launcher/settings/INISettingsObject.cpp b/launcher/settings/INISettingsObject.cpp index 3677e238..da962ee9 100644 --- a/launcher/settings/INISettingsObject.cpp +++ b/launcher/settings/INISettingsObject.cpp @@ -23,14 +23,16 @@ INISettingsObject::INISettingsObject(QStringList paths, QObject *parent) : SettingsObject(parent) { auto first_path = paths.constFirst(); - auto path = paths.takeFirst(); - while (!QFile::exists(path)) - path = paths.takeFirst(); + for (auto path : paths) { + if (!QFile::exists(path)) + continue; - if (path != first_path && QFile::exists(path)) { - // Copy the fallback to the preferred path. - QFile::copy(path, first_path); - qDebug() << "Copied settings from" << path << "to" << first_path; + if (path != first_path && QFile::exists(path)) { + // Copy the fallback to the preferred path. + QFile::copy(path, first_path); + qDebug() << "Copied settings from" << path << "to" << first_path; + break; + } } m_filePath = first_path; -- cgit From 888a87463ee2a81632cc85d4225fbc0b8b984026 Mon Sep 17 00:00:00 2001 From: Fayne Aldan Date: Tue, 18 Oct 2022 14:40:34 -0600 Subject: Add fallback for multimc.cfg Signed-off-by: Fayne Aldan --- launcher/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index b85729f0..d07ad99e 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -489,7 +489,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) // Initialize application settings { // Provide a fallback for migration from PolyMC - m_settings.reset(new INISettingsObject({ BuildConfig.LAUNCHER_CONFIGFILE, "polymc.cfg" }, this)); + m_settings.reset(new INISettingsObject({ BuildConfig.LAUNCHER_CONFIGFILE, "polymc.cfg", "multimc.cfg" }, this)); // Updates // Multiple channels are separated by spaces m_settings->registerSetting("UpdateChannel", BuildConfig.VERSION_CHANNEL); -- cgit From c9f81f56e9161a46fdf78b482f18827cf1a4bb00 Mon Sep 17 00:00:00 2001 From: Gideon9212 Date: Tue, 18 Oct 2022 18:35:03 -0700 Subject: Fix banner Removed boosted URL for plain Signed-off-by: Gideon9212 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd7751aa..25509222 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Portable builds are provided for AppImage on Linux, Windows, and macOS. ## Help & Support -[![Join the Discord Server](https://discordapp.com/api/guilds/1031648380885147709/widget.png?style=banner3)](https://discord.gg/prismlauncher) +[![Join the Discord Server](https://discordapp.com/api/guilds/1031648380885147709/widget.png?style=banner3)](https://discord.gg/hX4g537UNE) ## License -- 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 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 22365205f9be82f5194b97f4bc354c89bf7254ce Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 19 Oct 2022 12:17:06 +0200 Subject: fix: use display name for NSIS Signed-off-by: Sefa Eyeoglu --- program_info/CMakeLists.txt | 6 ++++-- program_info/win_install.nsi.in | 16 ++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index e46f63a3..62a01231 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -9,12 +9,14 @@ if(UNIX) endif() set(Launcher_CommonName "PrismLauncher") +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 "${Launcher_Copyright}" PARENT_SCOPE) set(Launcher_Domain "prismlauncher.org" PARENT_SCOPE) -set(Launcher_Name "${Launcher_CommonName}" PARENT_SCOPE) -set(Launcher_DisplayName "Prism Launcher" PARENT_SCOPE) set(Launcher_UserAgent "${Launcher_CommonName}/${Launcher_VERSION_NAME}" PARENT_SCOPE) set(Launcher_ConfigFile "prismlauncher.cfg" PARENT_SCOPE) set(Launcher_Git "https://github.com/PrismLauncher/PrismLauncher" PARENT_SCOPE) diff --git a/program_info/win_install.nsi.in b/program_info/win_install.nsi.in index 87e266f8..1c1f29da 100644 --- a/program_info/win_install.nsi.in +++ b/program_info/win_install.nsi.in @@ -104,8 +104,8 @@ OutFile "../@Launcher_CommonName@-Setup.exe" ; Version info VIProductVersion "@Launcher_VERSION_NAME4@" VIFileVersion "@Launcher_VERSION_NAME4@" -VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "@Launcher_CommonName@" -VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "@Launcher_CommonName@ Installer" +VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "@Launcher_DisplayName@" +VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "@Launcher_DisplayName@ Installer" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "@Launcher_Copyright@" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "@Launcher_VERSION_NAME4@" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "@Launcher_VERSION_NAME4@" @@ -139,12 +139,12 @@ Section "@Launcher_CommonName@" ${GetOptions} $R0 "/NoUninstaller" $R1 ${If} ${Errors} !define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\@Launcher_CommonName@" - WriteRegStr HKCU "${UNINST_KEY}" "DisplayName" "@Launcher_CommonName@" + WriteRegStr HKCU "${UNINST_KEY}" "DisplayName" "@Launcher_DisplayName@" WriteRegStr HKCU "${UNINST_KEY}" "DisplayIcon" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" WriteRegStr HKCU "${UNINST_KEY}" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteRegStr HKCU "${UNINST_KEY}" "QuietUninstallString" '"$INSTDIR\uninstall.exe" /S' WriteRegStr HKCU "${UNINST_KEY}" "InstallLocation" "$INSTDIR" - WriteRegStr HKCU "${UNINST_KEY}" "Publisher" "@Launcher_CommonName@ Contributors" + WriteRegStr HKCU "${UNINST_KEY}" "Publisher" "@Launcher_DisplayName@ Contributors" WriteRegStr HKCU "${UNINST_KEY}" "Version" "@Launcher_VERSION_NAME4@" WriteRegStr HKCU "${UNINST_KEY}" "DisplayVersion" "@Launcher_VERSION_NAME@" WriteRegStr HKCU "${UNINST_KEY}" "VersionMajor" "@Launcher_VERSION_MAJOR@" @@ -161,13 +161,13 @@ SectionEnd Section "Start Menu Shortcut" SM_SHORTCUTS - CreateShortcut "$SMPROGRAMS\@Launcher_CommonName@.lnk" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" "" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" 0 + CreateShortcut "$SMPROGRAMS\@Launcher_DisplayName@.lnk" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" "" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" 0 SectionEnd Section /o "Desktop Shortcut" DESKTOP_SHORTCUTS - CreateShortcut "$DESKTOP\@Launcher_CommonName@.lnk" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" "" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" 0 + CreateShortcut "$DESKTOP\@Launcher_DisplayName@.lnk" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" "" "$INSTDIR\@Launcher_APP_BINARY_NAME@.exe" 0 SectionEnd @@ -195,8 +195,8 @@ Section "Uninstall" RMDir /r $INSTDIR\styles RMDir /r $INSTDIR\tls - Delete "$SMPROGRAMS\@Launcher_CommonName@.lnk" - Delete "$DESKTOP\@Launcher_CommonName@.lnk" + Delete "$SMPROGRAMS\@Launcher_DisplayName@.lnk" + Delete "$DESKTOP\@Launcher_DisplayName@.lnk" RMDir "$INSTDIR" -- 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 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 50bbf2aacce0e525b8af8956aeffe0fdecd44b5c Mon Sep 17 00:00:00 2001 From: Sebastian Rüth Date: Tue, 18 Oct 2022 15:14:00 +0200 Subject: fix text clipping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sebastian Rüth --- launcher/ui/widgets/ProjectItem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher/ui/widgets/ProjectItem.cpp b/launcher/ui/widgets/ProjectItem.cpp index 01be88d9..93d3fca1 100644 --- a/launcher/ui/widgets/ProjectItem.cpp +++ b/launcher/ui/widgets/ProjectItem.cpp @@ -91,8 +91,8 @@ void ProjectItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o } // On the bottom, aligned to the left after the icon, and featuring at most two lines of text (with some margin space to spare) - painter->drawText(rect.x(), rect.y() + rect.height() - 2.2 * opt.fontMetrics.height(), remaining_width, - 2 * opt.fontMetrics.height(), Qt::TextWordWrap, description); + painter->drawText(rect.x(), rect.y() + rect.height() - 2.0 * opt.fontMetrics.height(), remaining_width, + 4 * opt.fontMetrics.height(), Qt::TextWordWrap, description); } painter->restore(); -- cgit From d6479e133d340dcd5ed265b49149627d8cb4fe5b Mon Sep 17 00:00:00 2001 From: flow Date: Tue, 18 Oct 2022 15:13:02 -0300 Subject: fix: properly center project descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In particular, this takes into account the space used by the title, so (hopefully) there won't be problems with custom themes with that. Signed-off-by: flow Signed-off-by: Sefa Eyeoglu Signed-off-by: Sebastian Rüth --- launcher/ui/widgets/ProjectItem.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/launcher/ui/widgets/ProjectItem.cpp b/launcher/ui/widgets/ProjectItem.cpp index 93d3fca1..1011d6e4 100644 --- a/launcher/ui/widgets/ProjectItem.cpp +++ b/launcher/ui/widgets/ProjectItem.cpp @@ -51,6 +51,8 @@ void ProjectItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o auto remaining_width = rect.width() - icon_width - 2 * icon_x_margin; rect.setRect(rect.x() + icon_width + 2 * icon_x_margin, rect.y(), remaining_width, rect.height()); + int title_height = 0; + { // Title painting auto title = index.data(UserDataTypes::TITLE).toString(); @@ -66,8 +68,10 @@ void ProjectItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o font.setPointSize(font.pointSize() + 2); painter->setFont(font); + title_height = QFontMetrics(font).height(); + // On the top, aligned to the left after the icon - painter->drawText(rect.x(), rect.y() + QFontMetrics(font).height(), title); + painter->drawText(rect.x(), rect.y() + title_height, title); painter->restore(); } @@ -90,9 +94,19 @@ void ProjectItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o description += cut_text.at(1).second; } + int description_x = rect.x(); + + // Have the y-value be set based on the number of lines in the description, to centralize the + // description text with the space between the base and the title. + int description_y = rect.y() + title_height + (rect.height() - title_height) / 2; + if (cut_text.size() == 1) + description_y -= opt.fontMetrics.height() / 2; + else + description_y -= opt.fontMetrics.height(); + // On the bottom, aligned to the left after the icon, and featuring at most two lines of text (with some margin space to spare) - painter->drawText(rect.x(), rect.y() + rect.height() - 2.0 * opt.fontMetrics.height(), remaining_width, - 4 * opt.fontMetrics.height(), Qt::TextWordWrap, description); + painter->drawText(description_x, description_y, remaining_width, + cut_text.size() * opt.fontMetrics.height(), Qt::TextWordWrap, description); } painter->restore(); -- cgit From 6439ef11aae3e4c716d78b6ad87fedba4887f778 Mon Sep 17 00:00:00 2001 From: MMK21Hub Date: Wed, 19 Oct 2022 19:21:48 +0100 Subject: Fix incorrect release titles Signed-off-by: MMK21Hub --- .github/workflows/trigger_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml index 476280df..e74e870a 100644 --- a/.github/workflows/trigger_release.yml +++ b/.github/workflows/trigger_release.yml @@ -65,7 +65,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} - name: PrismLauncher ${{ env.VERSION }} + name: Prism Launcher ${{ env.VERSION }} draft: true prerelease: false files: | -- cgit From 297c593edd3cc2f713aa44b86fcd3c45004fe3b7 Mon Sep 17 00:00:00 2001 From: TheEvilSkeleton Date: Tue, 18 Oct 2022 21:52:23 -0400 Subject: Improve approachability Signed-off-by: TheEvilSkeleton --- .../org.prismlauncher.PrismLauncher.desktop.in | 4 ++-- .../org.prismlauncher.PrismLauncher.metainfo.xml.in | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/program_info/org.prismlauncher.PrismLauncher.desktop.in b/program_info/org.prismlauncher.PrismLauncher.desktop.in index 63a6b586..e608f588 100644 --- a/program_info/org.prismlauncher.PrismLauncher.desktop.in +++ b/program_info/org.prismlauncher.PrismLauncher.desktop.in @@ -7,6 +7,6 @@ Terminal=false Exec=@Launcher_APP_BINARY_NAME@ StartupNotify=true Icon=org.prismlauncher.PrismLauncher -Categories=Game; -Keywords=game;minecraft;launcher;mc; +Categories=Game;ActionGame;AdventureGame;Simulation; +Keywords=game;minecraft;launcher;mc;multimc;polymc; StartupWMClass=PrismLauncher diff --git a/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in b/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in index 2e10f7be..55965eb7 100644 --- a/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in +++ b/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in @@ -1,33 +1,35 @@ org.prismlauncher.PrismLauncher - - org.prismlauncher.PrismLauncher - org.prismlauncher.PrismLauncher.desktop - PrismLauncher - PrismLauncher + Prism Launcher + Prism Launcher Contributors A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once CC0-1.0 GPL-3.0-only https://prismlauncher.org/ https://prismlauncher.org/wiki/ + https://github.com/PrismLauncher/PrismLauncher/issues + https://discord.gg/prismlauncher + https://github.com/PrismLauncher/PrismLauncher + https://github.com/PrismLauncher/PrismLauncher/blob/develop/CONTRIBUTING.md + https://hosted.weblate.org/projects/prismlauncher/launcher -

PrismLauncher is a custom launcher for Minecraft that focuses on predictability, long term stability and simplicity.

+

Prism Launcher is a custom launcher for Minecraft that focuses on predictability, long term stability and simplicity.

Features:

  • Easily install game modifications, such as Fabric, Forge and Quilt
  • -
  • Control your java settings
  • +
  • Control your Java settings
  • Manage worlds and resource packs from the launcher
  • See logs and other details easily
  • Kill Minecraft in case of a crash/freeze
  • -
  • Isolate minecraft instances to keep everything clean
  • +
  • Isolate Minecraft instances to keep everything clean
  • Install and update mods directly from the launcher
- The main PrismLauncher window + The main Prism Launcher window https://prismlauncher.org/img/screenshots/LauncherDark.png -- cgit From d7478c14fdbbe1554d8bb434ecc9afefd23bd5a5 Mon Sep 17 00:00:00 2001 From: Jackson Huffstutler Date: Wed, 19 Oct 2022 16:03:18 -0500 Subject: Renamed inappropriate instances of "PrismLauncher" to "Prism Launcher" Signed-off-by: IroncladLandship --- CMakeLists.txt | 2 +- program_info/README.md | 4 ++-- program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a3b74a73..131d3e53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ endif() ##################################### Set Application options ##################################### ######## Set URLs ######## -set(Launcher_NEWS_RSS_URL "https://prismlauncher.org/feed/feed.xml" CACHE STRING "URL to fetch PrismLauncher's news RSS feed from.") +set(Launcher_NEWS_RSS_URL "https://prismlauncher.org/feed/feed.xml" CACHE STRING "URL to fetch Prism Launcher's news RSS feed from.") set(Launcher_NEWS_OPEN_URL "https://prismlauncher.org/news" CACHE STRING "URL that gets opened when the user clicks 'More News'") set(Launcher_HELP_URL "https://prismlauncher.org/wiki/help-pages/%1" CACHE STRING "URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help") diff --git a/program_info/README.md b/program_info/README.md index 8fc81a19..5ba2fa32 100644 --- a/program_info/README.md +++ b/program_info/README.md @@ -1,6 +1,6 @@ -# PrismLauncher Program Info +# Prism Launcher Program Info -This is PrismLauncher's program info which contains information about: +This is Prism Launcher's program info which contains information about: - Application name and logo (and branding in general) - Various URLs and API endpoints diff --git a/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in b/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in index 2e10f7be..5fca93ac 100644 --- a/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in +++ b/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in @@ -5,15 +5,15 @@ org.prismlauncher.PrismLauncher org.prismlauncher.PrismLauncher.desktop - PrismLauncher - PrismLauncher + Prism Launcher + Prism Launcher A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once CC0-1.0 GPL-3.0-only https://prismlauncher.org/ https://prismlauncher.org/wiki/ -

PrismLauncher is a custom launcher for Minecraft that focuses on predictability, long term stability and simplicity.

+

Prism Launcher is a custom launcher for Minecraft that focuses on predictability, long term stability and simplicity.

Features:

  • Easily install game modifications, such as Fabric, Forge and Quilt
  • @@ -27,7 +27,7 @@ - The main PrismLauncher window + The main Prism Launcher window https://prismlauncher.org/img/screenshots/LauncherDark.png -- cgit From 513d93cfc786a1f0d359f6ef109577eb2e713ca9 Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Wed, 19 Oct 2022 23:16:42 +0100 Subject: Change the derivation to have parity with nixpkgs - Symlink rather than copying libraries - Update maintainers - Reformat with nixpkgs-fmt Signed-off-by: Skyler Grey --- nix/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nix/default.nix b/nix/default.nix index c8b4f7cc..c7fc7576 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -59,20 +59,20 @@ stdenv.mkDerivation rec { # Copy libnbtplusplus rm -rf source/libraries/libnbtplusplus mkdir source/libraries/libnbtplusplus - cp -a ${libnbtplusplus}/* source/libraries/libnbtplusplus - chmod a+r+w source/libraries/libnbtplusplus/* + ln -s ${libnbtplusplus}/* source/libraries/libnbtplusplus + chmod -R +r+w source/libraries/libnbtplusplus # Copy tomlplusplus rm -rf source/libraries/tomlplusplus mkdir source/libraries/tomlplusplus - cp -a ${tomlplusplus}/* source/libraries/tomlplusplus - chmod a+r+w source/libraries/tomlplusplus/* + ln -s ${tomlplusplus}/* source/libraries/tomlplusplus + chmod -R +r+w source/libraries/tomlplusplus ''; cmakeFlags = [ "-GNinja" "-DLauncher_QT_VERSION_MAJOR=${lib.versions.major qtbase.version}" ] ++ lib.optionals enableLTO [ "-DENABLE_LTO=on" ] - ++ lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ]; + ++ lib.optionals (msaClientID != "") [ "-DLauncher_MSA_CLIENT_ID=${msaClientID}" ]; # we have to check if the system is NixOS before adding stdenv.cc.cc.lib (#923) postInstall = '' @@ -96,6 +96,6 @@ stdenv.mkDerivation rec { ''; platforms = platforms.unix; license = licenses.gpl3Only; - maintainers = with maintainers; [ starcraft66 kloenk ]; + maintainers = with maintainers; [ minion3665 Scrumplex ]; }; } -- cgit From dab091a7b776c66541238db6805022fcf4432406 Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Wed, 19 Oct 2022 23:40:49 +0100 Subject: Update NIX.md so it has more methods + is clearer - Add proper headings - Change flake codeblocks so that configuration stuff isn't in the same place as flake.nix stuff - Add instructions for not using the overlay with flakes - Add instructions for running ad-hoc with flakes Signed-off-by: Skyler Grey --- nix/NIX.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/nix/NIX.md b/nix/NIX.md index e57d5be7..980d20e8 100644 --- a/nix/NIX.md +++ b/nix/NIX.md @@ -1,21 +1,59 @@ -# How to import +# Running on Nix -To import with flakes use +## Putting it in your system configuration + +### On flakes-enabled nix + +#### Directly installing + +The `prismlauncher` flake provides a package which you can install along with +the rest of your packages ```nix +# In your flake.nix: { inputs = { prismlauncher.url = "github:PrismLauncher/PrismLauncher"; }; +} +``` -... +```nix +# And in your system configuration: +environment.systemPackages = [ prismlauncher.packages.${pkgs.system}.prismlauncher ]; - nixpkgs.overlays = [ inputs.prismlauncher.overlay ]; ## Within configuration.nix - environment.systemPackages = with pkgs; [ prismlauncher ]; ## +# Or in your home-manager configuration: +home.packages = [ prismlauncher.packages.${pkgs.system}.prismlauncher ]; +``` + +#### Using the overlay + +Alternatively, you can overlay the prismlauncher version in nixpkgs which will +allow you to install using `pkgs` as you normally would while also using the +latest version + +```nix +# In your flake.nix: +{ + inputs = { + prismlauncher.url = "github:PrismLauncher/PrismLauncher"; + }; } ``` -To import without flakes use channels: +```nix +# And in your system configuration: +nixpkgs.overlays = [ inputs.prismlauncher.overlay ]; +environment.systemPackages = [ pkgs.prismlauncher ]; + +# Or in your home-manager configuration: +config.nixpkgs.overlays = [ inputs.prismlauncher.overlay ]; +home.packages = [ pkgs.prismlauncher ]; +``` + +### Without flakes-enabled nix + +#### Using channels ```sh nix-channel --add https://github.com/PrismLauncher/PrismLauncher/archive/master.tar.gz prismlauncher @@ -23,9 +61,10 @@ nix-channel --update prismlauncher nix-env -iA prismlauncher ``` -or alternatively you can use +#### Using the overlay ```nix +# In your configuration.nix: { nixpkgs.overlays = [ (import (builtins.fetchTarball "https://github.com/PrismLauncher/PrismLauncher/archive/develop.tar.gz")).overlay @@ -34,3 +73,11 @@ or alternatively you can use environment.systemPackages = with pkgs; [ prismlauncher ]; } ``` + +## Running ad-hoc + +If you're on a flakes-enabled nix you can run the launcher in one-line + +```sh +nix run github:PrismLauncher/PrismLauncher +``` -- cgit From ae910eea62b07217a4407753f75487e500b33452 Mon Sep 17 00:00:00 2001 From: Jacob Gogichaishvili Date: Tue, 18 Oct 2022 18:08:34 +0400 Subject: Change issue templates to Prism branding Signed-off-by: Jacob Gogichaishvili --- .github/ISSUE_TEMPLATE/bug_report.yml | 12 ++++++------ .github/ISSUE_TEMPLATE/rfc.yml | 4 ++-- .github/ISSUE_TEMPLATE/suggestion.yml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index ab3c8a29..9166fcf2 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -8,9 +8,9 @@ body: If you need help with running Minecraft, please visit us on our Discord before making a bug report. Before submitting a bug report, please make sure you have read this *entire* form, and that: - * You have read the [PolyMC wiki](https://polymc.org/wiki/) and it has not answered your question. + * You have read the [PrismLauncher wiki](https://polymc.org/wiki/) and it has not answered your question. * Your bug is not caused by Minecraft or any mods you have installed. - * Your issue has not been reported before, [make sure to use the search function!](https://github.com/PolyMC/PolyMC/issues) + * Your issue has not been reported before, [make sure to use the search function!](https://github.com/PrismLauncher/PrismLauncher/issues) **Do not forget to give your issue a descriptive title.** "Bug in the instance screen" makes it hard to distinguish issues at a glance. - type: dropdown @@ -25,15 +25,15 @@ body: - Other - type: textarea attributes: - label: Version of PolyMC - description: The version of PolyMC used in the bug report. - placeholder: PolyMC 1.4.1 + label: Version of PrismLauncher + description: The version of PrismLauncher used in the bug report. + placeholder: PrismLauncher 1.4.1 validations: required: true - type: textarea attributes: label: Version of Qt - description: The version of Qt used in the bug report. You can find it in Help -> About PolyMC -> About Qt. + description: The version of Qt used in the bug report. You can find it in Help -> About PrismLauncher -> About Qt. placeholder: Qt 6.3.0 validations: required: true diff --git a/.github/ISSUE_TEMPLATE/rfc.yml b/.github/ISSUE_TEMPLATE/rfc.yml index 0a40d01d..506e2b86 100644 --- a/.github/ISSUE_TEMPLATE/rfc.yml +++ b/.github/ISSUE_TEMPLATE/rfc.yml @@ -6,7 +6,7 @@ body: - type: markdown attributes: value: | - ### Use this form to suggest a larger change for PolyMC. + ### Use this form to suggest a larger change for PrismLauncher. - type: textarea attributes: label: Goal @@ -18,7 +18,7 @@ body: attributes: label: Motivation description: | - Introduce the topic. If this is a not-well-known section of PolyMC, a detailed explanation of the background is recommended. + Introduce the topic. If this is a not-well-known section of PrismLauncher, a detailed explanation of the background is recommended. Some example points of discussion: - What specific problems are you facing right now that you're trying to address? - Are there any previous discussions? Link to them and summarize them (don't force your readers to read them though!). diff --git a/.github/ISSUE_TEMPLATE/suggestion.yml b/.github/ISSUE_TEMPLATE/suggestion.yml index 48f157b3..a82643cc 100644 --- a/.github/ISSUE_TEMPLATE/suggestion.yml +++ b/.github/ISSUE_TEMPLATE/suggestion.yml @@ -5,25 +5,25 @@ body: - type: markdown attributes: value: | - ### Use this form to suggest a feature for PolyMC. + ### Use this form to suggest a feature for PrismLauncher. - type: input attributes: label: Role - description: In what way do you use PolyMC that needs this feature? + description: In what way do you use PrismLauncher that needs this feature? placeholder: I play modded Minecraft. validations: required: true - type: input attributes: label: Suggestion - description: What do you want PolyMC to do? + description: What do you want PrismLauncher to do? placeholder: I want the cat button to meow. validations: required: true - type: input attributes: label: Benefit - description: Why do you need PolyMC to do this? + description: Why do you need PrismLauncher to do this? placeholder: so that I can always hear a cat when I need to. validations: required: true -- cgit From 42ed7e46269dd7fec1ede26ebafbf7858a35b512 Mon Sep 17 00:00:00 2001 From: Jacob Gogichaishvili Date: Tue, 18 Oct 2022 18:08:46 +0400 Subject: Remove Matrix room link until one is created Signed-off-by: Jacob Gogichaishvili --- .github/ISSUE_TEMPLATE/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 932d0c8f..dbbfe24f 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: true -contact_links: - - name: PolyMC Matrix Support Room - url: https://matrix.to/#/#support:polymc.org - about: Please ask for support here before opening an issue. +# contact_links: +# - name: PrismLauncher Matrix Support Room +# url: about:blank # Add proper link in the future +# about: (⚠ Room not created yet ⚠) Please ask for support here before opening an issue. -- cgit From a99b9e80b870f5722f31e1854295d49dbde23d0f Mon Sep 17 00:00:00 2001 From: Jacob Gogichaishvili Date: Tue, 18 Oct 2022 18:08:53 +0400 Subject: Remove PolyMC's OpenCollective Signed-off-by: Jacob Gogichaishvili --- .github/FUNDING.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 247675fc..3671160b 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1,2 @@ -open_collective: polymc +# Commented out until further notice +# open_collective: polymc -- cgit From 3f2e5633b456daaabe7de28293a73c55d8ae1a06 Mon Sep 17 00:00:00 2001 From: TheOPtimal <41379516+TheOPtimal@users.noreply.github.com> Date: Wed, 19 Oct 2022 09:12:43 +0400 Subject: Add OpenCollective Co-authored-by: Fayne Aldan Signed-off-by: TheOPtimal <41379516+TheOPtimal@users.noreply.github.com> Signed-off-by: Jacob Gogichaishvili --- .github/FUNDING.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 3671160b..6d05e3da 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1 @@ -# Commented out until further notice -# open_collective: polymc +open_collective: prismlauncher -- cgit From 32eebd3ca7a405c9c7815ca0bff8abb2e0a4b12a Mon Sep 17 00:00:00 2001 From: TheOPtimal <41379516+TheOPtimal@users.noreply.github.com> Date: Wed, 19 Oct 2022 09:13:54 +0400 Subject: PrismLauncher → Prism Launcher MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fayne Aldan Co-authored-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com> Signed-off-by: TheOPtimal <41379516+TheOPtimal@users.noreply.github.com> Signed-off-by: Jacob Gogichaishvili --- .github/ISSUE_TEMPLATE/bug_report.yml | 8 ++++---- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/ISSUE_TEMPLATE/rfc.yml | 4 ++-- .github/ISSUE_TEMPLATE/suggestion.yml | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 9166fcf2..5521ecde 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -8,7 +8,7 @@ body: If you need help with running Minecraft, please visit us on our Discord before making a bug report. Before submitting a bug report, please make sure you have read this *entire* form, and that: - * You have read the [PrismLauncher wiki](https://polymc.org/wiki/) and it has not answered your question. + * You have read the [Prism Launcher wiki](https://prismlauncher.org/wiki/) and it has not answered your question. * Your bug is not caused by Minecraft or any mods you have installed. * Your issue has not been reported before, [make sure to use the search function!](https://github.com/PrismLauncher/PrismLauncher/issues) @@ -25,15 +25,15 @@ body: - Other - type: textarea attributes: - label: Version of PrismLauncher - description: The version of PrismLauncher used in the bug report. + label: Version of Prism Launcher + description: The version of Prism Launcher used in the bug report. placeholder: PrismLauncher 1.4.1 validations: required: true - type: textarea attributes: label: Version of Qt - description: The version of Qt used in the bug report. You can find it in Help -> About PrismLauncher -> About Qt. + description: The version of Qt used in the bug report. You can find it in Help -> About Prism Launcher -> About Qt. placeholder: Qt 6.3.0 validations: required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index dbbfe24f..36afd2b6 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: true # contact_links: -# - name: PrismLauncher Matrix Support Room +# - name: Prism Launcher Matrix Support Room # url: about:blank # Add proper link in the future # about: (⚠ Room not created yet ⚠) Please ask for support here before opening an issue. diff --git a/.github/ISSUE_TEMPLATE/rfc.yml b/.github/ISSUE_TEMPLATE/rfc.yml index 506e2b86..fa7cdbe6 100644 --- a/.github/ISSUE_TEMPLATE/rfc.yml +++ b/.github/ISSUE_TEMPLATE/rfc.yml @@ -6,7 +6,7 @@ body: - type: markdown attributes: value: | - ### Use this form to suggest a larger change for PrismLauncher. + ### Use this form to suggest a larger change for Prism Launcher. - type: textarea attributes: label: Goal @@ -18,7 +18,7 @@ body: attributes: label: Motivation description: | - Introduce the topic. If this is a not-well-known section of PrismLauncher, a detailed explanation of the background is recommended. + Introduce the topic. If this is a not-well-known section of Prism Launcher, a detailed explanation of the background is recommended. Some example points of discussion: - What specific problems are you facing right now that you're trying to address? - Are there any previous discussions? Link to them and summarize them (don't force your readers to read them though!). diff --git a/.github/ISSUE_TEMPLATE/suggestion.yml b/.github/ISSUE_TEMPLATE/suggestion.yml index a82643cc..ddee86b6 100644 --- a/.github/ISSUE_TEMPLATE/suggestion.yml +++ b/.github/ISSUE_TEMPLATE/suggestion.yml @@ -5,25 +5,25 @@ body: - type: markdown attributes: value: | - ### Use this form to suggest a feature for PrismLauncher. + ### Use this form to suggest a feature for Prism Launcher. - type: input attributes: label: Role - description: In what way do you use PrismLauncher that needs this feature? + description: In what way do you use Prism Launcher that needs this feature? placeholder: I play modded Minecraft. validations: required: true - type: input attributes: label: Suggestion - description: What do you want PrismLauncher to do? + description: What do you want Prism Launcher to do? placeholder: I want the cat button to meow. validations: required: true - type: input attributes: label: Benefit - description: Why do you need PrismLauncher to do this? + description: Why do you need Prism Launcher to do this? placeholder: so that I can always hear a cat when I need to. validations: required: true -- cgit From ab68d9198d07674952f99a63bb0901f8a410ce5c Mon Sep 17 00:00:00 2001 From: TheOPtimal <41379516+TheOPtimal@users.noreply.github.com> Date: Wed, 19 Oct 2022 09:14:27 +0400 Subject: PrismLauncher → Prism Launcher (again) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: DioEgizio <83089242+DioEgizio@users.noreply.github.com> Signed-off-by: TheOPtimal <41379516+TheOPtimal@users.noreply.github.com> Signed-off-by: Jacob Gogichaishvili --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 5521ecde..ea1fbfdd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -27,7 +27,7 @@ body: attributes: label: Version of Prism Launcher description: The version of Prism Launcher used in the bug report. - placeholder: PrismLauncher 1.4.1 + placeholder: Prism Launcher 5.0 validations: required: true - type: textarea -- cgit From b6aa33f3a6d0ec6daf842f4ab62ea901b9e39129 Mon Sep 17 00:00:00 2001 From: TheOPtimal <41379516+TheOPtimal@users.noreply.github.com> Date: Wed, 19 Oct 2022 09:24:43 +0400 Subject: Add Matrix Room Co-authored-by: Fayne Aldan Signed-off-by: TheOPtimal <41379516+TheOPtimal@users.noreply.github.com> Signed-off-by: Jacob Gogichaishvili --- .github/ISSUE_TEMPLATE/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 36afd2b6..97a55db3 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: true -# contact_links: -# - name: Prism Launcher Matrix Support Room -# url: about:blank # Add proper link in the future -# about: (⚠ Room not created yet ⚠) Please ask for support here before opening an issue. +contact_links: + - name: Prism Launcher Matrix Support Room + url: https://matrix.to/#/#prism-support:matrix.org + about: Please ask for support here before opening an issue. -- cgit From b46c4a81e0355189d90f33567b21ac07872fc2a4 Mon Sep 17 00:00:00 2001 From: Sebastian Rueth Date: Thu, 20 Oct 2022 08:02:05 +0200 Subject: check space requirements of project description if there isn't enough space for 2 lines of project description, only draw one Signed-off-by: Sebastian Rueth --- launcher/ui/widgets/ProjectItem.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/launcher/ui/widgets/ProjectItem.cpp b/launcher/ui/widgets/ProjectItem.cpp index 1011d6e4..49baf3e8 100644 --- a/launcher/ui/widgets/ProjectItem.cpp +++ b/launcher/ui/widgets/ProjectItem.cpp @@ -86,20 +86,25 @@ void ProjectItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o // Get first line unconditionally description = cut_text.first().second; + auto num_lines = 1; + // Get second line, elided if needed - if (cut_text.size() > 1) { - if (cut_text.size() > 2) + if (cut_text.size() > 1 && rect.height() - title_height > opt.fontMetrics.height() * 2) { + if (cut_text.size() > 2) { description += opt.fontMetrics.elidedText(cut_text.at(1).second, opt.textElideMode, cut_text.at(1).first); - else + } else { description += cut_text.at(1).second; + } + num_lines += 1; } int description_x = rect.x(); + // Have the y-value be set based on the number of lines in the description, to centralize the // description text with the space between the base and the title. int description_y = rect.y() + title_height + (rect.height() - title_height) / 2; - if (cut_text.size() == 1) + if (num_lines == 1) description_y -= opt.fontMetrics.height() / 2; else description_y -= opt.fontMetrics.height(); -- cgit From 6f2d6425a2c753e9ce8c702600bfe5609cb9d2b0 Mon Sep 17 00:00:00 2001 From: Zeke Date: Thu, 20 Oct 2022 16:54:57 +1000 Subject: update meta to not break flatpak Signed-off-by: Zeke --- program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in b/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in index 55965eb7..13a860d9 100644 --- a/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in +++ b/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in @@ -38,7 +38,7 @@ Mod installation - https://prismlauncher.org/img/screenshots/ModInstallDark.png + https://prismlauncher.org/img/screenshots/ModInstallDark.png Mod updating -- cgit From 8e754d9a564e18f69585b913480b1192d23f7f75 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 19 Oct 2022 18:29:07 +0200 Subject: fix: update README Signed-off-by: Sefa Eyeoglu --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 47fbcc62..acbe4aaa 100644 --- a/README.md +++ b/README.md @@ -5,25 +5,80 @@ 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). +This is a **fork** of the MultiMC Launcher and not endorsed by MultiMC. ## Installation -- All downloads and instructions for Prism Launcher will soon be available. +- All downloads and instructions for Prism Launcher can be found [on our website](https://prismlauncher.org/download/). - Last build status can be found [here](https://github.com/PrismLauncher/PrismLauncher/actions). ### Development Builds There are development builds available [here](https://github.com/PrismLauncher/PrismLauncher/actions). These have debug information in the binaries, so their file sizes are relatively larger. -Portable builds are provided for AppImage on Linux, Windows, and macOS. +Portable builds are provided for on Linux, Windows, and macOS. +For Debian and Arch, you can use these packages for the latest development versions: +[![prismlauncher-git](https://img.shields.io/badge/aur-prismlauncher--git-blue)](https://aur.archlinux.org/packages/prismlauncher-git/) +[![prismlauncher-git](https://img.shields.io/badge/mpr-prismlauncher--git-orange)](https://mpr.makedeb.org/packages/prismlauncher-git) ## Help & Support +Feel free to create an issue if you need help. However, you might find it easier to ask in the Discord server. -[![Join the Discord Server](https://discordapp.com/api/guilds/1031648380885147709/widget.png?style=banner3)](https://discord.gg/hX4g537UNE) +[![Prism Launcher Discord server](https://discordapp.com/api/guilds/1031648380885147709/widget.png?style=banner3)](https://discord.gg/prismlauncher) +We will also soon be opening up our Matrix channels. +You can already join our Matrix space: + +[![PrismLauncher Space](https://img.shields.io/matrix/prismlauncher:matrix.org?label=PrismLauncher%20space)](https://matrix.to/#/#prismlauncher:matrix.org) + +We also have a subreddit you can post your issues and suggestions on: + +[r/PrismLauncher](https://www.reddit.com/r/PrismLauncher/) + +## Building + +If you want to build Prism Launcher yourself, check [Build Instructions](https://prismlauncher.org/wiki/development/build-instructions/) for build instructions. + +## Translations + +The translation effort for PrismLauncher is hosted on [Weblate](https://hosted.weblate.org/projects/prismlauncher/launcher/) and information about translating Prism Launcher is available at + +## Forking/Redistributing/Custom builds policy + +We don't care what you do with your fork/custom build as long as you follow the terms of the [license](LICENSE) (this is a legal responsibility), and if you made code changes rather than just packaging a custom build, please do the following as a basic courtesy: + +- Make it clear that your fork is not PrismLauncher and is not endorsed by or affiliated with the PrismLauncher project (). +- Go through [CMakeLists.txt](CMakeLists.txt) and change PrismLauncher's API keys to your own or set them to empty strings (`""`) to disable them (this way the program will still compile but the functionality requiring those keys will be disabled). + +If you have any questions or want any clarification on the above conditions please make an issue and ask us. + +Be aware that if you build this software without removing the provided API keys in [CMakeLists.txt](CMakeLists.txt) you are accepting the following terms and conditions: + +- [Microsoft Identity Platform Terms of Use](https://docs.microsoft.com/en-us/legal/microsoft-identity-platform/terms-of-use) +- [CurseForge 3rd Party API Terms and Conditions](https://support.curseforge.com/en/support/solutions/articles/9000207405-curse-forge-3rd-party-api-terms-and-conditions) + +If you do not agree with these terms and conditions, then remove the associated API keys from the [CMakeLists.txt](CMakeLists.txt) file by setting them to an empty string (`""`). ## License All launcher code is available under the GPL-3.0-only license. + +The logo and related assets are under the CC BY-SA 4.0 license. + +## Sponsors + +Thanks to JetBrains for providing us a few licenses for all their products, as part of their [Open Source program](https://www.jetbrains.com/opensource/). + +[![JetBrains](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/opensource/) + +Also thanks to Weblate for hosting our translation efforts. + + +Translation status + + +Additionally, thanks to the awesome people over at [MacStadium](https://www.macstadium.com/), for providing M1-Macs for development purposes! + +Powered by MacStadium + -- cgit From 5d2763382128fb6ddbdc34ca803dc1b0f582d318 Mon Sep 17 00:00:00 2001 From: flow Date: Thu, 20 Oct 2022 14:51:09 -0300 Subject: fix: show a single line in ProjectItem's desc. when there's no more space Signed-off-by: flow --- launcher/ui/widgets/ProjectItem.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/launcher/ui/widgets/ProjectItem.cpp b/launcher/ui/widgets/ProjectItem.cpp index 49baf3e8..d1ff9dbc 100644 --- a/launcher/ui/widgets/ProjectItem.cpp +++ b/launcher/ui/widgets/ProjectItem.cpp @@ -89,13 +89,19 @@ void ProjectItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o auto num_lines = 1; // Get second line, elided if needed - if (cut_text.size() > 1 && rect.height() - title_height > opt.fontMetrics.height() * 2) { - if (cut_text.size() > 2) { - description += opt.fontMetrics.elidedText(cut_text.at(1).second, opt.textElideMode, cut_text.at(1).first); + if (cut_text.size() > 1) { + // 2.5x so because there should be some margin left from the 2x so things don't get too squishy. + if (rect.height() - title_height <= 2.5 * opt.fontMetrics.height()) { + // If there's not enough space, show only a single line, elided. + description = opt.fontMetrics.elidedText(description, opt.textElideMode, cut_text.at(0).first); } else { - description += cut_text.at(1).second; + if (cut_text.size() > 2) { + description += opt.fontMetrics.elidedText(cut_text.at(1).second, opt.textElideMode, cut_text.at(1).first); + } else { + description += cut_text.at(1).second; + } + num_lines += 1; } - num_lines += 1; } int description_x = rect.x(); -- 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(-) 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 ece206b81cdffac0459c61dabb80d31f85de254d Mon Sep 17 00:00:00 2001 From: Chrono-byte Date: Thu, 20 Oct 2022 15:22:04 -0400 Subject: Remove erroneous space Signed-off-by: Chrono-byte --- program_info/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index 8cbc2d36..f6e2ea84 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 © 2021-2022 PolyMC 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(+) 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 From 01b90809e8be2bef02644ba91feceb21b6f7cb8f Mon Sep 17 00:00:00 2001 From: flow Date: Thu, 20 Oct 2022 16:55:22 -0300 Subject: fix: memory leak when finishing blocked mods job Signed-off-by: flow --- launcher/modplatform/flame/FileResolvingTask.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/launcher/modplatform/flame/FileResolvingTask.cpp b/launcher/modplatform/flame/FileResolvingTask.cpp index 1e7f5559..0b2431f7 100644 --- a/launcher/modplatform/flame/FileResolvingTask.cpp +++ b/launcher/modplatform/flame/FileResolvingTask.cpp @@ -66,7 +66,11 @@ void Flame::FileResolvingTask::netJobFinished() } index++; } - connect(job, &NetJob::finished, this, &Flame::FileResolvingTask::modrinthCheckFinished); + connect(job, &NetJob::finished, this, + [this, &job] { + modrinthCheckFinished(); + job->deleteLater(); + }); job->start(); } -- cgit From 31dc92dafecc7924d937f10184dff28838c1f69a Mon Sep 17 00:00:00 2001 From: leo78913 Date: Thu, 20 Oct 2022 17:48:57 -0300 Subject: add icons to the instance menu and 4 new icons: delete rename tag export Signed-off-by: leo78913 --- launcher/resources/OSX/OSX.qrc | 4 ++ launcher/resources/OSX/scalable/delete.svg | 49 +++++++++++++++++ launcher/resources/OSX/scalable/export.svg | 65 +++++++++++++++++++++++ launcher/resources/OSX/scalable/rename.svg | 27 ++++++++++ launcher/resources/OSX/scalable/tag.svg | 35 ++++++++++++ launcher/resources/flat/flat.qrc | 4 ++ launcher/resources/flat/scalable/delete.svg | 17 ++++++ launcher/resources/flat/scalable/export.svg | 16 ++++++ launcher/resources/flat/scalable/rename.svg | 17 ++++++ launcher/resources/flat/scalable/tag.svg | 17 ++++++ launcher/resources/iOS/iOS.qrc | 4 ++ launcher/resources/iOS/scalable/delete.svg | 31 +++++++++++ launcher/resources/iOS/scalable/export.svg | 34 ++++++++++++ launcher/resources/iOS/scalable/rename.svg | 16 ++++++ launcher/resources/iOS/scalable/tag.svg | 20 +++++++ launcher/resources/pe_blue/pe_blue.qrc | 4 ++ launcher/resources/pe_blue/scalable/delete.svg | 35 ++++++++++++ launcher/resources/pe_blue/scalable/export.svg | 40 ++++++++++++++ launcher/resources/pe_blue/scalable/rename.svg | 19 +++++++ launcher/resources/pe_blue/scalable/tag.svg | 39 ++++++++++++++ launcher/resources/pe_colored/pe_colored.qrc | 4 ++ launcher/resources/pe_colored/scalable/delete.svg | 49 +++++++++++++++++ launcher/resources/pe_colored/scalable/export.svg | 44 +++++++++++++++ launcher/resources/pe_colored/scalable/rename.svg | 22 ++++++++ launcher/resources/pe_colored/scalable/tag.svg | 42 +++++++++++++++ launcher/resources/pe_dark/pe_dark.qrc | 4 ++ launcher/resources/pe_dark/scalable/delete.svg | 24 +++++++++ launcher/resources/pe_dark/scalable/export.svg | 36 +++++++++++++ launcher/resources/pe_dark/scalable/rename.svg | 19 +++++++ launcher/resources/pe_dark/scalable/tag.svg | 38 +++++++++++++ launcher/resources/pe_light/pe_light.qrc | 4 ++ launcher/resources/pe_light/scalable/delete.svg | 20 +++++++ launcher/resources/pe_light/scalable/export.svg | 37 +++++++++++++ launcher/resources/pe_light/scalable/rename.svg | 19 +++++++ launcher/resources/pe_light/scalable/tag.svg | 23 ++++++++ launcher/ui/MainWindow.cpp | 9 +++- 36 files changed, 886 insertions(+), 1 deletion(-) create mode 100644 launcher/resources/OSX/scalable/delete.svg create mode 100644 launcher/resources/OSX/scalable/export.svg create mode 100644 launcher/resources/OSX/scalable/rename.svg create mode 100644 launcher/resources/OSX/scalable/tag.svg create mode 100644 launcher/resources/flat/scalable/delete.svg create mode 100644 launcher/resources/flat/scalable/export.svg create mode 100644 launcher/resources/flat/scalable/rename.svg create mode 100644 launcher/resources/flat/scalable/tag.svg create mode 100644 launcher/resources/iOS/scalable/delete.svg create mode 100644 launcher/resources/iOS/scalable/export.svg create mode 100644 launcher/resources/iOS/scalable/rename.svg create mode 100644 launcher/resources/iOS/scalable/tag.svg create mode 100644 launcher/resources/pe_blue/scalable/delete.svg create mode 100644 launcher/resources/pe_blue/scalable/export.svg create mode 100644 launcher/resources/pe_blue/scalable/rename.svg create mode 100644 launcher/resources/pe_blue/scalable/tag.svg create mode 100644 launcher/resources/pe_colored/scalable/delete.svg create mode 100644 launcher/resources/pe_colored/scalable/export.svg create mode 100644 launcher/resources/pe_colored/scalable/rename.svg create mode 100644 launcher/resources/pe_colored/scalable/tag.svg create mode 100644 launcher/resources/pe_dark/scalable/delete.svg create mode 100644 launcher/resources/pe_dark/scalable/export.svg create mode 100644 launcher/resources/pe_dark/scalable/rename.svg create mode 100644 launcher/resources/pe_dark/scalable/tag.svg create mode 100644 launcher/resources/pe_light/scalable/delete.svg create mode 100644 launcher/resources/pe_light/scalable/export.svg create mode 100644 launcher/resources/pe_light/scalable/rename.svg create mode 100644 launcher/resources/pe_light/scalable/tag.svg diff --git a/launcher/resources/OSX/OSX.qrc b/launcher/resources/OSX/OSX.qrc index 3eca8e19..55be28b5 100644 --- a/launcher/resources/OSX/OSX.qrc +++ b/launcher/resources/OSX/OSX.qrc @@ -34,5 +34,9 @@ scalable/status-yellow.svg scalable/viewfolder.svg scalable/worlds.svg + scalable/delete.svg + scalable/tag.svg + scalable/export.svg + scalable/rename.svg diff --git a/launcher/resources/OSX/scalable/delete.svg b/launcher/resources/OSX/scalable/delete.svg new file mode 100644 index 00000000..bec8c7d9 --- /dev/null +++ b/launcher/resources/OSX/scalable/delete.svg @@ -0,0 +1,49 @@ + + + + + + + + + diff --git a/launcher/resources/OSX/scalable/export.svg b/launcher/resources/OSX/scalable/export.svg new file mode 100644 index 00000000..62145a7e --- /dev/null +++ b/launcher/resources/OSX/scalable/export.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/launcher/resources/OSX/scalable/rename.svg b/launcher/resources/OSX/scalable/rename.svg new file mode 100644 index 00000000..83ae5cb5 --- /dev/null +++ b/launcher/resources/OSX/scalable/rename.svg @@ -0,0 +1,27 @@ + + + + diff --git a/launcher/resources/OSX/scalable/tag.svg b/launcher/resources/OSX/scalable/tag.svg new file mode 100644 index 00000000..56438e3b --- /dev/null +++ b/launcher/resources/OSX/scalable/tag.svg @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/launcher/resources/flat/flat.qrc b/launcher/resources/flat/flat.qrc index d2b752b1..7f59da7b 100644 --- a/launcher/resources/flat/flat.qrc +++ b/launcher/resources/flat/flat.qrc @@ -42,5 +42,9 @@ scalable/status-yellow.svg scalable/viewfolder.svg scalable/worlds.svg + scalable/delete.svg + scalable/tag.svg + scalable/export.svg + scalable/rename.svg diff --git a/launcher/resources/flat/scalable/delete.svg b/launcher/resources/flat/scalable/delete.svg new file mode 100644 index 00000000..9f35cd07 --- /dev/null +++ b/launcher/resources/flat/scalable/delete.svg @@ -0,0 +1,17 @@ + + + + + diff --git a/launcher/resources/flat/scalable/export.svg b/launcher/resources/flat/scalable/export.svg new file mode 100644 index 00000000..d715ce94 --- /dev/null +++ b/launcher/resources/flat/scalable/export.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/launcher/resources/flat/scalable/rename.svg b/launcher/resources/flat/scalable/rename.svg new file mode 100644 index 00000000..1f793ca7 --- /dev/null +++ b/launcher/resources/flat/scalable/rename.svg @@ -0,0 +1,17 @@ + + + + diff --git a/launcher/resources/flat/scalable/tag.svg b/launcher/resources/flat/scalable/tag.svg new file mode 100644 index 00000000..7355fbf1 --- /dev/null +++ b/launcher/resources/flat/scalable/tag.svg @@ -0,0 +1,17 @@ + + + + diff --git a/launcher/resources/iOS/iOS.qrc b/launcher/resources/iOS/iOS.qrc index f05cd67c..1d752042 100644 --- a/launcher/resources/iOS/iOS.qrc +++ b/launcher/resources/iOS/iOS.qrc @@ -34,5 +34,9 @@ scalable/status-yellow.svg scalable/viewfolder.svg scalable/worlds.svg + scalable/delete.svg + scalable/tag.svg + scalable/export.svg + scalable/rename.svg diff --git a/launcher/resources/iOS/scalable/delete.svg b/launcher/resources/iOS/scalable/delete.svg new file mode 100644 index 00000000..a542fa4f --- /dev/null +++ b/launcher/resources/iOS/scalable/delete.svg @@ -0,0 +1,31 @@ + + + diff --git a/launcher/resources/iOS/scalable/export.svg b/launcher/resources/iOS/scalable/export.svg new file mode 100644 index 00000000..db2f4c3c --- /dev/null +++ b/launcher/resources/iOS/scalable/export.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + diff --git a/launcher/resources/iOS/scalable/rename.svg b/launcher/resources/iOS/scalable/rename.svg new file mode 100644 index 00000000..064e84b7 --- /dev/null +++ b/launcher/resources/iOS/scalable/rename.svg @@ -0,0 +1,16 @@ + + + diff --git a/launcher/resources/iOS/scalable/tag.svg b/launcher/resources/iOS/scalable/tag.svg new file mode 100644 index 00000000..23b549e5 --- /dev/null +++ b/launcher/resources/iOS/scalable/tag.svg @@ -0,0 +1,20 @@ + + + diff --git a/launcher/resources/pe_blue/pe_blue.qrc b/launcher/resources/pe_blue/pe_blue.qrc index 456963b7..3d385713 100644 --- a/launcher/resources/pe_blue/pe_blue.qrc +++ b/launcher/resources/pe_blue/pe_blue.qrc @@ -34,5 +34,9 @@ scalable/status-yellow.svg scalable/viewfolder.svg scalable/worlds.svg + scalable/delete.svg + scalable/tag.svg + scalable/export.svg + scalable/rename.svg diff --git a/launcher/resources/pe_blue/scalable/delete.svg b/launcher/resources/pe_blue/scalable/delete.svg new file mode 100644 index 00000000..123fade3 --- /dev/null +++ b/launcher/resources/pe_blue/scalable/delete.svg @@ -0,0 +1,35 @@ + + + + + diff --git a/launcher/resources/pe_blue/scalable/export.svg b/launcher/resources/pe_blue/scalable/export.svg new file mode 100644 index 00000000..560bf3e8 --- /dev/null +++ b/launcher/resources/pe_blue/scalable/export.svg @@ -0,0 +1,40 @@ + + + + + + + diff --git a/launcher/resources/pe_blue/scalable/rename.svg b/launcher/resources/pe_blue/scalable/rename.svg new file mode 100644 index 00000000..f9ca562e --- /dev/null +++ b/launcher/resources/pe_blue/scalable/rename.svg @@ -0,0 +1,19 @@ + + + diff --git a/launcher/resources/pe_blue/scalable/tag.svg b/launcher/resources/pe_blue/scalable/tag.svg new file mode 100644 index 00000000..02f6693a --- /dev/null +++ b/launcher/resources/pe_blue/scalable/tag.svg @@ -0,0 +1,39 @@ + + + + diff --git a/launcher/resources/pe_colored/pe_colored.qrc b/launcher/resources/pe_colored/pe_colored.qrc index 92a78b5c..fa6cd9cd 100644 --- a/launcher/resources/pe_colored/pe_colored.qrc +++ b/launcher/resources/pe_colored/pe_colored.qrc @@ -34,5 +34,9 @@ scalable/status-yellow.svg scalable/viewfolder.svg scalable/worlds.svg + scalable/delete.svg + scalable/tag.svg + scalable/export.svg + scalable/rename.svg diff --git a/launcher/resources/pe_colored/scalable/delete.svg b/launcher/resources/pe_colored/scalable/delete.svg new file mode 100644 index 00000000..59162da8 --- /dev/null +++ b/launcher/resources/pe_colored/scalable/delete.svg @@ -0,0 +1,49 @@ + + + + + diff --git a/launcher/resources/pe_colored/scalable/export.svg b/launcher/resources/pe_colored/scalable/export.svg new file mode 100644 index 00000000..267cc490 --- /dev/null +++ b/launcher/resources/pe_colored/scalable/export.svg @@ -0,0 +1,44 @@ + + + + + + + diff --git a/launcher/resources/pe_colored/scalable/rename.svg b/launcher/resources/pe_colored/scalable/rename.svg new file mode 100644 index 00000000..216cccb4 --- /dev/null +++ b/launcher/resources/pe_colored/scalable/rename.svg @@ -0,0 +1,22 @@ + + + diff --git a/launcher/resources/pe_colored/scalable/tag.svg b/launcher/resources/pe_colored/scalable/tag.svg new file mode 100644 index 00000000..69303fe5 --- /dev/null +++ b/launcher/resources/pe_colored/scalable/tag.svg @@ -0,0 +1,42 @@ + + + + diff --git a/launcher/resources/pe_dark/pe_dark.qrc b/launcher/resources/pe_dark/pe_dark.qrc index 929b310d..6b9c7cb6 100644 --- a/launcher/resources/pe_dark/pe_dark.qrc +++ b/launcher/resources/pe_dark/pe_dark.qrc @@ -34,5 +34,9 @@ scalable/status-yellow.svg scalable/viewfolder.svg scalable/worlds.svg + scalable/delete.svg + scalable/tag.svg + scalable/export.svg + scalable/rename.svg diff --git a/launcher/resources/pe_dark/scalable/delete.svg b/launcher/resources/pe_dark/scalable/delete.svg new file mode 100644 index 00000000..fc5c2a45 --- /dev/null +++ b/launcher/resources/pe_dark/scalable/delete.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/launcher/resources/pe_dark/scalable/export.svg b/launcher/resources/pe_dark/scalable/export.svg new file mode 100644 index 00000000..faec8fce --- /dev/null +++ b/launcher/resources/pe_dark/scalable/export.svg @@ -0,0 +1,36 @@ + + + + + + + diff --git a/launcher/resources/pe_dark/scalable/rename.svg b/launcher/resources/pe_dark/scalable/rename.svg new file mode 100644 index 00000000..740f8d2f --- /dev/null +++ b/launcher/resources/pe_dark/scalable/rename.svg @@ -0,0 +1,19 @@ + + + diff --git a/launcher/resources/pe_dark/scalable/tag.svg b/launcher/resources/pe_dark/scalable/tag.svg new file mode 100644 index 00000000..c092d02f --- /dev/null +++ b/launcher/resources/pe_dark/scalable/tag.svg @@ -0,0 +1,38 @@ + + + + diff --git a/launcher/resources/pe_light/pe_light.qrc b/launcher/resources/pe_light/pe_light.qrc index 25fde872..963bfcde 100644 --- a/launcher/resources/pe_light/pe_light.qrc +++ b/launcher/resources/pe_light/pe_light.qrc @@ -34,5 +34,9 @@ scalable/status-yellow.svg scalable/viewfolder.svg scalable/worlds.svg + scalable/delete.svg + scalable/tag.svg + scalable/export.svg + scalable/rename.svg diff --git a/launcher/resources/pe_light/scalable/delete.svg b/launcher/resources/pe_light/scalable/delete.svg new file mode 100644 index 00000000..21f90ea0 --- /dev/null +++ b/launcher/resources/pe_light/scalable/delete.svg @@ -0,0 +1,20 @@ + + + + + diff --git a/launcher/resources/pe_light/scalable/export.svg b/launcher/resources/pe_light/scalable/export.svg new file mode 100644 index 00000000..eee61936 --- /dev/null +++ b/launcher/resources/pe_light/scalable/export.svg @@ -0,0 +1,37 @@ + + + + + + + diff --git a/launcher/resources/pe_light/scalable/rename.svg b/launcher/resources/pe_light/scalable/rename.svg new file mode 100644 index 00000000..f11639a0 --- /dev/null +++ b/launcher/resources/pe_light/scalable/rename.svg @@ -0,0 +1,19 @@ + + + diff --git a/launcher/resources/pe_light/scalable/tag.svg b/launcher/resources/pe_light/scalable/tag.svg new file mode 100644 index 00000000..3f750a85 --- /dev/null +++ b/launcher/resources/pe_light/scalable/tag.svg @@ -0,0 +1,23 @@ + + + + diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 0fab0202..97152a48 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -643,6 +643,7 @@ public: actionRenameInstance->setObjectName(QStringLiteral("actionRenameInstance")); actionRenameInstance.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Rename")); actionRenameInstance.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Rename the selected instance.")); + actionRenameInstance->setIcon(APPLICATION->getThemedIcon("rename")); all_actions.append(&actionRenameInstance); // the rename label is inside the rename tool button @@ -675,6 +676,7 @@ public: actionKillInstance.setTextId(QT_TRANSLATE_NOOP("MainWindow", "&Kill")); actionKillInstance.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Kill the running instance")); actionKillInstance->setShortcut(QKeySequence(tr("Ctrl+K"))); + actionKillInstance->setIcon(APPLICATION->getThemedIcon("status-bad")); all_actions.append(&actionKillInstance); actionEditInstance = TranslatedAction(MainWindow); @@ -682,6 +684,7 @@ public: actionEditInstance.setTextId(QT_TRANSLATE_NOOP("MainWindow", "&Edit...")); actionEditInstance.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Change the instance settings, mods and versions.")); actionEditInstance->setShortcut(QKeySequence(tr("Ctrl+I"))); + actionEditInstance->setIcon(APPLICATION->getThemedIcon("settings-configure")); all_actions.append(&actionEditInstance); actionChangeInstGroup = TranslatedAction(MainWindow); @@ -689,12 +692,14 @@ public: actionChangeInstGroup.setTextId(QT_TRANSLATE_NOOP("MainWindow", "&Change Group...")); actionChangeInstGroup.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Change the selected instance's group.")); actionChangeInstGroup->setShortcut(QKeySequence(tr("Ctrl+G"))); + actionChangeInstGroup->setIcon(APPLICATION->getThemedIcon("tag")); all_actions.append(&actionChangeInstGroup); actionViewSelectedInstFolder = TranslatedAction(MainWindow); actionViewSelectedInstFolder->setObjectName(QStringLiteral("actionViewSelectedInstFolder")); actionViewSelectedInstFolder.setTextId(QT_TRANSLATE_NOOP("MainWindow", "&Folder")); actionViewSelectedInstFolder.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the selected instance's root folder in a file browser.")); + actionViewSelectedInstFolder->setIcon(APPLICATION->getThemedIcon("viewfolder")); all_actions.append(&actionViewSelectedInstFolder); actionExportInstance = TranslatedAction(MainWindow); @@ -702,6 +707,7 @@ public: actionExportInstance.setTextId(QT_TRANSLATE_NOOP("MainWindow", "E&xport...")); actionExportInstance.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Export the selected instance as a zip file.")); actionExportInstance->setShortcut(QKeySequence(tr("Ctrl+E"))); + actionExportInstance->setIcon(APPLICATION->getThemedIcon("export")); all_actions.append(&actionExportInstance); actionDeleteInstance = TranslatedAction(MainWindow); @@ -710,14 +716,15 @@ public: actionDeleteInstance.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Delete the selected instance.")); actionDeleteInstance->setShortcuts({QKeySequence(tr("Backspace")), QKeySequence::Delete}); actionDeleteInstance->setAutoRepeat(false); + actionDeleteInstance->setIcon(APPLICATION->getThemedIcon("delete")); all_actions.append(&actionDeleteInstance); actionCopyInstance = TranslatedAction(MainWindow); actionCopyInstance->setObjectName(QStringLiteral("actionCopyInstance")); - actionCopyInstance->setIcon(APPLICATION->getThemedIcon("copy")); actionCopyInstance.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Cop&y...")); actionCopyInstance.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Copy the selected instance.")); actionCopyInstance->setShortcut(QKeySequence(tr("Ctrl+D"))); + actionCopyInstance->setIcon(APPLICATION->getThemedIcon("copy")); all_actions.append(&actionCopyInstance); setInstanceActionsEnabled(false); -- cgit From c5a796ad8eda5c6d611b7badf223b6622bdec448 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:43:02 +0000 Subject: chore(deps): add renovate.json --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..39a2b6e9 --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base" + ] +} -- cgit From bdd5c180d324641c879153edd02064b0a1d08853 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:55:42 +0000 Subject: chore(deps): update actions/cache action to v3.0.11 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04c34754..b30388d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -126,7 +126,7 @@ jobs: - name: Retrieve ccache cache (Windows) if: runner.os == 'Windows' && inputs.build_type == 'Debug' - uses: actions/cache@v3.0.2 + uses: actions/cache@v3.0.11 with: path: '${{ github.workspace }}\.ccache' key: ${{ matrix.os }}-qt${{ matrix.qt_ver }} -- cgit From 09e4e100a2a2cd02167365573c447a09974f28b2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:55:49 +0000 Subject: chore(deps): update hendrikmuhs/ccache-action action to v1.2.3 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04c34754..8f48fa5c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,7 +104,7 @@ jobs: - name: Setup ccache if: runner.os != 'Windows' && inputs.build_type == 'Debug' - uses: hendrikmuhs/ccache-action@v1.2.1 + uses: hendrikmuhs/ccache-action@v1.2.3 with: key: ${{ matrix.os }}-qt${{ matrix.qt_ver }} -- cgit From 9758c9b2a25a215664c59adfc2a72eeb09d5afa1 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 21 Oct 2022 17:04:21 +0200 Subject: chore: add Netlify as sponsor Signed-off-by: Sefa Eyeoglu --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index acbe4aaa..d7df8e26 100644 --- a/README.md +++ b/README.md @@ -72,13 +72,16 @@ Thanks to JetBrains for providing us a few licenses for all their products, as p [![JetBrains](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/opensource/) -Also thanks to Weblate for hosting our translation efforts. +Thanks to Weblate for hosting our translation efforts. Translation status -Additionally, thanks to the awesome people over at [MacStadium](https://www.macstadium.com/), for providing M1-Macs for development purposes! +Thanks to Netlify for providing us their excellent web services, as part of their [Open Source program](https://www.netlify.com/open-source/) -Powered by MacStadium + Deploys by Netlify + +Thanks to the awesome people over at [MacStadium](https://www.macstadium.com/), for providing M1-Macs for development purposes! +Powered by MacStadium -- cgit From ff2f40f5e10bf742170df938c56a9d21854f370b Mon Sep 17 00:00:00 2001 From: circuit10 Date: Fri, 21 Oct 2022 16:28:04 +0100 Subject: Fix typo Signed-off-by: circuit10 --- launcher/ui/pages/global/LauncherPage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp index 1e5df5b2..b8431e8c 100644 --- a/launcher/ui/pages/global/LauncherPage.cpp +++ b/launcher/ui/pages/global/LauncherPage.cpp @@ -147,7 +147,7 @@ void LauncherPage::on_instDirBrowseBtn_clicked() { QMessageBox warning; warning.setText(tr("You're trying to specify an instance folder " - "which was granted temporaily via Flatpak.\n" + "which was granted temporarily via Flatpak.\n" "This is known to cause problems. " "After a restart the launcher might break, " "because it will no longer have access to that directory.\n\n" -- cgit From 919f8c54d74f81e7144d8a18a1ef068e3538f458 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 21 Oct 2022 17:42:18 +0200 Subject: fix: don't build renovate branches They will be built using the pull_requests event anyway. Signed-off-by: Sefa Eyeoglu --- .github/workflows/trigger_builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger_builds.yml b/.github/workflows/trigger_builds.yml index 55b4fdd4..8adaa5e5 100644 --- a/.github/workflows/trigger_builds.yml +++ b/.github/workflows/trigger_builds.yml @@ -3,7 +3,7 @@ name: Build Application on: push: branches-ignore: - - 'stable' + - 'renovate/**' paths-ignore: - '**.md' - '**/LICENSE' -- cgit From e4b5cd23e6c8bb68bd484cfdc3da887fd30c3934 Mon Sep 17 00:00:00 2001 From: leo78913 Date: Fri, 21 Oct 2022 13:49:31 -0300 Subject: the trashcan icons dont look like trash now Signed-off-by: leo78913 --- launcher/resources/pe_blue/scalable/delete.svg | 79 +++++++++++++------ launcher/resources/pe_colored/scalable/delete.svg | 93 ++++++++++++++--------- launcher/resources/pe_dark/scalable/delete.svg | 68 ++++++++++++++--- launcher/resources/pe_dark/scalable/tag.svg | 12 +-- launcher/resources/pe_light/scalable/delete.svg | 64 ++++++++++++++-- 5 files changed, 230 insertions(+), 86 deletions(-) diff --git a/launcher/resources/pe_blue/scalable/delete.svg b/launcher/resources/pe_blue/scalable/delete.svg index 123fade3..54a70374 100644 --- a/launcher/resources/pe_blue/scalable/delete.svg +++ b/launcher/resources/pe_blue/scalable/delete.svg @@ -11,25 +11,60 @@ xmlns:svg="http://www.w3.org/2000/svg"> - - + + diff --git a/launcher/resources/pe_colored/scalable/delete.svg b/launcher/resources/pe_colored/scalable/delete.svg index 59162da8..d9bbddc7 100644 --- a/launcher/resources/pe_colored/scalable/delete.svg +++ b/launcher/resources/pe_colored/scalable/delete.svg @@ -11,39 +11,60 @@ xmlns:svg="http://www.w3.org/2000/svg"> - - + + diff --git a/launcher/resources/pe_dark/scalable/delete.svg b/launcher/resources/pe_dark/scalable/delete.svg index fc5c2a45..76e52a4f 100644 --- a/launcher/resources/pe_dark/scalable/delete.svg +++ b/launcher/resources/pe_dark/scalable/delete.svg @@ -11,14 +11,60 @@ xmlns:svg="http://www.w3.org/2000/svg"> - - + + diff --git a/launcher/resources/pe_dark/scalable/tag.svg b/launcher/resources/pe_dark/scalable/tag.svg index c092d02f..63772af2 100644 --- a/launcher/resources/pe_dark/scalable/tag.svg +++ b/launcher/resources/pe_dark/scalable/tag.svg @@ -12,21 +12,13 @@ id="defs45" /> - - + + -- cgit From ccf7d1e0c433d72d7bcd805a8564e602d61ac880 Mon Sep 17 00:00:00 2001 From: leo78913 Date: Fri, 21 Oct 2022 13:59:22 -0300 Subject: material design icons Signed-off-by: leo78913 --- launcher/resources/flat/scalable/delete.svg | 18 +----------------- launcher/resources/flat/scalable/export.svg | 17 +---------------- launcher/resources/flat/scalable/rename.svg | 18 +----------------- launcher/resources/flat/scalable/tag.svg | 18 +----------------- 4 files changed, 4 insertions(+), 67 deletions(-) diff --git a/launcher/resources/flat/scalable/delete.svg b/launcher/resources/flat/scalable/delete.svg index 9f35cd07..89a0948b 100644 --- a/launcher/resources/flat/scalable/delete.svg +++ b/launcher/resources/flat/scalable/delete.svg @@ -1,17 +1 @@ - - - - - + diff --git a/launcher/resources/flat/scalable/export.svg b/launcher/resources/flat/scalable/export.svg index d715ce94..a3b711a2 100644 --- a/launcher/resources/flat/scalable/export.svg +++ b/launcher/resources/flat/scalable/export.svg @@ -1,16 +1 @@ - - - - - + diff --git a/launcher/resources/flat/scalable/rename.svg b/launcher/resources/flat/scalable/rename.svg index 1f793ca7..d0b56723 100644 --- a/launcher/resources/flat/scalable/rename.svg +++ b/launcher/resources/flat/scalable/rename.svg @@ -1,17 +1 @@ - - - - + diff --git a/launcher/resources/flat/scalable/tag.svg b/launcher/resources/flat/scalable/tag.svg index 7355fbf1..0629b185 100644 --- a/launcher/resources/flat/scalable/tag.svg +++ b/launcher/resources/flat/scalable/tag.svg @@ -1,17 +1 @@ - - - - + -- cgit From 9b17cde01929e58819c353868734f81faf811958 Mon Sep 17 00:00:00 2001 From: forkiesassds Date: Sat, 22 Oct 2022 01:19:51 +0300 Subject: CurseForge modpack page improvements Signed-off-by: forkiesassds --- launcher/ui/pages/modplatform/flame/FlameModel.cpp | 52 +++++++++++++--------- launcher/ui/pages/modplatform/flame/FlamePage.cpp | 10 +++++ launcher/ui/pages/modplatform/flame/FlamePage.ui | 9 +++- 3 files changed, 49 insertions(+), 22 deletions(-) diff --git a/launcher/ui/pages/modplatform/flame/FlameModel.cpp b/launcher/ui/pages/modplatform/flame/FlameModel.cpp index b9804681..9f8605eb 100644 --- a/launcher/ui/pages/modplatform/flame/FlameModel.cpp +++ b/launcher/ui/pages/modplatform/flame/FlameModel.cpp @@ -1,6 +1,7 @@ #include "FlameModel.h" #include #include "Application.h" +#include "ui/widgets/ProjectItem.h" #include #include @@ -31,29 +32,38 @@ QVariant ListModel::data(const QModelIndex& index, int role) const } IndexedPack pack = modpacks.at(pos); - if (role == Qt::DisplayRole) { - return pack.name; - } else if (role == Qt::ToolTipRole) { - if (pack.description.length() > 100) { - // some magic to prevent to long tooltips and replace html linebreaks - QString edit = pack.description.left(97); - edit = edit.left(edit.lastIndexOf("
    ")).left(edit.lastIndexOf(" ")).append("..."); - return edit; + switch (role) { + case Qt::ToolTipRole: { + if (pack.description.length() > 100) { + // some magic to prevent to long tooltips and replace html linebreaks + QString edit = pack.description.left(97); + edit = edit.left(edit.lastIndexOf("
    ")).left(edit.lastIndexOf(" ")).append("..."); + return edit; + } + return pack.description; + } case Qt::DecorationRole: { + if (m_logoMap.contains(pack.logoName)) { + return (m_logoMap.value(pack.logoName)); + } + QIcon icon = APPLICATION->getThemedIcon("screenshot-placeholder"); + ((ListModel*)this)->requestLogo(pack.logoName, pack.logoUrl); + return icon; + } case Qt::UserRole: { + QVariant v; + v.setValue(pack); + return v; } - return pack.description; - } else if (role == Qt::DecorationRole) { - if (m_logoMap.contains(pack.logoName)) { - return (m_logoMap.value(pack.logoName)); - } - QIcon icon = APPLICATION->getThemedIcon("screenshot-placeholder"); - ((ListModel*)this)->requestLogo(pack.logoName, pack.logoUrl); - return icon; - } else if (role == Qt::UserRole) { - QVariant v; - v.setValue(pack); - return v; + case Qt::SizeHintRole: + return QSize(0, 58); + case UserDataTypes::TITLE: + return pack.name; + case UserDataTypes::DESCRIPTION: + return pack.description; + case UserDataTypes::SELECTED: + return false; + default: + break; } - return QVariant(); } diff --git a/launcher/ui/pages/modplatform/flame/FlamePage.cpp b/launcher/ui/pages/modplatform/flame/FlamePage.cpp index 7d2ba2e2..a65b6585 100644 --- a/launcher/ui/pages/modplatform/flame/FlamePage.cpp +++ b/launcher/ui/pages/modplatform/flame/FlamePage.cpp @@ -43,6 +43,10 @@ #include "InstanceImportTask.h" #include "Json.h" #include "ui/dialogs/NewInstanceDialog.h" +#include "ui/widgets/ProjectItem.h" +#include "modplatform/flame/FlameAPI.h" + +static FlameAPI api; FlamePage::FlamePage(NewInstanceDialog* dialog, QWidget* parent) : QWidget(parent), ui(new Ui::FlamePage), dialog(dialog) { @@ -66,6 +70,9 @@ FlamePage::FlamePage(NewInstanceDialog* dialog, QWidget* parent) : QWidget(paren connect(ui->sortByBox, SIGNAL(currentIndexChanged(int)), this, SLOT(triggerSearch())); connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &FlamePage::onSelectionChanged); connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &FlamePage::onVersionSelectionChanged); + + ui->packView->setItemDelegate(new ProjectItemDelegate(this)); + ui->packDescription->setMetaEntry("FlamePacks"); } FlamePage::~FlamePage() @@ -250,7 +257,10 @@ void FlamePage::updateUi() text += "- " + tr("Source code: %1").arg(current.extra.sourceUrl) + "
    "; } + text += "
    "; + text += api.getModDescription(current.addonId).toUtf8(); ui->packDescription->setHtml(text + current.description); + ui->packDescription->flush(); } diff --git a/launcher/ui/pages/modplatform/flame/FlamePage.ui b/launcher/ui/pages/modplatform/flame/FlamePage.ui index 1a3d0225..71d19513 100644 --- a/launcher/ui/pages/modplatform/flame/FlamePage.ui +++ b/launcher/ui/pages/modplatform/flame/FlamePage.ui @@ -66,7 +66,7 @@ - + true @@ -99,6 +99,13 @@ + + + ProjectDescriptionPage + QTextBrowser +
    ui/widgets/ProjectDescriptionPage.h
    +
    +
    packView packDescription -- cgit From ba4af1a890f3d2990d86a36a2fbbb16ad2c774cf Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 21 Oct 2022 19:54:10 -0400 Subject: fix: make jars path specific to prism Signed-off-by: seth --- CMakeLists.txt | 2 +- launcher/Application.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 131d3e53..97bad31b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,7 +249,7 @@ if(UNIX AND APPLE) elseif(UNIX) set(BINARY_DEST_DIR "bin") set(LIBRARY_DEST_DIR "lib${LIB_SUFFIX}") - set(JARS_DEST_DIR "share/jars") + set(JARS_DEST_DIR "share/${Launcher_APP_BINARY_NAME}") set(LAUNCHER_DESKTOP_DEST_DIR "share/applications" CACHE STRING "Path to the desktop file directory") set(LAUNCHER_METAINFO_DEST_DIR "share/metainfo" CACHE STRING "Path to the metainfo directory") set(LAUNCHER_ICON_DEST_DIR "share/icons/hicolor/scalable/apps" CACHE STRING "Path to the scalable icon directory") diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 6ffec1ae..babf824a 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -1571,7 +1571,7 @@ QString Application::getJarPath(QString jarFile) { QStringList potentialPaths = { #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) - FS::PathCombine(m_rootPath, "share/jars"), + FS::PathCombine(m_rootPath, "share/" + BuildConfig.LAUNCHER_NAME), #endif FS::PathCombine(m_rootPath, "jars"), FS::PathCombine(applicationDirPath(), "jars") -- cgit From 4a2b25e841224441c0dcaa81bcbd0f716d64201e Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 21 Oct 2022 21:29:28 -0400 Subject: fix: use correct variable for jars path Signed-off-by: seth --- buildconfig/BuildConfig.cpp.in | 1 + buildconfig/BuildConfig.h | 1 + launcher/Application.cpp | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 50e5e8a4..fc68326c 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -42,6 +42,7 @@ Config::Config() { // Name and copyright LAUNCHER_NAME = "@Launcher_Name@"; + LAUNCHER_APP_BINARY_NAME = "@Launcher_APP_BINARY_NAME@"' LAUNCHER_DISPLAYNAME = "@Launcher_DisplayName@"; LAUNCHER_COPYRIGHT = "@Launcher_Copyright@"; LAUNCHER_DOMAIN = "@Launcher_Domain@"; diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index ef384ed2..13ccdaa1 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -44,6 +44,7 @@ class Config { public: Config(); QString LAUNCHER_NAME; + QString LAUNCHER_APP_BINARY_NAME; QString LAUNCHER_DISPLAYNAME; QString LAUNCHER_COPYRIGHT; QString LAUNCHER_DOMAIN; diff --git a/launcher/Application.cpp b/launcher/Application.cpp index babf824a..97f757f7 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -1571,7 +1571,7 @@ QString Application::getJarPath(QString jarFile) { QStringList potentialPaths = { #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) - FS::PathCombine(m_rootPath, "share/" + BuildConfig.LAUNCHER_NAME), + FS::PathCombine(m_rootPath, "share/" + BuildConfig.LAUNCHER_APP_BINARY_NAME), #endif FS::PathCombine(m_rootPath, "jars"), FS::PathCombine(applicationDirPath(), "jars") -- cgit From 2592c690213506c3cdfbc441c20f13ef7cf3eb23 Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 21 Oct 2022 21:37:31 -0400 Subject: semicolon fail i was off by one key :( Signed-off-by: seth --- buildconfig/BuildConfig.cpp.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index fc68326c..b8fa5133 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -42,7 +42,7 @@ Config::Config() { // Name and copyright LAUNCHER_NAME = "@Launcher_Name@"; - LAUNCHER_APP_BINARY_NAME = "@Launcher_APP_BINARY_NAME@"' + LAUNCHER_APP_BINARY_NAME = "@Launcher_APP_BINARY_NAME@"; LAUNCHER_DISPLAYNAME = "@Launcher_DisplayName@"; LAUNCHER_COPYRIGHT = "@Launcher_Copyright@"; LAUNCHER_DOMAIN = "@Launcher_Domain@"; -- cgit From a6b13487f0e27c8bea1917720a0c5c1eb1eb206c Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Thu, 20 Oct 2022 18:30:32 +0100 Subject: ATLauncher: Abort install if optional mods dialog is closed This matches the behaviour of ATLauncher. --- launcher/modplatform/atlauncher/ATLPackInstallTask.cpp | 7 ++++++- launcher/modplatform/atlauncher/ATLPackInstallTask.h | 2 +- .../pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp | 7 +++++-- .../pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.h | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp index a553eafd..68d75943 100644 --- a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp +++ b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp @@ -736,7 +736,12 @@ void PackInstallTask::downloadMods() QVector selectedMods; if (!optionalMods.isEmpty()) { setStatus(tr("Selecting optional mods...")); - selectedMods = m_support->chooseOptionalMods(m_version, optionalMods); + auto mods = m_support->chooseOptionalMods(m_version, optionalMods); + if (!mods.has_value()) { + emitAborted(); + return; + } + selectedMods = mods.value(); } setStatus(tr("Downloading mods...")); diff --git a/launcher/modplatform/atlauncher/ATLPackInstallTask.h b/launcher/modplatform/atlauncher/ATLPackInstallTask.h index ed4436f0..78cd87fb 100644 --- a/launcher/modplatform/atlauncher/ATLPackInstallTask.h +++ b/launcher/modplatform/atlauncher/ATLPackInstallTask.h @@ -62,7 +62,7 @@ public: /** * Requests a user interaction to select which optional mods should be installed. */ - virtual QVector chooseOptionalMods(PackVersion version, QVector mods) = 0; + virtual std::optional> chooseOptionalMods(PackVersion version, QVector mods) = 0; /** * Requests a user interaction to select a component version from a given version list diff --git a/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp b/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp index 03196685..c68e40ba 100644 --- a/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp +++ b/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp @@ -43,10 +43,13 @@ AtlUserInteractionSupportImpl::AtlUserInteractionSupportImpl(QWidget *parent) : { } -QVector AtlUserInteractionSupportImpl::chooseOptionalMods(ATLauncher::PackVersion version, QVector mods) +std::optional> AtlUserInteractionSupportImpl::chooseOptionalMods(ATLauncher::PackVersion version, QVector mods) { AtlOptionalModDialog optionalModDialog(m_parent, version, mods); - optionalModDialog.exec(); + auto result = optionalModDialog.exec(); + if (result == QDialog::Rejected) { + return {}; + } return optionalModDialog.getResult(); } diff --git a/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.h b/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.h index aa22fc73..3b37c9be 100644 --- a/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.h +++ b/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.h @@ -47,7 +47,7 @@ public: private: QString chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion) override; - QVector chooseOptionalMods(ATLauncher::PackVersion version, QVector mods) override; + std::optional> chooseOptionalMods(ATLauncher::PackVersion version, QVector mods) override; void displayMessage(QString message) override; private: -- cgit -- cgit From 970e4b020ea14a1fbd5abe65517a3e26399280cb Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sat, 22 Oct 2022 14:11:51 +0200 Subject: fix: fix segfault when resolving Flame resources Signed-off-by: Sefa Eyeoglu --- launcher/modplatform/flame/FileResolvingTask.cpp | 14 ++++++-------- launcher/modplatform/flame/FileResolvingTask.h | 3 ++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/launcher/modplatform/flame/FileResolvingTask.cpp b/launcher/modplatform/flame/FileResolvingTask.cpp index 0b2431f7..c50abb8f 100644 --- a/launcher/modplatform/flame/FileResolvingTask.cpp +++ b/launcher/modplatform/flame/FileResolvingTask.cpp @@ -12,6 +12,8 @@ bool Flame::FileResolvingTask::abort() bool aborted = true; if (m_dljob) aborted &= m_dljob->abort(); + if (m_checkJob) + aborted &= m_checkJob->abort(); return aborted ? Task::abort() : false; } @@ -40,7 +42,7 @@ void Flame::FileResolvingTask::netJobFinished() setProgress(1, 3); int index = 0; // job to check modrinth for blocked projects - auto job = new NetJob("Modrinth check", m_network); + m_checkJob = new NetJob("Modrinth check", m_network); blockedProjects = QMap(); auto doc = Json::requireDocument(*result); auto array = Json::requireArray(doc.object()["data"]); @@ -60,19 +62,15 @@ void Flame::FileResolvingTask::netJobFinished() out.resolved = true; }); - job->addNetAction(dl); + m_checkJob->addNetAction(dl); blockedProjects.insert(&out, output); } } index++; } - connect(job, &NetJob::finished, this, - [this, &job] { - modrinthCheckFinished(); - job->deleteLater(); - }); + connect(m_checkJob.get(), &NetJob::finished, this, &Flame::FileResolvingTask::modrinthCheckFinished); - job->start(); + m_checkJob->start(); } void Flame::FileResolvingTask::modrinthCheckFinished() { diff --git a/launcher/modplatform/flame/FileResolvingTask.h b/launcher/modplatform/flame/FileResolvingTask.h index f71b87ce..8fc17ea9 100644 --- a/launcher/modplatform/flame/FileResolvingTask.h +++ b/launcher/modplatform/flame/FileResolvingTask.h @@ -30,8 +30,9 @@ protected slots: private: /* data */ shared_qobject_ptr m_network; Flame::Manifest m_toProcess; - std::shared_ptr result; + std::shared_ptr result; NetJob::Ptr m_dljob; + NetJob::Ptr m_checkJob; void modrinthCheckFinished(); -- cgit From 8b3093e7580c01e43d80803b8b931445f9438bc8 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sat, 22 Oct 2022 14:57:03 +0200 Subject: chore: add PR template Signed-off-by: Sefa Eyeoglu --- .github/pull_request_template.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..41f0604e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,9 @@ + -- cgit