aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOldWorldOrdr <joey.t.reinhart@gmail.com>2022-06-20 11:02:40 -0400
committerGitHub <noreply@github.com>2022-06-20 11:02:40 -0400
commit6103d86a47039521c3d4c31a4716c1d48962a8f1 (patch)
tree95112ac7e3a583fc740eec845b2bbc3126a816fb
parent843c860d98dab5a438374ab136b28d409184ec81 (diff)
parentb8899a534d9679aace828f9c15a9a3083685f680 (diff)
downloadPrismLauncher-6103d86a47039521c3d4c31a4716c1d48962a8f1.tar.gz
PrismLauncher-6103d86a47039521c3d4c31a4716c1d48962a8f1.tar.bz2
PrismLauncher-6103d86a47039521c3d4c31a4716c1d48962a8f1.zip
Merge branch 'PolyMC:develop' into develop
-rw-r--r--.github/workflows/backport.yml19
-rw-r--r--.github/workflows/build.yml4
-rw-r--r--.github/workflows/pr-comment.yml61
-rw-r--r--CMakeLists.txt7
-rw-r--r--README.md13
-rw-r--r--flake.lock6
-rw-r--r--launcher/Application.cpp49
-rw-r--r--launcher/Application.h15
-rw-r--r--launcher/BaseInstance.cpp55
-rw-r--r--launcher/BaseInstance.h9
-rw-r--r--launcher/CMakeLists.txt38
-rw-r--r--launcher/FileSystem.cpp43
-rw-r--r--launcher/FileSystem.h4
-rw-r--r--launcher/InstanceImportTask.cpp116
-rw-r--r--launcher/InstanceList.cpp16
-rw-r--r--launcher/ModDownloadTask.cpp9
-rw-r--r--launcher/ModDownloadTask.h3
-rw-r--r--launcher/UpdateController.cpp2
-rw-r--r--launcher/icons/IconList.cpp11
-rw-r--r--launcher/icons/IconList.h1
-rw-r--r--launcher/minecraft/MinecraftInstance.cpp8
-rw-r--r--launcher/minecraft/launch/LauncherPartLaunch.cpp41
-rw-r--r--launcher/minecraft/mod/Mod.cpp47
-rw-r--r--launcher/minecraft/mod/Mod.h8
-rw-r--r--launcher/minecraft/mod/ModFolderModel.cpp53
-rw-r--r--launcher/minecraft/mod/ModFolderModel.h52
-rw-r--r--launcher/minecraft/mod/ModFolderModel_test.cpp44
-rw-r--r--launcher/minecraft/mod/ResourcePackFolderModel.cpp35
-rw-r--r--launcher/minecraft/mod/TexturePackFolderModel.cpp35
-rw-r--r--launcher/minecraft/mod/tasks/LocalModUpdateTask.cpp14
-rw-r--r--launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp38
-rw-r--r--launcher/minecraft/mod/tasks/ModFolderLoadTask.h4
-rw-r--r--launcher/modplatform/ModAPI.h2
-rw-r--r--launcher/modplatform/ModIndex.h19
-rw-r--r--launcher/modplatform/atlauncher/ATLPackInstallTask.cpp18
-rw-r--r--launcher/modplatform/atlauncher/ATLPackInstallTask.h5
-rw-r--r--launcher/modplatform/flame/FlameAPI.h5
-rw-r--r--launcher/modplatform/flame/FlameModIndex.cpp21
-rw-r--r--launcher/modplatform/flame/FlameModIndex.h1
-rw-r--r--launcher/modplatform/flame/FlamePackIndex.cpp27
-rw-r--r--launcher/modplatform/flame/FlamePackIndex.h12
-rw-r--r--launcher/modplatform/helpers/NetworkModAPI.cpp25
-rw-r--r--launcher/modplatform/helpers/NetworkModAPI.h2
-rw-r--r--launcher/modplatform/modpacksch/FTBPackInstallTask.cpp44
-rw-r--r--launcher/modplatform/modrinth/ModrinthAPI.h5
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackIndex.cpp37
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackIndex.h1
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackManifest.cpp43
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackManifest.h19
-rw-r--r--launcher/modplatform/packwiz/Packwiz_test.cpp33
-rw-r--r--launcher/modplatform/technic/TechnicPackProcessor.cpp21
-rw-r--r--launcher/net/Download.cpp2
-rw-r--r--launcher/net/PasteUpload.cpp7
-rw-r--r--launcher/net/Upload.cpp2
-rw-r--r--launcher/screenshots/ImgurAlbumCreation.cpp2
-rw-r--r--launcher/screenshots/ImgurUpload.cpp3
-rw-r--r--launcher/tools/MCEditTool.cpp2
-rw-r--r--launcher/ui/GuiUtil.cpp2
-rw-r--r--launcher/ui/MainWindow.cpp68
-rw-r--r--launcher/ui/MainWindow.h54
-rw-r--r--launcher/ui/pages/global/APIPage.cpp5
-rw-r--r--launcher/ui/pages/global/APIPage.ui129
-rw-r--r--launcher/ui/pages/global/LanguagePage.cpp1
-rw-r--r--launcher/ui/pages/global/LanguagePage.h1
-rw-r--r--launcher/ui/pages/global/LauncherPage.cpp11
-rw-r--r--launcher/ui/pages/global/LauncherPage.h5
-rw-r--r--launcher/ui/pages/global/LauncherPage.ui3
-rw-r--r--launcher/ui/pages/instance/LogPage.cpp2
-rw-r--r--launcher/ui/pages/instance/ModFolderPage.cpp1
-rw-r--r--launcher/ui/pages/instance/ModFolderPage.h1
-rw-r--r--launcher/ui/pages/instance/ScreenshotsPage.cpp1
-rw-r--r--launcher/ui/pages/instance/ScreenshotsPage.h1
-rw-r--r--launcher/ui/pages/instance/ServersPage.cpp2
-rw-r--r--launcher/ui/pages/instance/WorldListPage.cpp2
-rw-r--r--launcher/ui/pages/modplatform/ImportPage.cpp11
-rw-r--r--launcher/ui/pages/modplatform/ModModel.cpp20
-rw-r--r--launcher/ui/pages/modplatform/ModModel.h4
-rw-r--r--launcher/ui/pages/modplatform/ModPage.cpp126
-rw-r--r--launcher/ui/pages/modplatform/ModPage.h4
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlPage.cpp2
-rw-r--r--launcher/ui/pages/modplatform/flame/FlamePage.cpp68
-rw-r--r--launcher/ui/pages/modplatform/flame/FlamePage.h2
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbListModel.cpp12
-rw-r--r--launcher/ui/pages/modplatform/legacy_ftb/ListModel.cpp37
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthModModel.cpp5
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthModModel.h1
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp1
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthModel.h1
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp32
-rw-r--r--launcher/ui/pages/modplatform/technic/TechnicPage.ui6
-rw-r--r--libraries/launcher/net/minecraft/Launcher.java65
-rw-r--r--nix/default.nix5
-rw-r--r--program_info/CMakeLists.txt3
-rw-r--r--program_info/win_install.nsi.in (renamed from program_info/win_install.nsi)52
94 files changed, 1489 insertions, 475 deletions
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml
deleted file mode 100644
index fa287a2c..00000000
--- a/.github/workflows/backport.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-name: Backport PR to stable
-on:
- pull_request:
- branches: [ develop ]
- types: [ closed ]
-jobs:
- release_pull_request:
- if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'backport')
- runs-on: ubuntu-latest
- steps:
- - name: checkout
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
- - name: Backport PR by cherry-pick-ing
- uses: Nathanmalnoury/gh-backport-action@master
- with:
- pr_branch: 'stable'
- github_token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 6cbd5c21..d8fc1ff2 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -28,7 +28,7 @@ jobs:
name: "Windows-x86_64"
msystem: mingw64
- - os: macos-11
+ - os: macos-12
macosx_deployment_target: 10.13
runs-on: ${{ matrix.os }}
@@ -206,7 +206,7 @@ jobs:
shell: msys2 {0}
run: |
cd ${{ env.INSTALL_DIR }}
- makensis -NOCD "-DVERSION=${{ env.VERSION }}" "-DMUI_ICON=${{ github.workspace }}/program_info/polymc.ico" "-XOutFile ${{ github.workspace }}/PolyMC-Setup.exe" "${{ github.workspace }}/program_info/win_install.nsi"
+ makensis -NOCD "${{ github.workspace }}/${{ env.BUILD_DIR }}/program_info/win_install.nsi"
- name: Package (Linux)
if: runner.os == 'Linux' && matrix.appimage != true
diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml
deleted file mode 100644
index f0f5b8cc..00000000
--- a/.github/workflows/pr-comment.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-name: Comment on pull request
-on:
- workflow_run:
- workflows: ['Build Application']
- types: [completed]
-jobs:
- pr_comment:
- if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/github-script@v5
- with:
- # This snippet is public-domain, taken from
- # https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml
- script: |
- async function upsertComment(owner, repo, issue_number, purpose, body) {
- const {data: comments} = await github.rest.issues.listComments(
- {owner, repo, issue_number});
-
- const marker = `<!-- bot: ${purpose} -->`;
- body = marker + "\n" + body;
-
- const existing = comments.filter((c) => c.body.includes(marker));
- if (existing.length > 0) {
- const last = existing[existing.length - 1];
- core.info(`Updating comment ${last.id}`);
- await github.rest.issues.updateComment({
- owner, repo,
- body,
- comment_id: last.id,
- });
- } else {
- core.info(`Creating a comment in issue / PR #${issue_number}`);
- await github.rest.issues.createComment({issue_number, body, owner, repo});
- }
- }
-
- const {owner, repo} = context.repo;
- const run_id = ${{github.event.workflow_run.id}};
-
- const pull_requests = ${{ toJSON(github.event.workflow_run.pull_requests) }};
- if (!pull_requests.length) {
- return core.error("This workflow doesn't match any pull requests!");
- }
-
- const artifacts = await github.paginate(
- github.rest.actions.listWorkflowRunArtifacts, {owner, repo, run_id});
- if (!artifacts.length) {
- return core.error(`No artifacts found`);
- }
- let body = `Download the artifacts for this pull request:\n`;
- for (const art of artifacts) {
- body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`;
- }
-
- core.info("Review thread message body:", body);
-
- for (const pr of pull_requests) {
- await upsertComment(owner, repo, pr.number,
- "nightly-link", body);
- }
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 11d58213..b09e7fd2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,8 +45,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_DISABLE_DEPRECATED_BEFORE=0x050C00")
# set CXXFLAGS for build targets
-set(CMAKE_CXX_FLAGS_DEBUG "-O2 -D_FORTIFY_SOURCE=2 ${CMAKE_CXX_FLAGS}")
-set(CMAKE_CXX_FLAGS_RELEASE "-O2 -D_FORTIFY_SOURCE=2 ${CMAKE_CXX_FLAGS}")
+set(CMAKE_CXX_FLAGS_RELEASE "-O2 -D_FORTIFY_SOURCE=2 ${CMAKE_CXX_FLAGS_RELEASE}")
option(ENABLE_LTO "Enable Link Time Optimization" off)
@@ -73,8 +72,8 @@ set(Launcher_HELP_URL "https://polymc.org/wiki/help-pages/%1" CACHE STRING "URL
######## Set version numbers ########
set(Launcher_VERSION_MAJOR 1)
-set(Launcher_VERSION_MINOR 3)
-set(Launcher_VERSION_HOTFIX 1)
+set(Launcher_VERSION_MINOR 4)
+set(Launcher_VERSION_HOTFIX 0)
# Build number
set(Launcher_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.")
diff --git a/README.md b/README.md
index 3dbc19c1..1e4e5caf 100644
--- a/README.md
+++ b/README.md
@@ -96,3 +96,16 @@ If you do not agree with these terms and conditions, then remove the associated
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
+Thank you to all our generous backers over at Open Collective! Support PolyMC by [becoming a backer](https://opencollective.com/polymc).
+
+[![OpenCollective Backers](https://opencollective.com/polymc/backers.svg?width=890&limit=1000)](https://opencollective.com/polymc#backers)
+
+Also, 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/)
+
+Additionally, thanks to the awesome people over at [MacStadium](https://www.macstadium.com/), for providing M1-Macs for development purposes!
+
+<a href="https://www.macstadium.com"><img src="https://uploads-ssl.webflow.com/5ac3c046c82724970fc60918/5c019d917bba312af7553b49_MacStadium-developerlogo.png" alt="Powered by MacStadium" width="300"></a>
diff --git a/flake.lock b/flake.lock
index ccdd51da..120b11c5 100644
--- a/flake.lock
+++ b/flake.lock
@@ -34,11 +34,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1653326962,
- "narHash": "sha256-W8feCYqKTsMre4nAEpv5Kx1PVFC+hao/LwqtB2Wci/8=",
+ "lastModified": 1654665288,
+ "narHash": "sha256-7blJpfoZEu7GKb84uh3io/5eSJNdaagXD9d15P9iQMs=",
"owner": "nixos",
"repo": "nixpkgs",
- "rev": "41cc1d5d9584103be4108c1815c350e07c807036",
+ "rev": "43ecbe7840d155fa933ee8a500fb00dbbc651fc8",
"type": "github"
},
"original": {
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index 99e3d4c5..ab3110a3 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -154,6 +154,7 @@ void appDebugOutput(QtMsgType type, const QMessageLogContext &context, const QSt
fflush(stderr);
}
+#ifdef LAUNCHER_WITH_UPDATER
QString getIdealPlatform(QString currentPlatform) {
auto info = Sys::getKernelInfo();
switch(info.kernelType) {
@@ -192,6 +193,7 @@ QString getIdealPlatform(QString currentPlatform) {
}
return currentPlatform;
}
+#endif
}
@@ -711,6 +713,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
// Custom MSA credentials
m_settings->registerSetting("MSAClientIDOverride", "");
m_settings->registerSetting("CFKeyOverride", "");
+ m_settings->registerSetting("UserAgentOverride", "");
// Init page provider
{
@@ -753,6 +756,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
qDebug() << "<> Translations loaded.";
}
+#ifdef LAUNCHER_WITH_UPDATER
// initialize the updater
if(BuildConfig.UPDATER_ENABLED)
{
@@ -762,6 +766,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
m_updateChecker.reset(new UpdateChecker(m_network, channelUrl, BuildConfig.VERSION_CHANNEL, BuildConfig.VERSION_BUILD));
qDebug() << "<> Updater started.";
}
+#endif
// Instance icons
{
@@ -874,6 +879,12 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
m_mcedit.reset(new MCEditTool(m_settings));
}
+#ifdef Q_OS_MACOS
+ connect(this, &Application::clickedOnDock, [this]() {
+ this->showMainWindow();
+ });
+#endif
+
connect(this, &Application::aboutToQuit, [this](){
if(m_instances)
{
@@ -957,6 +968,21 @@ bool Application::createSetupWizard()
return false;
}
+bool Application::event(QEvent* event) {
+#ifdef Q_OS_MACOS
+ if (event->type() == QEvent::ApplicationStateChange) {
+ auto ev = static_cast<QApplicationStateChangeEvent*>(event);
+
+ if (m_prevAppState == Qt::ApplicationActive
+ && ev->applicationState() == Qt::ApplicationActive) {
+ emit clickedOnDock();
+ }
+ m_prevAppState = ev->applicationState();
+ }
+#endif
+ return QApplication::event(e