diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 247675fca..6d05e3da5 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1 @@ -open_collective: polymc +open_collective: prismlauncher diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index ab3c8a29f..ea1fbfdd9 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 [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/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 Prism Launcher + description: The version of Prism Launcher used in the bug report. + placeholder: Prism Launcher 5.0 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 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 932d0c8f9..97a55db33 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 + - name: Prism Launcher Matrix Support Room + url: https://matrix.to/#/#prism-support:matrix.org about: Please ask for support here before opening an issue. diff --git a/.github/ISSUE_TEMPLATE/rfc.yml b/.github/ISSUE_TEMPLATE/rfc.yml index 0a40d01da..fa7cdbe61 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 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 PolyMC, 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 48f157b3f..ddee86b65 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 Prism Launcher. - type: input attributes: label: Role - description: In what way do you use PolyMC 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 PolyMC 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 PolyMC 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 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..41f0604e4 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,9 @@ + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04c34754c..b6400791d 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 }} @@ -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 }} diff --git a/.github/workflows/trigger_builds.yml b/.github/workflows/trigger_builds.yml index 55b4fdd4f..8adaa5e52 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' diff --git a/.github/workflows/trigger_release.yml b/.github/workflows/trigger_release.yml index 476280df8..e74e870aa 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: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e149ce10..97bad31b4 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") @@ -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") @@ -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/README.md b/README.md index dbcf809ca..d7df8e264 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,87 @@ -# 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/hX4g537UNE). Logo and branding also coming soon. +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. -- Last build status: +- 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 -- Join the [Discord Server](https://discord.gg/hX4g537UNE) for now. +Feel free to create an issue if you need help. However, you might find it easier to ask in the Discord server. + +[![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/) + +Thanks to Weblate for hosting our translation efforts. + + +Translation status + + +Thanks to Netlify for providing us their excellent web services, as part of their [Open Source program](https://www.netlify.com/open-source/) + + 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 diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 50e5e8a4b..b8fa51339 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 ef384ed20..13ccdaa18 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 e94e96a9d..97f757f7c 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", "multimc.cfg" }, this)); // Updates // Multiple channels are separated by spaces m_settings->registerSetting("UpdateChannel", BuildConfig.VERSION_CHANNEL); @@ -815,6 +816,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()); @@ -1569,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_APP_BINARY_NAME), #endif FS::PathCombine(m_rootPath, "jars"), FS::PathCombine(applicationDirPath(), "jars") diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 6ad91a85d..79ac49c76 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -854,6 +854,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/java/JavaUtils.cpp b/launcher/java/JavaUtils.cpp index 6096e8122..040fe8210 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 950aec9d7..26dbf962d 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 e1b62f6a4..11c5a3af3 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 8136a92ed..a8c3529ac 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 7777f8465..0dcaeb531 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 ce477ad7b..1d8d70833 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 78a333594..a3383ec08 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/modplatform/atlauncher/ATLPackInstallTask.cpp b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp index a553eafd1..68d759436 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 ed4436f07..78cd87fb1 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/modplatform/flame/FileResolvingTask.cpp b/launcher/modplatform/flame/FileResolvingTask.cpp index 058d24712..c50abb8f2 100644 --- a/launcher/modplatform/flame/FileResolvingTask.cpp +++ b/launcher/modplatform/flame/FileResolvingTask.cpp @@ -9,9 +9,12 @@ Flame::FileResolvingTask::FileResolvingTask(const shared_qobject_ptrabort(); - return true; + aborted &= m_dljob->abort(); + if (m_checkJob) + aborted &= m_checkJob->abort(); + return aborted ? Task::abort() : false; } void Flame::FileResolvingTask::executeTask() @@ -39,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"]); @@ -59,15 +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, &Flame::FileResolvingTask::modrinthCheckFinished); + 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 f71b87ceb..8fc17ea91 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(); diff --git a/launcher/modplatform/legacy_ftb/PackInstallTask.cpp b/launcher/modplatform/legacy_ftb/PackInstallTask.cpp index 209ad884a..06b3788b7 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); + + archivePath = QString("%1/%2/%3").arg(m_pack.dir, m_version.replace(".", "_"), m_pack.file); - 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); - - entry->setStale(true); 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(); } } diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp index 97ce1dc6c..7b112d8f9 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,15 +68,13 @@ 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() { setStatus(tr("Getting the manifest...")); + setAbortable(false); // Find pack version auto version_it = std::find_if(m_pack.versions.constBegin(), m_pack.versions.constEnd(), @@ -93,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,6 +133,7 @@ void PackInstallTask::onManifestDownloadSucceeded() void PackInstallTask::resolveMods() { setStatus(tr("Resolving mods...")); + setAbortable(false); setProgress(0, 100); m_file_id_map.clear(); @@ -162,15 +166,16 @@ 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(); } void PackInstallTask::onResolveModsSucceeded() { - m_abortable = false; - QString text; QList urls; auto anyBlocked = false; @@ -209,94 +214,23 @@ void PackInstallTask::onResolveModsSucceeded() urls); if (message_dialog->exec() == QDialog::Accepted) - downloadPack(); + createInstance(); else abort(); } else { - downloadPack(); + createInstance(); } } -void PackInstallTask::downloadPack() +void PackInstallTask::createInstance() { - setStatus(tr("Downloading mods...")); + setAbortable(false); - 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); - } - - 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() -{ - 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(); - } - - 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 +271,55 @@ 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() +{ + setStatus(tr("Downloading mods...")); + setAbortable(false); + + 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::aborted, this, &PackInstallTask::abort); + connect(jobPtr, &NetJob::progress, this, &PackInstallTask::setProgress); + + m_net_job = jobPtr; + + setAbortable(true); + jobPtr->start(); +} + +void PackInstallTask::onModDownloadSucceeded() +{ + m_net_job.reset(); emitSucceeded(); } @@ -352,6 +333,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 e63ca0dff..7c6fbeb93 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; diff --git a/launcher/resources/OSX/OSX.qrc b/launcher/resources/OSX/OSX.qrc index 3eca8e195..55be28b5f 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 000000000..bec8c7d97 --- /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 000000000..62145a7e6 --- /dev/null +++ b/launcher/resources/OSX/scalable/export.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/launcher/resources/OSX/scalable/launcher.svg b/launcher/resources/OSX/scalable/launcher.svg index c192d5031..69dd84b17 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/OSX/scalable/rename.svg b/launcher/resources/OSX/scalable/rename.svg new file mode 100644 index 000000000..83ae5cb55 --- /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 000000000..56438e3b5 --- /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 d2b752b1a..7f59da7b8 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 000000000..89a0948b1 --- /dev/null +++ b/launcher/resources/flat/scalable/delete.svg @@ -0,0 +1 @@ + diff --git a/launcher/resources/flat/scalable/export.svg b/launcher/resources/flat/scalable/export.svg new file mode 100644 index 000000000..a3b711a29 --- /dev/null +++ b/launcher/resources/flat/scalable/export.svg @@ -0,0 +1 @@ + diff --git a/launcher/resources/flat/scalable/launcher.svg b/launcher/resources/flat/scalable/launcher.svg index c192d5031..69dd84b17 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/flat/scalable/rename.svg b/launcher/resources/flat/scalable/rename.svg new file mode 100644 index 000000000..d0b56723c --- /dev/null +++ b/launcher/resources/flat/scalable/rename.svg @@ -0,0 +1 @@ + diff --git a/launcher/resources/flat/scalable/tag.svg b/launcher/resources/flat/scalable/tag.svg new file mode 100644 index 000000000..0629b185f --- /dev/null +++ b/launcher/resources/flat/scalable/tag.svg @@ -0,0 +1 @@ + diff --git a/launcher/resources/iOS/iOS.qrc b/launcher/resources/iOS/iOS.qrc index f05cd67c2..1d7520420 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 000000000..a542fa4ff --- /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 000000000..db2f4c3cb --- /dev/null +++ b/launcher/resources/iOS/scalable/export.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + diff --git a/launcher/resources/iOS/scalable/launcher.svg b/launcher/resources/iOS/scalable/launcher.svg index c192d5031..69dd84b17 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/iOS/scalable/rename.svg b/launcher/resources/iOS/scalable/rename.svg new file mode 100644 index 000000000..064e84b74 --- /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 000000000..23b549e53 --- /dev/null +++ b/launcher/resources/iOS/scalable/tag.svg @@ -0,0 +1,20 @@ + + + diff --git a/launcher/resources/multimc/multimc.qrc b/launcher/resources/multimc/multimc.qrc index 2337acd60..3f3d22fc1 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 c192d5031..000000000 --- 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 000000000..93493aab9 --- /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 c192d5031..69dd84b17 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/pe_blue.qrc b/launcher/resources/pe_blue/pe_blue.qrc index 456963b7b..3d3857133 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 000000000..54a70374b --- /dev/null +++ b/launcher/resources/pe_blue/scalable/delete.svg @@ -0,0 +1,70 @@ + + + + + diff --git a/launcher/resources/pe_blue/scalable/export.svg b/launcher/resources/pe_blue/scalable/export.svg new file mode 100644 index 000000000..560bf3e85 --- /dev/null +++ b/launcher/resources/pe_blue/scalable/export.svg @@ -0,0 +1,40 @@ + + + + + + + diff --git a/launcher/resources/pe_blue/scalable/launcher.svg b/launcher/resources/pe_blue/scalable/launcher.svg index c192d5031..69dd84b17 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_blue/scalable/rename.svg b/launcher/resources/pe_blue/scalable/rename.svg new file mode 100644 index 000000000..f9ca562e2 --- /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 000000000..02f6693a3 --- /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 92a78b5cf..fa6cd9cd4 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 000000000..d9bbddc76 --- /dev/null +++ b/launcher/resources/pe_colored/scalable/delete.svg @@ -0,0 +1,70 @@ + + + + + diff --git a/launcher/resources/pe_colored/scalable/export.svg b/launcher/resources/pe_colored/scalable/export.svg new file mode 100644 index 000000000..267cc4904 --- /dev/null +++ b/launcher/resources/pe_colored/scalable/export.svg @@ -0,0 +1,44 @@ + + + + + + + diff --git a/launcher/resources/pe_colored/scalable/launcher.svg b/launcher/resources/pe_colored/scalable/launcher.svg index c192d5031..69dd84b17 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_colored/scalable/rename.svg b/launcher/resources/pe_colored/scalable/rename.svg new file mode 100644 index 000000000..216cccb49 --- /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 000000000..69303fe54 --- /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 929b310de..6b9c7cb60 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 000000000..76e52a4f1 --- /dev/null +++ b/launcher/resources/pe_dark/scalable/delete.svg @@ -0,0 +1,70 @@ + + + + + diff --git a/launcher/resources/pe_dark/scalable/export.svg b/launcher/resources/pe_dark/scalable/export.svg new file mode 100644 index 000000000..faec8fce1 --- /dev/null +++ b/launcher/resources/pe_dark/scalable/export.svg @@ -0,0 +1,36 @@ + + + + + + + diff --git a/launcher/resources/pe_dark/scalable/launcher.svg b/launcher/resources/pe_dark/scalable/launcher.svg index c192d5031..69dd84b17 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_dark/scalable/rename.svg b/launcher/resources/pe_dark/scalable/rename.svg new file mode 100644 index 000000000..740f8d2fb --- /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 000000000..63772af20 --- /dev/null +++ b/launcher/resources/pe_dark/scalable/tag.svg @@ -0,0 +1,30 @@ + + + + diff --git a/launcher/resources/pe_light/pe_light.qrc b/launcher/resources/pe_light/pe_light.qrc index 25fde8728..963bfcdeb 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 000000000..0e41add97 --- /dev/null +++ b/launcher/resources/pe_light/scalable/delete.svg @@ -0,0 +1,70 @@ + + + + + diff --git a/launcher/resources/pe_light/scalable/export.svg b/launcher/resources/pe_light/scalable/export.svg new file mode 100644 index 000000000..eee61936e --- /dev/null +++ b/launcher/resources/pe_light/scalable/export.svg @@ -0,0 +1,37 @@ + + + + + + + diff --git a/launcher/resources/pe_light/scalable/launcher.svg b/launcher/resources/pe_light/scalable/launcher.svg index a9dfe87a3..69dd84b17 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/resources/pe_light/scalable/rename.svg b/launcher/resources/pe_light/scalable/rename.svg new file mode 100644 index 000000000..f11639a05 --- /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 000000000..3f750a855 --- /dev/null +++ b/launcher/resources/pe_light/scalable/tag.svg @@ -0,0 +1,23 @@ + + + + diff --git a/launcher/settings/INISettingsObject.cpp b/launcher/settings/INISettingsObject.cpp index 125134034..da962ee97 100644 --- a/launcher/settings/INISettingsObject.cpp +++ b/launcher/settings/INISettingsObject.cpp @@ -16,7 +16,30 @@ #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(); + 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; + break; + } + } + + 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 26cc32e51..d2f448a9c 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. diff --git a/launcher/settings/Setting.h b/launcher/settings/Setting.h index 9a5b82109..86007c13d 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 603eaa97e..97152a485 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); @@ -1860,7 +1867,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 47f204b3c..cecda1df5 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,15 +79,15 @@ 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")); - 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? - //: %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"); @@ -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"; @@ -164,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/launcher/ui/dialogs/NewInstanceDialog.cpp b/launcher/ui/dialogs/NewInstanceDialog.cpp index d203795ae..df182f096 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/dialogs/NewsDialog.cpp b/launcher/ui/dialogs/NewsDialog.cpp index d3b216272..e1b5dd740 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 2aaa08f1a..08f35a0b2 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
+
+
diff --git a/launcher/ui/dialogs/ProgressDialog.cpp b/launcher/ui/dialogs/ProgressDialog.cpp index 258a32e48..05269f623 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(); @@ -135,11 +136,13 @@ void ProgressDialog::onTaskStarted() {} void ProgressDialog::onTaskFailed(QString failure) { reject(); + hide(); } void ProgressDialog::onTaskSucceeded() { accept(); + hide(); } void ProgressDialog::changeStatus(const QString& status) diff --git a/launcher/ui/dialogs/UpdateDialog.cpp b/launcher/ui/dialogs/UpdateDialog.cpp index e0c5a4950..9e82531ac 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/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp index 1e5df5b2b..b8431e8c4 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" diff --git a/launcher/ui/pages/instance/ExternalResourcesPage.cpp b/launcher/ui/pages/instance/ExternalResourcesPage.cpp index f31e83252..b6c873cc2 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 28a874c26..f0106066a 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 diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp index 2af9a10a5..f2c1746fc 100644 --- a/launcher/ui/pages/modplatform/ModPage.cpp +++ b/launcher/ui/pages/modplatform/ModPage.cpp @@ -352,4 +352,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/ModPage.ui b/launcher/ui/pages/modplatform/ModPage.ui index afcd9bb7f..943f02aa2 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/atlauncher/AtlUserInteractionSupportImpl.cpp b/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp index 031966850..c68e40bad 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 aa22fc730..3b37c9bed 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: diff --git a/launcher/ui/pages/modplatform/flame/FlameModPage.cpp b/launcher/ui/pages/modplatform/flame/FlameModPage.cpp index 54a7be045..fd6e32ff7 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/flame/FlameModel.cpp b/launcher/ui/pages/modplatform/flame/FlameModel.cpp index b98046813..9f8605eb3 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 7d2ba2e2f..a65b65858 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 1a3d02255..71d195135 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 diff --git a/launcher/ui/pages/modplatform/ftb/FtbListModel.cpp b/launcher/ui/pages/modplatform/ftb/FtbListModel.cpp index ad15b6e62..3a1499448 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 314cb7891..d7a120f06 100644 --- a/launcher/ui/pages/modplatform/ftb/FtbListModel.h +++ b/launcher/ui/pages/modplatform/ftb/FtbListModel.h @@ -47,9 +47,13 @@ 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(); } + [[nodiscard]] bool wasAborted() const { return m_aborted; } + private slots: void requestFinished(); void requestFailed(QString reason); @@ -65,6 +69,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 8975d74ef..b08f3bc4e 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() @@ -105,7 +107,7 @@ void FtbPage::retranslate() void FtbPage::openedImpl() { - if(!initialised) + if(!initialised || listModel->wasAborted()) { listModel->request(); initialised = true; @@ -114,6 +116,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 90c8e7fd4..631ae7f56 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; diff --git a/launcher/ui/pages/modplatform/ftb/FtbPage.ui b/launcher/ui/pages/modplatform/ftb/FtbPage.ui index 850bf091c..8de0f4e65 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 diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModPage.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthModPage.cpp index 5fa00b9b4..62e417c8a 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 diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp index 43fda9de3..e6704eef2 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)); diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp index cea6cdee0..4482774c7 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() @@ -283,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/pages/modplatform/modrinth/ModrinthPage.ui b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.ui index 6a34701d9..6d8b2b675 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 diff --git a/launcher/ui/widgets/ProjectDescriptionPage.cpp b/launcher/ui/widgets/ProjectDescriptionPage.cpp new file mode 100644 index 000000000..c7e79a170 --- /dev/null +++ b/launcher/ui/widgets/ProjectDescriptionPage.cpp @@ -0,0 +1,23 @@ +#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); +} + +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 new file mode 100644 index 000000000..3dd853022 --- /dev/null +++ b/launcher/ui/widgets/ProjectDescriptionPage.h @@ -0,0 +1,32 @@ +#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); + + 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/ProjectItem.cpp b/launcher/ui/widgets/ProjectItem.cpp index 01be88d9e..d1ff9dbc0 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(); } @@ -82,17 +86,38 @@ 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) - description += opt.fontMetrics.elidedText(cut_text.at(1).second, opt.textElideMode, cut_text.at(1).first); - else - description += cut_text.at(1).second; + // 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 { + 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; + } } + 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 (num_lines == 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.2 * opt.fontMetrics.height(), remaining_width, - 2 * 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(); diff --git a/launcher/ui/widgets/VariableSizedImageObject.cpp b/launcher/ui/widgets/VariableSizedImageObject.cpp new file mode 100644 index 000000000..e57f7e95a --- /dev/null +++ b/launcher/ui/widgets/VariableSizedImageObject.cpp @@ -0,0 +1,127 @@ +// 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::flush() +{ + m_fetching_images.clear(); +} + +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.insert(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; + + // 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); + + 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.remove(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 000000000..137487eee --- /dev/null +++ b/launcher/ui/widgets/VariableSizedImageObject.h @@ -0,0 +1,64 @@ +// 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 final : 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; } + + 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); + + /** 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); + + private: + QString m_meta_entry; + + QSet m_fetching_images; +}; diff --git a/launcher/updater/DownloadTask.h b/launcher/updater/DownloadTask.h index f47a30483..19a6265cf 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 91f30b5d0..4bc7dfa99 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 9a26dd693..dc38477b0 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 621446e17..fe6dd4aca 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 c4dfa5b70..df25414f7 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/prismlauncher/EntryPoint.java similarity index 97% rename from libraries/launcher/org/polymc/EntryPoint.java rename to libraries/launcher/org/prismlauncher/EntryPoint.java index 20f418ebc..9144e1f1b 100644 --- a/libraries/launcher/org/polymc/EntryPoint.java +++ b/libraries/launcher/org/prismlauncher/EntryPoint.java @@ -50,10 +50,10 @@ * limitations under the License. */ -package org.polymc; +package org.prismlauncher; -import org.polymc.exception.ParseException; -import org.polymc.utils.Parameters; +import org.prismlauncher.exception.ParseException; +import org.prismlauncher.utils.Parameters; import java.io.BufferedReader; import java.io.IOException; diff --git a/libraries/launcher/org/polymc/Launcher.java b/libraries/launcher/org/prismlauncher/Launcher.java similarity index 96% rename from libraries/launcher/org/polymc/Launcher.java rename to libraries/launcher/org/prismlauncher/Launcher.java index 5bff123e7..7f25717b2 100644 --- a/libraries/launcher/org/polymc/Launcher.java +++ b/libraries/launcher/org/prismlauncher/Launcher.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.polymc; +package org.prismlauncher; public interface Launcher { diff --git a/libraries/launcher/org/polymc/LauncherFactory.java b/libraries/launcher/org/prismlauncher/LauncherFactory.java similarity index 95% rename from libraries/launcher/org/polymc/LauncherFactory.java rename to libraries/launcher/org/prismlauncher/LauncherFactory.java index 868629297..98f2bbba7 100644 --- a/libraries/launcher/org/polymc/LauncherFactory.java +++ b/libraries/launcher/org/prismlauncher/LauncherFactory.java @@ -33,10 +33,10 @@ * along with this program. If not, see . */ -package org.polymc; +package org.prismlauncher; -import org.polymc.impl.OneSixLauncher; -import org.polymc.utils.Parameters; +import org.prismlauncher.impl.OneSixLauncher; +import org.prismlauncher.utils.Parameters; import java.util.HashMap; import java.util.Map; diff --git a/libraries/launcher/org/polymc/applet/LegacyFrame.java b/libraries/launcher/org/prismlauncher/applet/LegacyFrame.java similarity index 99% rename from libraries/launcher/org/polymc/applet/LegacyFrame.java rename to libraries/launcher/org/prismlauncher/applet/LegacyFrame.java index 7ae56e601..4413efa8c 100644 --- a/libraries/launcher/org/polymc/applet/LegacyFrame.java +++ b/libraries/launcher/org/prismlauncher/applet/LegacyFrame.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.polymc.applet; +package org.prismlauncher.applet; import net.minecraft.Launcher; diff --git a/libraries/launcher/org/polymc/exception/ParameterNotFoundException.java b/libraries/launcher/org/prismlauncher/exception/ParameterNotFoundException.java similarity index 95% rename from libraries/launcher/org/polymc/exception/ParameterNotFoundException.java rename to libraries/launcher/org/prismlauncher/exception/ParameterNotFoundException.java index 2044814e9..641e0c995 100644 --- a/libraries/launcher/org/polymc/exception/ParameterNotFoundException.java +++ b/libraries/launcher/org/prismlauncher/exception/ParameterNotFoundException.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.polymc.exception; +package org.prismlauncher.exception; public final class ParameterNotFoundException extends IllegalArgumentException { diff --git a/libraries/launcher/org/polymc/exception/ParseException.java b/libraries/launcher/org/prismlauncher/exception/ParseException.java similarity index 95% rename from libraries/launcher/org/polymc/exception/ParseException.java rename to libraries/launcher/org/prismlauncher/exception/ParseException.java index 2f2f82944..51d25a623 100644 --- a/libraries/launcher/org/polymc/exception/ParseException.java +++ b/libraries/launcher/org/prismlauncher/exception/ParseException.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.polymc.exception; +package org.prismlauncher.exception; public final class ParseException extends IllegalArgumentException { diff --git a/libraries/launcher/org/polymc/impl/OneSixLauncher.java b/libraries/launcher/org/prismlauncher/impl/OneSixLauncher.java similarity index 96% rename from libraries/launcher/org/polymc/impl/OneSixLauncher.java rename to libraries/launcher/org/prismlauncher/impl/OneSixLauncher.java index d43101eb8..d64438266 100644 --- a/libraries/launcher/org/polymc/impl/OneSixLauncher.java +++ b/libraries/launcher/org/prismlauncher/impl/OneSixLauncher.java @@ -13,12 +13,12 @@ * limitations under the License. */ -package org.polymc.impl; +package org.prismlauncher.impl; -import org.polymc.Launcher; -import org.polymc.applet.LegacyFrame; -import org.polymc.utils.Parameters; -import org.polymc.utils.Utils; +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; diff --git a/libraries/launcher/org/polymc/utils/Parameters.java b/libraries/launcher/org/prismlauncher/utils/Parameters.java similarity index 95% rename from libraries/launcher/org/polymc/utils/Parameters.java rename to libraries/launcher/org/prismlauncher/utils/Parameters.java index 864d3cd22..98a40c28d 100644 --- a/libraries/launcher/org/polymc/utils/Parameters.java +++ b/libraries/launcher/org/prismlauncher/utils/Parameters.java @@ -14,9 +14,9 @@ * limitations under the License. */ -package org.polymc.utils; +package org.prismlauncher.utils; -import org.polymc.exception.ParameterNotFoundException; +import org.prismlauncher.exception.ParameterNotFoundException; import java.util.ArrayList; import java.util.HashMap; diff --git a/libraries/launcher/org/polymc/utils/Utils.java b/libraries/launcher/org/prismlauncher/utils/Utils.java similarity index 97% rename from libraries/launcher/org/polymc/utils/Utils.java rename to libraries/launcher/org/prismlauncher/utils/Utils.java index 12d6e1aac..ae9a4de20 100644 --- a/libraries/launcher/org/polymc/utils/Utils.java +++ b/libraries/launcher/org/prismlauncher/utils/Utils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.polymc.utils; +package org.prismlauncher.utils; import java.io.File; import java.lang.reflect.Field; diff --git a/nix/NIX.md b/nix/NIX.md index 047dd82f0..980d20e87 100644 --- a/nix/NIX.md +++ b/nix/NIX.md @@ -1,36 +1,83 @@ -# 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 = { - polymc.url = "github:PolyMC/PolyMC"; + prismlauncher.url = "github:PrismLauncher/PrismLauncher"; }; - -... - - nixpkgs.overlays = [ inputs.polymc.overlay ]; ## Within configuration.nix - environment.systemPackages = with pkgs; [ polymc ]; ## } ``` -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 -``` - -or alternatively you can use - ```nix -{ - nixpkgs.overlays = [ - (import (builtins.fetchTarball "https://github.com/PolyMC/PolyMC/archive/develop.tar.gz")).overlay - ]; +# And in your system configuration: +environment.systemPackages = [ prismlauncher.packages.${pkgs.system}.prismlauncher ]; - environment.systemPackages = with pkgs; [ polymc ]; +# 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"; + }; } ``` + +```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 +nix-channel --update prismlauncher +nix-env -iA prismlauncher +``` + +#### Using the overlay + +```nix +# In your configuration.nix: +{ + nixpkgs.overlays = [ + (import (builtins.fetchTarball "https://github.com/PrismLauncher/PrismLauncher/archive/develop.tar.gz")).overlay + ]; + + 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 +``` diff --git a/nix/default.nix b/nix/default.nix index c8b4f7ccb..c7fc75769 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 ]; }; } diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index e46f63a3a..f6e2ea848 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_Copyright "Prism Launcher Contributors\\n© 2012-2021 MultiMC Contributors") +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 "${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/README.md b/program_info/README.md index 8fc81a19c..5ba2fa322 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.Social.svg b/program_info/org.prismlauncher.PrismLauncher.Social.svg new file mode 100644 index 000000000..4a4da2307 --- /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 0614cde24..ee5dc7248 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" /> - - - - - - + id="guide4872" + inkscape:locked="false" /> + position="12.170833,0.5291669" + orientation="1,0" + id="guide4874" + inkscape:locked="false" /> + position="0.52916688,0.5291666" + orientation="0,-1" + 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" /> + + - - - - - - - - - - - + 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 e9582f5d5..524cf11a6 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.desktop.in b/program_info/org.prismlauncher.PrismLauncher.desktop.in index 63a6b5865..e608f5885 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.logo-darkmode.svg b/program_info/org.prismlauncher.PrismLauncher.logo-darkmode.svg new file mode 100644 index 000000000..208d6f085 --- /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 000000000..56db4258c --- /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 000000000..efaf39313 --- /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.metainfo.xml.in b/program_info/org.prismlauncher.PrismLauncher.metainfo.xml.in index 2e10f7be0..13a860d9a 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 @@ -36,7 +38,7 @@ Mod installation - https://prismlauncher.org/img/screenshots/ModInstallDark.png + https://prismlauncher.org/img/screenshots/ModInstallDark.png Mod updating diff --git a/program_info/org.prismlauncher.PrismLauncher.svg b/program_info/org.prismlauncher.PrismLauncher.svg index c192d5031..aeee84338 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 e9e7c3e2e..000000000 --- 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 c960f33be..000000000 --- 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 837004e18..000000000 --- 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 000000000..7e8c8798d --- /dev/null +++ b/program_info/prismlauncher-monochrome.Source.svg @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/program_info/prismlauncher.6.scd b/program_info/prismlauncher.6.scd index f0628cc96..e3c7de860 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 diff --git a/program_info/prismlauncher.icns b/program_info/prismlauncher.icns index 231fa22ab..a4c0f7ea4 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 d56313f39..e4529f938 100644 Binary files a/program_info/prismlauncher.ico and b/program_info/prismlauncher.ico differ diff --git a/program_info/win_install.nsi.in b/program_info/win_install.nsi.in index 87e266f83..1c1f29dae 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" diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..39a2b6e9a --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base" + ] +}