aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/FUNDING.yml1
-rw-r--r--.github/workflows/build.yml32
-rw-r--r--.github/workflows/pr-comment.yml2
-rw-r--r--README.md7
-rw-r--r--buildconfig/BuildConfig.h2
-rw-r--r--launcher/Application.cpp69
-rw-r--r--launcher/CMakeLists.txt2
-rw-r--r--launcher/modplatform/atlauncher/ATLShareCode.cpp60
-rw-r--r--launcher/modplatform/atlauncher/ATLShareCode.h47
-rw-r--r--launcher/resources/multimc/multimc.qrc1
-rw-r--r--launcher/resources/multimc/scalable/instances/polymc.svg21
-rw-r--r--launcher/ui/MainWindow.cpp8
-rw-r--r--launcher/ui/pages/global/APIPage.ui4
-rw-r--r--launcher/ui/pages/global/AccountListPage.ui18
-rw-r--r--launcher/ui/pages/global/ExternalToolsPage.ui11
-rw-r--r--launcher/ui/pages/global/JavaPage.cpp2
-rw-r--r--launcher/ui/pages/global/JavaPage.ui113
-rw-r--r--launcher/ui/pages/global/LauncherPage.cpp14
-rw-r--r--launcher/ui/pages/global/LauncherPage.h1
-rw-r--r--launcher/ui/pages/global/LauncherPage.ui25
-rw-r--r--launcher/ui/pages/global/MinecraftPage.ui20
-rw-r--r--launcher/ui/pages/global/ProxyPage.ui16
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp150
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.h50
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.ui16
-rw-r--r--launcher/ui/widgets/CustomCommands.ui17
-rw-r--r--libraries/iconfix/CMakeLists.txt2
-rw-r--r--libraries/launcher/org/multimc/EntryPoint.java167
-rw-r--r--libraries/launcher/org/multimc/Launcher.java2
-rw-r--r--libraries/launcher/org/multimc/ParamBucket.java51
-rw-r--r--libraries/launcher/org/multimc/Utils.java33
-rw-r--r--libraries/launcher/org/multimc/onesix/OneSixLauncher.java46
-rwxr-xr-xprogram_info/genicons.sh23
-rw-r--r--program_info/org.polymc.PolyMC.bigsur.svg32
-rw-r--r--program_info/polymc.icnsbin272578 -> 261369 bytes
35 files changed, 674 insertions, 391 deletions
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000..247675fc
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1 @@
+open_collective: polymc
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 57c04e21..0590b348 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -62,6 +62,32 @@ jobs:
cmake:p
ninja:p
qt5:p
+ ccache:p
+
+ - name: Setup ccache
+ if: runner.os != 'Windows' && inputs.build_type == 'Debug'
+ uses: hendrikmuhs/ccache-action@v1.2.1
+ with:
+ key: ${{ matrix.os }}-${{ matrix.appimage }}
+
+ - name: Setup ccache (Windows)
+ if: runner.os == 'Windows' && inputs.build_type == 'Debug'
+ shell: msys2 {0}
+ run: |
+ ccache --set-config=cache_dir='${{ github.workspace }}\.ccache'
+ ccache --set-config=max_size='500M'
+ ccache --set-config=compression=true
+ ccache -p # Show config
+ ccache -z # Zero stats
+
+ - name: Retrieve ccache cache (Windows)
+ if: runner.os == 'Windows' && inputs.build_type == 'Debug'
+ uses: actions/cache@v3.0.2
+ with:
+ path: '${{ github.workspace }}\.ccache'
+ key: ${{ matrix.os }}-${{ matrix.msystem }}
+ restore-keys: |
+ ${{ matrix.os }}-${{ matrix.msystem }}
- name: Set short version
shell: bash
@@ -102,18 +128,18 @@ jobs:
- name: Configure CMake (macOS)
if: runner.os == 'macOS'
run: |
- cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DQt5_DIR=/usr/local/opt/qt@5 -DCMAKE_PREFIX_PATH=/usr/local/opt/qt@5 -DLauncher_BUILD_PLATFORM=macOS -G Ninja
+ cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DQt5_DIR=/usr/local/opt/qt@5 -DCMAKE_PREFIX_PATH=/usr/local/opt/qt@5 -DLauncher_BUILD_PLATFORM=macOS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
- cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -G Ninja
+ cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=${{ matrix.name }} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja
- name: Configure CMake (Linux)
if: runner.os == 'Linux'
run: |
- cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=Linux -G Ninja
+ cmake -S . -B ${{ env.BUILD_DIR }} -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DENABLE_LTO=ON -DLauncher_BUILD_PLATFORM=Linux -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja
##
# BUILD
diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml
index 7e8e4d99..f0f5b8cc 100644
--- a/.github/workflows/pr-comment.yml
+++ b/.github/workflows/pr-comment.yml
@@ -1,7 +1,7 @@
name: Comment on pull request
on:
workflow_run:
- workflows: ['Test workflow with upload']
+ workflows: ['Build Application']
types: [completed]
jobs:
pr_comment:
diff --git a/README.md b/README.md
index 4c73c47e..c493293d 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,8 @@
PolyMC is a custom launcher for Minecraft that focuses on predictability, long term stability and simplicity.
-This is a **fork** of the MultiMC Launcher and not endorsed by MultiMC. The PolyMC community felt that the maintainer was not acting in the spirit of Free Software so this fork was made.
+This is a **fork** of the MultiMC Launcher and not endorsed by MultiMC.
+If you want to read about why this fork was created, check out [our FAQ page](https://polymc.org/wiki/overview/faq/).
<br>
# Installation
@@ -81,8 +82,8 @@ To modify download information or change packaging information send a pull reque
Do whatever you want, we don't care. Just follow the license. If you have any questions about this feel free to ask in an issue.
-All launcher code is available under the GPL-3 license.
+All launcher code is available under the GPL-3.0-only license.
-[Source for the website](https://github.com/PolyMC/polymc.github.io) is hosted under the AGPL-3 License.
+[Source for the website](https://github.com/PolyMC/polymc.github.io) is hosted under the AGPL-3.0-or-later License.
The logo and related assets are under the CC BY-SA 4.0 license.
diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h
index a653e3cf..a920a3d4 100644
--- a/buildconfig/BuildConfig.h
+++ b/buildconfig/BuildConfig.h
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* PolyMC - Minecraft Launcher
+ * Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
@@ -142,6 +143,7 @@ class Config {
QString LEGACY_FTB_CDN_BASE_URL = "https://dist.creeper.host/FTB2/";
QString ATL_DOWNLOAD_SERVER_URL = "https://download.nodecdn.net/containers/atl/";
+ QString ATL_API_BASE_URL = "https://api.atlauncher.com/v1/";
QString TECHNIC_API_BASE_URL = "https://api.technicpack.net/";
/**
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index 8bd434f0..11109857 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -409,69 +409,6 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
return;
}
-#if defined(Q_OS_MAC)
- // move user data to new location if on macOS and it still exists in Contents/MacOS
- QDir fi(applicationDirPath());
- QString originalData = fi.absolutePath();
- // if the config file exists in Contents/MacOS, then user data is still there and needs to moved
- if (QFileInfo::exists(FS::PathCombine(originalData, BuildConfig.LAUNCHER_CONFIGFILE)))
- {
- if (!QFileInfo::exists(FS::PathCombine(originalData, "dontmovemacdata")))
- {
- QMessageBox::StandardButton askMoveDialogue;
- askMoveDialogue = QMessageBox::question(
- nullptr,
- BuildConfig.LAUNCHER_DISPLAYNAME,
- "Would you like to move application data to a new data location? It will improve the launcher's performance, but if you switch to older versions it will look like instances have disappeared. If you select no, you can migrate later in settings. You should select yes unless you're commonly switching between different versions (eg. develop and stable).",
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::Yes
- );
- if (askMoveDialogue == QMessageBox::Yes)
- {
- qDebug() << "On macOS and found config file in old location, moving user data...";
- QDir dir;
- QStringList dataFiles {
- "*.log", // Launcher log files: ${Launcher_Name}-@.log
- "accounts.json",
- "accounts",
- "assets",
- "cache",
- "icons",
- "instances",
- "libraries",
- "meta",
- "metacache",
- "mods",
- BuildConfig.LAUNCHER_CONFIGFILE,
- "themes",
- "translations"
- };
- QDirIterator files(originalData, dataFiles);
- while (files.hasNext()) {
- QString filePath(files.next());
- QString fileName(files.fileName());
- if (!dir.rename(filePath, FS::PathCombine(dataPath, fileName)))
- {
- qWarning() << "Failed to move " << fileName;
- }
- }
- }
- else
- {
- dataPath = originalData;
- QDir::setCurrent(dataPath);
- QFile file(originalData + "/dontmovemacdata");
- file.open(QIODevice::WriteOnly);
- }
- }
- else
- {
- dataPath = originalData;
- QDir::setCurrent(dataPath);
- }
- }
-#endif
-
/*
* Establish the mechanism for communication with an already running PolyMC that uses the same data path.
* If there is one, tell it what the user actually wanted to do and exit.
@@ -691,6 +628,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
m_settings->registerSetting("LastHostname", "");
m_settings->registerSetting("JvmArgs", "");
m_settings->registerSetting("IgnoreJavaCompatibility", false);
+ m_settings->registerSetting("IgnoreJavaWizard", false);
// Native library workarounds
m_settings->registerSetting("UseNativeOpenAL", false);
@@ -936,6 +874,10 @@ bool Application::createSetupWizard()
{
bool javaRequired = [&]()
{
+ bool ignoreJavaWizard = m_settings->get("IgnoreJavaWizard").toBool();
+ if(ignoreJavaWizard) {
+ return false;
+ }
QString currentHostName = QHostInfo::localHostName();
QString oldHostName = settings()->get("LastHostname").toString();
if (currentHostName != oldHostName)
@@ -966,6 +908,7 @@ bool Application::createSetupWizard()
{
m_setupWizard->addPage(new LanguageWizardPage(m_setupWizard));
}
+
if (javaRequired)
{
m_setupWizard->addPage(new JavaWizardPage(m_setupWizard));
diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt
index 075c183a..b79f03c8 100644
--- a/launcher/CMakeLists.txt
+++ b/launcher/CMakeLists.txt
@@ -559,6 +559,8 @@ set(ATLAUNCHER_SOURCES
modplatform/atlauncher/ATLPackInstallTask.h
modplatform/atlauncher/ATLPackManifest.cpp
modplatform/atlauncher/ATLPackManifest.h
+ modplatform/atlauncher/ATLShareCode.cpp
+ modplatform/atlauncher/ATLShareCode.h
)
add_unit_test(Index
diff --git a/launcher/modplatform/atlauncher/ATLShareCode.cpp b/launcher/modplatform/atlauncher/ATLShareCode.cpp
new file mode 100644
index 00000000..59030c87
--- /dev/null
+++ b/launcher/modplatform/atlauncher/ATLShareCode.cpp
@@ -0,0 +1,60 @@
+// SPDX-License-Identifier: GPL-3.0-only
+/*
+ * PolyMC - Minecraft Launcher
+ * Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
+ *
+ * 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 <https://www.gnu.org/licenses/>.
+ */
+
+#include "ATLShareCode.h"
+
+#include "Json.h"
+
+namespace ATLauncher {
+
+static void loadShareCodeMod(ShareCodeMod& m, QJsonObject& obj)
+{
+ m.selected = Json::requireBoolean(obj, "selected");
+ m.name = Json::requireString(obj, "name");
+}
+
+static void loadShareCode(ShareCode& c, QJsonObject& obj)
+{
+ c.pack = Json::requireString(obj, "pack");
+ c.version = Json::requireString(obj, "version");
+
+ auto mods = Json::requireObject(obj, "mods");
+ auto optional = Json::requireArray(mods, "optional");
+ for (const auto modRaw : optional) {
+ auto modObj = Json::requireObject(modRaw);
+ ShareCodeMod mod;
+ loadShareCodeMod(mod, modObj);
+ c.mods.append(mod);
+ }
+}
+
+void loadShareCodeResponse(ShareCodeResponse& r, QJsonObject& obj)
+{
+ r.error = Json::requireBoolean(obj, "error");
+ r.code = Json::requireInteger(obj, "code");
+
+ if (obj.contains("message") && !obj.value("message").isNull())
+ r.message = Json::requireString(obj, "message");
+
+ if (!r.error) {
+ auto dataRaw = Json::requireObject(obj, "data");
+ loadShareCode(r.data, dataRaw);
+ }
+}
+
+}
diff --git a/launcher/modplatform/atlauncher/ATLShareCode.h b/launcher/modplatform/atlauncher/ATLShareCode.h
new file mode 100644
index 00000000..88c30c98
--- /dev/null
+++ b/launcher/modplatform/atlauncher/ATLShareCode.h
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: GPL-3.0-only
+/*
+ * PolyMC - Minecraft Launcher
+ * Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
+ *
+ * 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 <https://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <QString>
+#include <QVector>
+#include <QJsonObject>
+
+namespace ATLauncher {
+
+struct ShareCodeMod {
+ bool selected;
+ QString name;
+};
+
+struct ShareCode {
+ QString pack;
+ QString version;
+ QVector<ShareCodeMod> mods;
+};
+
+struct ShareCodeResponse {
+ bool error;
+ int code;
+ QString message;
+ ShareCode data;
+};
+
+void loadShareCodeResponse(ShareCodeResponse& r, QJsonObject& obj);
+
+}
diff --git a/launcher/resources/multimc/multimc.qrc b/launcher/resources/multimc/multimc.qrc
index d31885b9..0fe673ff 100644
--- a/launcher/resources/multimc/multimc.qrc
+++ b/launcher/resources/multimc/multimc.qrc
@@ -313,5 +313,6 @@
<file>scalable/instances/fox.svg</file>
<file>scalable/instances/bee.svg</file>
+ <file>scalable/instances/polymc.svg</file>
</qresource>
</RCC>
diff --git a/launcher/resources/multimc/scalable/instances/polymc.svg b/launcher/resources/multimc/scalable/instances/polymc.svg
new file mode 100644
index 00000000..c192d503
--- /dev/null
+++ b/launcher/resources/multimc/scalable/instances/polymc.svg
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg width="64" height="64" version="1.1" viewBox="0 0 16.933 16.933" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs>
+ <linearGradient id="linearGradient84726" x1="4.4979" x2="12.435" y1="3.8011" y2="9.5681" gradientUnits="userSpaceOnUse">
+ <stop stop-color="#88b858" offset="0"/>
+ <stop stop-color="#72b147" offset=".5"/>
+ <stop stop-color="#5a9a30" offset="1"/>
+ </linearGradient>
+ </defs>
+ <g>
+ <path d="m3.561 16.016s0-3.5642 4.9056-3.5642c4.9069 0 4.9056 3.5642 4.9056 3.5642z" fill="#765338"/>
+ <path d="m8.4667 12.452-4.9056 3.5642-3.0319-9.3311z" fill="#b7835a"/>
+ <path d="m8.4667 12.452 7.9375-5.7669-3.0319 9.3311z" fill="#5b422d"/>
+ <path d="m8.8308 12.716-0.36417 0.26458-0.36417-0.26458c0-0.26458 0.36417-0.26458 0.36417-0.26458s0.36417 0 0.36417 0.26458z" fill="#72b147"/>
+ <path d="m8.4667 12.452s-2e-7 -5.7669 7.9375-5.7669l-0.22507 0.69269-0.91853 1.1965-0.91853 0.13819-0.91853 1.1965-0.91853 0.13819-0.91853 1.1965-0.91853 0.13819-0.91853 1.1965-0.91853 0.13819z" fill="#5a9a30"/>
+ <path d="m8.1025 12.716-0.91853-0.13819-0.91853-1.1965-0.91853-0.13819-0.91853-1.1965-0.91853-0.13819-0.91853-1.1965-0.91853-0.13819-0.91853-1.1965-0.22507-0.69269c7.9375 1e-7 7.9375 5.7669 7.9375 5.7669z" fill="#88b858"/>
+ <path d="m0.52917 6.6846 7.9375 5.7669 7.9375-5.7669-7.9375-5.7669z" fill="url(#linearGradient84726)"/>
+ </g>
+ <path d="m0.75424 7.3773-0.22507-0.69269 7.9375 5.7669 7.9375-5.7669-0.22507 0.69269-7.7124 5.6034z" fill-opacity="0"/>
+</svg>
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp
index 7ac4d2d4..f34cf1ab 100644
--- a/launcher/ui/MainWindow.cpp
+++ b/launcher/ui/MainWindow.cpp
@@ -294,14 +294,14 @@ public:
actionViewInstanceFolder = TranslatedAction(MainWindow);
actionViewInstanceFolder->setObjectName(QStringLiteral("actionViewInstanceFolder"));
actionViewInstanceFolder->setIcon(APPLICATION->getThemedIcon("viewfolder"));
- actionViewInstanceFolder.setTextId(QT_TRANSLATE_NOOP("MainWindow", "View Instance Folder"));
+ actionViewInstanceFolder.setTextId(QT_TRANSLATE_NOOP("MainWindow", "&View Instance Folder"));
actionViewInstanceFolder.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the instance folder in a file browser."));
all_actions.append(&actionViewInstanceFolder);
actionViewCentralModsFolder = TranslatedAction(MainWindow);
actionViewCentralModsFolder->setObjectName(QStringLiteral("actionViewCentralModsFolder"));
actionViewCentralModsFolder->setIcon(APPLICATION->getThemedIcon("centralmods"));
- actionViewCentralModsFolder.setTextId(QT_TRANSLATE_NOOP("MainWindow", "View Central Mods Folder"));
+ actionViewCentralModsFolder.setTextId(QT_TRANSLATE_NOOP("MainWindow", "View &Central Mods Folder"));
actionViewCentralModsFolder.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the central mods folder in a file browser."));
all_actions.append(&actionViewCentralModsFolder);
@@ -326,7 +326,7 @@ public:
actionSettings->setObjectName(QStringLiteral("actionSettings"));
actionSettings->setIcon(APPLICATION->getThemedIcon("settings"));
actionSettings->setMenuRole(QAction::PreferencesRole);
- actionSettings.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Settings..."));
+ actionSettings.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Setti&ngs..."));
actionSettings.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Change settings."));
actionSettings->setShortcut(QKeySequence::Preferences);
all_actions.append(&actionSettings);
@@ -542,7 +542,7 @@ public:
actionOpenWiki = TranslatedAction(MainWindow);
actionOpenWiki->setObjectName(QStringLiteral("actionOpenWiki"));
- actionOpenWiki.setTextId(QT_TRANSLATE_NOOP("MainWindow", "%1 He&lp"));
+ actionOpenWiki.setTextId(QT_TRANSLATE_NOOP("MainWindow", "%1 &Help"));
actionOpenWiki.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the %1 wiki"));
connect(actionOpenWiki, &QAction::triggered, MainWindow, &MainWindow::on_actionOpenWiki_triggered);
all_actions.append(&actionOpenWiki);
diff --git a/launcher/ui/pages/global/APIPage.ui b/launcher/ui/pages/global/APIPage.ui
index 7a9088d1..acde9aef 100644
--- a/launcher/ui/pages/global/APIPage.ui
+++ b/launcher/ui/pages/global/APIPage.ui
@@ -36,7 +36,7 @@
<item>
<widget class="QGroupBox" name="groupBox_paste">
<property name="title">
- <string>Pastebin URL</string>
+ <string>&amp;Pastebin URL</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
@@ -98,7 +98,7 @@
<item>
<widget class="QGroupBox" name="groupBox_msa">
<property name="title">
- <string>Microsoft Authentication</string>
+ <string>&amp;Microsoft Authentication</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
diff --git a/launcher/ui/pages/global/AccountListPage.ui b/launcher/ui/pages/global/AccountListPage.ui
index d21a92e2..469955b5 100644
--- a/launcher/ui/pages/global/AccountListPage.ui
+++ b/launcher/ui/pages/global/AccountListPage.ui
@@ -65,17 +65,17 @@
</widget>
<action name="actionAddMojang">
<property name="text">
- <string>Add Mojang</string>
+ <string>Add &amp;Mojang</string>
</property>
</action>
<action name="actionRemove">
<property name="text">
- <string>Remove</string>
+ <string>Remo&amp;ve</string>
</property>
</action>
<action name="actionSetDefault">
<property name="text">
- <string>Set Default</string>
+ <string>&amp;Set Default</string>
</property>
</action>
<action name="actionNoDefault">
@@ -83,17 +83,17 @@
<bool>true</bool>
</property>
<property name="text">
- <string>No Default</string>
+ <string>&amp;No Default</string>
</property>
</action>
<action name="actionUploadSkin">
<property name="text">
- <string>Upload Skin</string>
+ <string>&amp;Upload Skin</string>
</property>
</action>
<action name="actionDeleteSkin">
<property name="text">
- <string>Delete Skin</string>
+ <string>&amp;Delete Skin</string>
</property>
<property name="toolTip">
<string>Delete the currently active skin and go back to the default one</string>
@@ -101,17 +101,17 @@
</action>
<action name="actionAddMicrosoft">
<property name="text">
- <string>Add Microsoft</string>
+ <string>&amp;Add Microsoft</string>
</property>
</action>
<action name="actionAddOffline">
<property name="text">
- <string>Add Offline</string>
+ <string>Add &amp;Offline</string>
</property>
</action>
<action name="actionRefresh">
<property name="text">
- <string>Refresh</string>
+ <string>&amp;Refresh</string>
</property>
<property name="toolTip">
<string>Refresh the account tokens</string>
diff --git a/launcher/ui/pages/global/ExternalToolsPage.ui b/launcher/ui/pages/global/ExternalToolsPage.ui
index e79e9388..3643094d 100644
--- a/launcher/ui/pages/global/ExternalToolsPage.ui
+++ b/launcher/ui/pages/global/ExternalToolsPage.ui
@@ -36,7 +36,7 @@
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
- <string notr="true">JProfiler</string>
+ <string notr="true">J&amp;Profiler</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
@@ -73,7 +73,7 @@
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
- <string notr="true">JVisualVM</string>
+ <string notr="true">J&amp;VisualVM</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
@@ -110,7 +110,7 @@
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
- <string notr="true">MCEdit</string>
+ <string notr="true">&amp;MCEdit</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
<item>
@@ -156,7 +156,10 @@
<item row="0" column="0">
<widget class="QLabel" name="labelJsonEditor">
<property name="text">
- <string>Text Editor:</string>
+ <string>&amp;Text Editor:</string>
+ </property>
+ <property name="buddy">
+ <cstring>jsonEditorTextBox</cstring>
</property>
</widget>
</item>
diff --git a/launcher/ui/pages/global/JavaPage.cpp b/launcher/ui/pages/global/JavaPage.cpp
index f0616db1..b5e8de6c 100644
--- a/launcher/ui/pages/global/JavaPage.cpp
+++ b/launcher/ui/pages/global/JavaPage.cpp
@@ -97,6 +97,7 @@ void JavaPage::applySettings()
s->set("JavaPath", ui->javaPathTextBox->text());
s->set("JvmArgs", ui->jvmArgsTextBox->text());
s->set("IgnoreJavaCompatibility", ui->skipCompatibilityCheckbox->isChecked());
+ s->set("IgnoreJavaWizard", ui->skipJavaWizardCheckbox->isChecked());
JavaCommon::checkJVMArgs(s->get("JvmArgs").toString(), this->parentWidget());
}
void JavaPage::loadSettings()
@@ -121,6 +122,7 @@ void JavaPage::loadSettings()
ui->javaPathTextBox->setText(s->get("JavaPath").toString());
ui->jvmArgsTextBox->setText(s->get("JvmArgs").toString());
ui->skipCompatibilityCheckbox->setChecked(s->get("IgnoreJavaCompatibility").toBool());
+ ui->skipJavaWizardCheckbox->setChecked(s->get("IgnoreJavaWizard").toBool());
}
void JavaPage::on_javaDetectBtn_clicked()
diff --git a/launcher/ui/pages/global/JavaPage.ui b/launcher/ui/pages/global/JavaPage.ui
index d27b200f..3e4b12a1 100644
--- a/launcher/ui/pages/global/JavaPage.ui
+++ b/launcher/ui/pages/global/JavaPage.ui
@@ -70,14 +70,20 @@
<item row="0" column="0">
<widget class="QLabel" name="labelMinMem">
<property name="text">
- <string>Minimum memory allocation:</string>
+ <string>&amp;Minimum memory allocation:</string>
+ </property>
+ <property name="buddy">
+ <cstring>minMemSpinBox</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelMaxMem">
<property name="text">
- <string>Maximum memory allocation:</string>
+ <string>Ma&amp;ximum memory allocation:</string>
+ </property>
+ <property name="buddy">
+ <cstring>maxMemSpinBox</cstring>
</property>
</widget>
</item>
@@ -106,7 +112,10 @@
<item row="2" column="0">
<widget class="QLabel" name="labelPermGen">
<property name="text">
- <string notr="true">PermGen:</string>
+ <string notr="true">&amp;PermGen:</string>
+ </property>
+ <property name="buddy">
+ <cstring>permGenSpinBox</cstring>
</property>
</widget>
</item>
@@ -150,39 +159,13 @@
</sizepolicy>
</property>
<property name="text">
- <string>Java path:</string>
+ <string>&amp;Java path:</string>
+ </property>
+ <property name="buddy">
+ <cstring>javaPathTextBox</cstring>
</property>
</widget>
</item>
- <item row="0" column="1" colspan="2">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QLineEdit" name="javaPathTextBox"/>
- </item>
- <item>
- <widget class="QPushButton" name="javaBrowseBtn">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximumSize">
- <size>
- <width>28</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string notr="true">...</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="2" column="1" colspan="2">
- <widget class="QLineEdit" name="jvmArgsTextBox"/>
- </item>
<item row="2" column="0">
<widget class="QLabel" name="labelJVMArgs">
<property name="sizePolicy">
@@ -192,25 +175,31 @@
</sizepolicy>
</property>
<property name="text">
- <string>JVM arguments:</string>
+ <string>J&amp;VM arguments:</string>
+ </property>
+ <property name="buddy">
+ <cstring>jvmArgsTextBox</cstring>
</property>
</widget>
</item>
- <item row="3" column="1">
- <widget class="QPushButton" name="javaDetectBtn">
+ <item row="4" column="1">
+ <widget class="QCheckBox" name="skipCompatibilityCheckbox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="toolTip">
+ <string>If enabled, the launcher will not check if an instance is compatible with the selected Java version.</string>
+ </property>
<property name="text">
- <string>Auto-detect...</string>
+ <string>&amp;Skip Java compatibility checks</string>
</property>
</widget>
</item>
- <item row="3" column="2">
- <widget class="QPushButton" name="javaTestBtn">
+ <item row="3" column="1">
+ <widget class="QPushButton" name="javaDetectBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -218,23 +207,59 @@
</sizepolicy>
</property>
<property name="text">
- <string>Test</string>
+ <string>&amp;Auto-detect...</string>
</property>
</widget>
</item>
- <item row="4" column="1">
- <widget class="QCheckBox" name="skipCompatibilityCheckbox">
+ <item row="0" column="1" colspan="2">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLineEdit" name="javaPathTextBox"/>
+ </item>
+ <item>
+ <widget class="QPushButton" name="javaBrowseBtn">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>28</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string notr="true">...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="2">
+ <widget class="QPushButton" name="javaTestBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="text">
+ <string>&amp;Test</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" colspan="2">
+ <widget class="QLineEdit" name="jvmArgsTextBox"/>
+ </item>
+ <item row="5" column="1">
+ <widget class="QCheckBox" name="skipJavaWizardCheckbox">
<property name="toolTip">
- <string>If enabled, the launcher will not check if an instance is compatible with the selected Java version.</string>
+ <string>If enabled, the launcher will not prompt you to choose a Java version if one isn't found.</string>
</property>
<property name="text">
- <string>Skip Java compatibility checks</string>
+ <string>Skip Java &amp;Wizard</string>
</property>
</widget>
</item>
diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp
index 097a2bfa..af2e2cd1 100644
--- a/launcher/ui/pages/global/LauncherPage.cpp
+++ b/launcher/ui/pages/global/LauncherPage.cpp
@@ -97,13 +97,6 @@ LauncherPage::LauncherPage(QWidget *parent) : QWidget(parent), ui(new Ui::Launch
}
connect(ui->fontSizeBox, SIGNAL(valueChanged(int)), SLOT(refreshFontPreview()));
connect(ui->consoleFont, SIGNAL(currentFontChanged(QFont)), SLOT(refreshFontPreview()));
-
- //move mac data button
- QFile file(QDir::current().absolutePath() + "/dontmovemacdata");
- if (!file.exists())
- {
- ui->migrateDataFolderMacBtn->setVisible(false);
- }
}
LauncherPage::~LauncherPage()
@@ -190,13 +183,6 @@ void LauncherPage::on_modsDirBrowseBtn_clicked()
ui->modsDirTextBox->setText(cooked_dir);
}
}
-void LauncherPage::on_migrateDataFolderMacBtn_clicked()
-{
- QFile file(QDir::current().absolutePath() + "/dontmovemacdata");
- file.remove();
- QProcess::startDetached(qApp->arguments()[0]);
- qApp->quit();
-}
void LauncherPage::refreshUpdateChannelList()
{
diff --git a/launcher/ui/pages/global/LauncherPage.h b/launcher/ui/pages/global/LauncherPage.h
index 63cfe9c3..bbf5d2fe 100644
--- a/launcher/ui/pages/global/LauncherPage.h
+++ b/launcher/ui/pages/global/LauncherPage.h
@@ -88,7 +88,6 @@ slots:
void on_instDirBrowseBtn_clicked();
void on_modsDirBrowseBtn_clicked();
void on_iconsDirBrowseBtn_clicked();
- void on_migrateDataFolderMacBtn_clicked();
/*!
* Updates the list of update channels in the combo box.
diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui
index 4cc2a113..ae7eb73f 100644
--- a/launcher/ui/pages/global/LauncherPage.ui
+++ b/launcher/ui/pages/global/LauncherPage.ui
@@ -158,13 +158,6 @@
</widget>
</item>
<item>
- <widget class="QPushButton" name="migrateDataFolderMacBtn">
- <property name="text">
- <string>Move the data to new location (will restart the launcher)</string>
- </property>
- </widget>
- </item>
- <item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -196,7 +189,7 @@
<item>
<widget class="QRadioButton" name="sortLastLaunchedBtn">
<property name="text">
- <string>By &amp;last launched</string>
+ <string>&amp;By last launched</string>
</property>
<attribute name="buttonGroup">
<string notr="true">sortingModeGroup</string>
@@ -293,7 +286,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
- <string>Colors</string>
+ <string>&amp;Colors</string>
</property>
<property name="buddy">
<cstring>themeComboBoxColors</cstring>
@@ -334,7 +327,7 @@
<string>The menubar is more friendly for keyboard-driven interaction.</string>
</property>
<property name="text">
- <string>Replace toolbar with menubar</string>
+ <string>&amp;Replace toolbar with menubar</string>
</property>
</widget>
</item>
@@ -370,21 +363,21 @@
<item>
<widget class="QCheckBox" name="showConsoleCheck">
<property name="text">
- <string>Show console while the game is running?</string>
+ <string>Show console while the game is &amp;running?</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="autoCloseConsoleCheck">
<property name="text">
- <string>Automatically close console when the game quits?</string>
+ <string>&amp;Automatically close console when the game quits?</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showConsoleErrorCheck">
<property name="text">
- <string>Show console when the game crashes?</string>
+ <string>Show console when the game &amp;crashes?</string>
</property>
</widget>
</item>
@@ -394,13 +387,13 @@
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
- <string>History limit</string>
+ <string>&amp;History limit</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0">
<widget class="QCheckBox" name="checkStopLogging">
<property name="text">
- <string>Stop logging when log overflows</string>
+ <string>&amp;Stop logging when log overflows</string>
</property>
</widget>
</item>
@@ -441,7 +434,7 @@
</sizepolicy>
</property>
<property name="title">
- <string>Console font</string>
+ <string>Console &amp;font</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0" colspan="2">
diff --git a/launcher/ui/pages/global/MinecraftPage.ui b/launcher/ui/pages/global/MinecraftPage.ui
index c18ab34b..353390bd 100644
--- a/launcher/ui/pages/global/MinecraftPage.ui
+++ b/launcher/ui/pages/global/MinecraftPage.ui
@@ -51,7 +51,7 @@
<item>
<widget class="QCheckBox" name="maximizedCheckBox">
<property name="text">
- <string>Start Minecraft maximized?</string>
+ <string>Start Minecraft &amp;maximized?</string>
</property>
</widget>
</item>
@@ -60,7 +60,7 @@
<item row="1" column="0">
<widget class="QLabel" name="labelWindowHeight">
<property name="text">
- <string>Window hei&amp;ght:</string>
+ <string>Window &amp;height:</string>
</property>
<property name="buddy">
<cstring>windowHeightSpinBox</cstring>
@@ -70,7 +70,7 @@
<item row="0" column="0">
<widget class="QLabel" name="labelWindowWidth">
<property name="text">
- <string>W&amp;indow width:</string>
+ <string>Window &amp;width:</string>
</property>
<property name="buddy">
<cstring>windowWidthSpinBox</cstring>
@@ -120,14 +120,14 @@
<item>
<widget class="QCheckBox" name="useNativeGLFWCheck">
<property name="text">
- <string>Use system installation of GLFW</string>
+ <string>Use system installation of &amp;GLFW</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="useNativeOpenALCheck">
<property name="text">
- <string>Use system installation of OpenAL</string>
+ <string>Use system installation of &amp;OpenAL</string>
</property>
</widget>
</item>
@@ -143,21 +143,21 @@
<item>
<widget class="QCheckBox" name="showGameTime">
<property name="text">
- <string>Show time spent playing instances</string>
+ <string>Show time spent &amp;playing instances</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showGlobalGameTime">
<property name="text">
- <string>Show time spent playing across all instances</string>
+ <string>Show time spent playing across &amp;all instances</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="recordGameTime">
<property name="text">
- <string>Record time spent playing instances</string>
+ <string>&amp;Record time spent playing instances</string>
</property>
</widget>
</item>
@@ -176,7 +176,7 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The launcher will automatically reopen when the game crashes or exits.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
- <string>Close the launcher after game window opens</string>
+ <string>&amp;Close the launcher after game window opens</string>
</property>
</widget>
</item>
@@ -186,7 +186,7 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The launcher will automatically quit after the game exits or crashes.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
- <string>Quit the launcher after game window closes</string>
+ <string>&amp;Quit the launcher after game window closes</string>
</property>
</widget>
</item>
diff --git a/launcher/ui/pages/global/ProxyPage.ui b/launcher/ui/pages/global/ProxyPage.ui
index 347fa86c..91ba46b3 100644
--- a/launcher/ui/pages/global/ProxyPage.ui
+++ b/launcher/ui/pages/global/ProxyPage.ui
@@ -81,7 +81,7 @@
<item>
<widget class="QRadioButton" name="proxySOCKS5Btn">
<property name="text">
- <string>SOC&amp;KS5</string>
+ <string>&amp;SOCKS5</string>
</property>
<attribute name="buttonGroup">
<string notr="true">proxyGroup</string>
@@ -91,7 +91,7 @@
<item>
<widget class="QRadioButton" name="proxyHTTPBtn">
<property name="text">
- <string>H&amp;TTP</string>
+ <string>&amp;HTTP</string>
</property>
<attribute name="buttonGroup">
<string notr="true">proxyGroup</string>
@@ -104,7 +104,7 @@
<item>
<widget class="QGroupBox" name="proxyAddrBox">
<property name="title">
- <string>Address and Port</string>
+ <string>&amp;Address and Port</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
@@ -145,14 +145,20 @@
<item row="0" column="0">
<widget class="QLabel" name="proxyUsernameLabel">
<property name="text">
- <string>Username:</string>
+ <string>&amp;Username:</string>
+ </property>
+ <property name="buddy">
+ <cstring>proxyUserEdit</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="proxyPasswordLabel">
<property name="text">
- <string>Password:</string>
+ <string>&amp;Password:</string>
+ </property>
+ <property name="buddy">
+ <cstring>proxyPassEdit</cstring>
</property>
</widget>
</item>
diff --git a/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp b/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp
index ac3869dc..26aa60af 100644
--- a/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp
+++ b/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp
@@ -1,30 +1,56 @@
+// SPDX-License-Identifier: GPL-3.0-only
/*
- * Copyright 2021 Jamie Mansfield <jmansfield@cadixdev.org>
+ * PolyMC - Minecraft Launcher
+ * Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * 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.
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * 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.
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * This file incorporates work covered by the following copyright and
+ * permission notice:
+ *
+ * Copyright 2021 Jamie Mansfield <jmansfield@cadixdev.org>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
#include "AtlOptionalModDialog.h"
#include "ui_AtlOptionalModDialog.h"
+#include <QInputDialog>
+#include <QMessageBox>
+#include "BuildConfig.h"
+#include "Json.h"
+#include "modplatform/atlauncher/ATLShareCode.h"
+#include "Application.h"
+
AtlOptionalModListModel::AtlOptionalModListModel(QWidget *parent, QVector<ATLauncher::VersionMod> mods)
: QAbstractListModel(parent), m_mods(mods) {
-
// fill mod index
for (int i = 0; i < m_mods.size(); i++) {
auto mod = m_mods.at(i);
m_index[mod.name] = i;
}
+
// set initial state
for (int i = 0; i < m_mods.size(); i++) {
auto mod = m_mods.at(i);
@@ -77,7 +103,7 @@ QVariant AtlOptionalModListModel::data(const QModelIndex &index, int role) const
}
}
- return QVariant();
+ return {};
}
bool AtlOptionalModListModel::setData(const QModelIndex &index, const QVariant &value, int role) {
@@ -104,7 +130,7 @@ QVariant AtlOptionalModListModel::headerData(int section, Qt::Orientation orient
}
}
- return QVariant();
+ return {};
}
Qt::ItemFlags AtlOptionalModListModel::flags(const QModelIndex &index) const {
@@ -115,6 +141,69 @@ Qt::ItemFlags AtlOptionalModListModel::flags(const QModelIndex &index) const {
return flags;
}
+void AtlOptionalModListModel::useShareCode(const QString& code) {
+ m_jobPtr.reset(new NetJob("Atl::Request", APPLICATION->network()));
+ auto url = QString(BuildConfig.ATL_API_BASE_URL + "share-codes/" + code);
+ m_jobPtr->addNetAction(Net::Download::makeByteArray(QUrl(url), &m_response));
+
+ connect(m_jobPtr.get(), &NetJob::succeeded,
+ this, &AtlOptionalModListModel::shareCodeSuccess);
+ connect(m_jobPtr.get(), &NetJob::failed,
+ this, &AtlOptionalModListModel::shareCodeFailure);
+
+ m_jobPtr->start();
+}
+
+void AtlOptionalModListModel::shareCodeSuccess() {
+ m_jobPtr.reset();
+
+ QJsonParseError parse_error {};
+ auto doc = QJsonDocument::fromJson(m_response, &parse_error);
+ if (parse_error.error != QJsonParseError::NoError) {
+ qWarning() << "Error while parsing JSON response from ATL at " << parse_error.offset << " reason: " << parse_error.errorString();
+ qWarning() << m_response;
+ return;
+ }
+ auto obj = doc.object();
+
+ ATLauncher::ShareCodeResponse response;
+ try {
+ ATLauncher::loadShareCodeResponse(response, obj);
+ }
+ catch (const JSONValidationError& e) {
+ qDebug() << QString::fromUtf8(m_response);
+ qWarning() << "Error while reading response from ATLauncher: " << e.cause();
+ return;
+ }
+
+ if (response.error) {
+ // fixme: plumb in an error message
+ qWarning() << "ATLauncher API Response Error" << response.message;
+ return;
+ }
+
+ // FIXME: verify pack and version, error if not matching.
+
+ // Clear the current selection
+ for (const auto& mod : m_mods) {
+ m_selection[mod.name] = false;
+ }
+
+ // Make the selections, as per the share code.
+ for (const auto& mod : response.data.mods) {
+ m_selection[mod.name] = mod.selected;
+ }
+
+ emit dataChanged(AtlOptionalModListModel::index(0, EnabledColumn),
+ AtlOptionalModListModel::index(m_mods.size() - 1, EnabledColumn));
+}
+
+void AtlOptionalModListModel::shareCodeFailure(const QString& reason) {
+ m_jobPtr.reset();
+
+ // fixme: plumb in an error message
+}
+
void AtlOptionalModListModel::selectRecommended() {
for (const auto& mod : m_mods) {
m_selection[mod.name] = mod.recommended;
@@ -212,14 +301,43 @@ AtlOptionalModDialog::AtlOptionalModDialog(QWidget *parent, QVector<ATLauncher::
ui->treeView->header()->setSectionResizeMode(
AtlOptionalModListModel::DescriptionColumn, QHeaderView::Stretch);
- connect(ui->selectRecommendedButton, &QPushButton::pressed,
+ connect(ui->shareCodeButton, &QPushButton::clicked,
+ this, &AtlOptionalModDialog::useShareCode);
+ connect(ui->selectRecommendedButton, &QPushButton::clicked,
listModel, &AtlOptionalModListModel::selectRecommended);
- connect(ui->clearAllButton, &QPushButton::pressed,
+ connect(ui->clearAllButton, &QPushButton::clicked,
listModel, &AtlOptionalModListModel::clearAll);
- connect(ui->installButton, &QPushButton::pressed,
+ connect(ui->installButton, &QPushButton::clicked,
this, &QDialog::close);
}
AtlOptionalModDialog::~AtlOptionalModDialog() {
delete ui;
}
+
+void AtlOptionalModDialog::useShareCode() {
+ bool ok;
+ auto shareCode = QInputDialog::getText(
+ this,
+ tr("Select a share code"),
+ tr("Share code:"),
+ QLineEdit::Normal,
+ "",
+ &ok
+ );
+
+ if (!ok) {
+ // If the user cancels the dialog, we don't need to show any error dialogs.
+ return;
+ }
+
+ if (shareCode.isEmpty()) {
+ QMessageBox box;
+ box.setIcon(QMessageBox::Warning);
+ box.setText(tr("No share code specified!"));
+ box.exec();
+ return;
+ }
+
+ listModel->useShareCode(shareCode);
+}
diff --git a/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.h b/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.h
index 9832014c..953b288e 100644
--- a/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.h
+++ b/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.h
@@ -1,17 +1,36 @@
+// SPDX-License-Identifier: GPL-3.0-only
/*
- * Copyright 2021 Jamie Mansfield <jmansfield@cadixdev.org>
+ * PolyMC - Minecraft Launcher
+ * Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * 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.
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * 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.
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * This file incorporates work covered by the following copyright and
+ * permission notice:
+ *
+ * Copyright 2021 Jamie Mansfield <jmansfield@cadixdev.org>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
#pragma once
@@ -20,6 +39,7 @@
#include <QAbstractListModel>
#include "modplatform/atlauncher/ATLPackIndex.h"
+#include "net/NetJob.h"
namespace Ui {
class AtlOptionalModDialog;
@@ -49,7 +69,12 @@ public:
Qt::ItemFlags flags(const QModelIndex &index) const override;
+ void useShareCode(const QString& code);
+
public slots:
+ void shareCodeSuccess();
+ void shareCodeFailure(const QString& reason);
+
void selectRecommended();
void clearAll();
@@ -58,6 +83,9 @@ private:
void setMod(ATLauncher::VersionMod mod, int index, bool enable, bool shouldEmit = true);
private:
+ NetJob::Ptr m_jobPtr;
+ QByteArray m_response;
+
QVector<ATLauncher::VersionMod> m_mods;
QMap<QString, bool> m_selection;
QMap<QString, int> m_index;
@@ -75,6 +103,8 @@ public:
return listModel->getResult();
}
+ void useShareCode();
+
private:
Ui::AtlOptionalModDialog *ui;
diff --git a/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.ui b/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.ui
index 4c5c2ec5..d9496142 100644
--- a/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.ui
+++ b/launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.ui
@@ -24,23 +24,23 @@
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QPushButton" name="selectRecommendedButton">
- <property name="text">
- <string>Select Recommended</string>
- </property>
- </widget>
- </item>
<item row="1" column="0">
<widget class="QPushButton" name="shareCodeButton">
<property name="enabled">
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="text">
<string>Use Share Code</string>
</property>
</widget>
</item>
+ <item row="1" column="1">
+ <widget class="QPushButton" name="selectRecommendedButton">
+ <property name="text">
+ <string>Select Recommended</string>
+ </property>
+ </widget>
+ </item>
<item row="1" column="2">
<widget class="QPushButton" name="clearAllButton">
<property name="text">
diff --git a/launcher/ui/widgets/CustomCommands.ui b/launcher/ui/widgets/CustomCommands.ui
index 650a9cc1..4a39ff7f 100644
--- a/launcher/ui/widgets/CustomCommands.ui
+++ b/launcher/ui/widgets/CustomCommands.ui
@@ -29,7 +29,7 @@
<bool>true</bool>
</property>
<property name="title">
- <string>Cus&amp;tom Commands</string>
+ <string>&amp;Custom Commands</string>
</property>
<property name="checkable">
<bool>true</bool>
@@ -41,7 +41,10 @@
<item row="2" column="0">
<widget class="QLabel" name="labelPostExitCmd">
<property name="text">
- <string>Post-exit command:</string>
+ <string>P&amp;ost-exit command:</string>
+ </property>
+ <property name="buddy">
+ <cstring>postExitCmdTextBox</cstring>
</property>
</widget>
</item>
@@ -51,7 +54,10 @@
<item row="0" column="0">
<widget class="QLabel" name="labelPreLaunchCmd">
<property name="text">
- <string>Pre-launch command:</string>
+ <string>&amp;Pre-launch command:</string>
+ </property>
+ <property name="buddy">
+ <cstring>preLaunchCmdTextBox</cstring>
</property>
</widget>
</item>
@@ -61,7 +67,10 @@
<item row="1" column="0">
<widget class="QLabel" name="labelWrapperCmd">
<property name="text">
- <string>Wrapper command:</string>
+ <string>&amp;Wrapper command:</string>
+ </property>
+ <property name="buddy">
+ <cstring>wrapperCmdTextBox</cstring>
</property>
</widget>
</item>
diff --git a/libraries/iconfix/CMakeLists.txt b/libraries/iconfix/CMakeLists.txt
index 08441203..97a59129 100644
--- a/libraries/iconfix/CMakeLists.txt
+++ b/libraries/iconfix/CMakeLists.txt
@@ -12,7 +12,7 @@ internal/qiconloader.cpp
internal/qiconloader_p.h
)
-add_library(Launcher_iconfix ${ICONFIX_SOURCES})
+add_library(Launcher_iconfix STATIC ${ICONFIX_SOURCES})
target_include_directories(Launcher_iconfix PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}" )
target_link_libraries(Launcher_iconfix Qt5::Core Qt5::Widgets)
diff --git a/libraries/launcher/org/multimc/EntryPoint.java b/libraries/launcher/org/multimc/EntryPoint.java
index 0f904f5f..b626d095 100644
--- a/libraries/launcher/org/multimc/EntryPoint.java
+++ b/libraries/launcher/org/multimc/EntryPoint.java
@@ -16,136 +16,123 @@ package org.multimc;/*
import org.multimc.onesix.OneSixLauncher;
-import java.io.*;
-import java.nio.charset.Charset;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+import java.util.logging.Level;
+import java.util.logging.Logger;
public class EntryPoint
{
- private enum Action
- {
- Proceed,
- Launch,
- Abort
- }
+
+ private static final Logger LOGGER = Logger.getLogger("EntryPoint");
+
+ private final ParamBucket params = new ParamBucket();
+
+ private org.multimc.Launcher launcher;
public static void main(String[] args)
{
EntryPoint listener = new EntryPoint();
+
int retCode = listener.listen();
+
if (retCode != 0)
{
- System.out.println("Exiting with " + retCode);
+ LOGGER.info("Exiting with " + retCode);
+
System.exit(retCode);
}
}
private Action parseLine(String inData) throws ParseException
{
- String[] pair = inData.split(" ", 2);
+ String[] tokens = inData.split("\\s+", 2);
- if(pair.length == 1)
- {
- String command = pair[0];
- if (pair[0].equals("launch"))
+ if (tokens.length == 0)
+ throw new ParseException("Unexpected empty string!");
+
+ switch (tokens[0]) {
+ case "launch": {
return Action.Launch;
+ }
- else if (pair[0].equals("abort"))
+ case "abort": {
return Action.Abort;
+ }
- else throw new ParseException("Error while parsing:" + pair[0]);
- }
+ case "launcher": {
+ if (tokens.length != 2)
+ throw new ParseException("Expected 2 tokens, got " + tokens.length);
- if(pair.length != 2)
- throw new ParseException("Pair length is not 2.");
+ if (tokens[1].equals("onesix")) {
+ launcher = new OneSixLauncher();
- String command = pair[0];
- String param = pair[1];
+ LOGGER.info("Using onesix launcher.");
+
+ return Action.Proceed;
+ } else {
+ throw new ParseException("Invalid launcher type: " + tokens[1]);
+ }
+ }
+
+ default: {
+ if (tokens.length != 2)
+ throw new ParseException("Error while parsing:" + inData);
+
+ params.add(tokens[0], tokens[1]);
- if(command.equals("launcher"))
- {
- if(param.equals("onesix"))
- {
- m_launcher = new OneSixLauncher();
- Utils.log("Using onesix launcher.");
- Utils.log();
return Action.Proceed;
}
- else
- throw new ParseException("Invalid launcher type: " + param);
}
-
- m_params.add(command, param);
- //System.out.println(command + " : " + param);
- return Action.Proceed;
}
public int listen()
{
- BufferedReader buffer;
- try
- {
- buffer = new BufferedReader(new InputStreamReader(System.in, "UTF-8"));
- } catch (UnsupportedEncodingException e)
- {
- System.err.println("For some reason, your java does not support UTF-8. Consider living in the current century.");
- e.printStackTrace();
- return 1;
- }
- boolean isListening = true;
- boolean isAborted = false;
- // Main loop
- while (isListening)
- {
- String inData;
- try
- {
- // Read from the pipe one line at a time
- inData = buffer.readLine();
- if (inData != null)
- {
- Action a = parseLine(inData);
- if(a == Action.Abort)
- {
- isListening = false;
- isAborted = true;
- }
- if(a == Action.Launch)
- {
- isListening = false;
- }
- }
- else
- {
- isListening = false;
- isAborted = true;
+ Action action = Action.Proceed;
+
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(
+ System.in,
+ StandardCharsets.UTF_8
+ ))) {
+ String line;
+
+ while (action == Action.Proceed) {
+ if ((line = reader.readLine()) != null) {
+ action = parseLine(line);
+ } else {
+ action = Action.Abort;
}
}
- catch (IOException e)
- {
- System.err.println("Launcher ABORT due to IO exception:");
- e.printStackTrace();
- return 1;
- }
- catch (ParseException e)
- {
- System.err.println("Launcher ABORT due to PARSE exception:");
- e.printStackTrace();
- return 1;
- }
+ } catch (IOException | ParseException e) {
+ LOGGER.log(Level.SEVERE, "Launcher ABORT due to exception:", e);
+
+ return 1;
}
- if(isAborted)
+
+ // Main loop
+ if (action == Action.Abort)
{
- System.err.println("Launch aborted by the launcher.");
+ LOGGER.info("Launch aborted by the launcher.");
+
return 1;
}
- if(m_launcher != null)
+
+ if (launcher != null)
{
- return m_launcher.launch(m_params);
+ return launcher.launch(params);
}
- System.err.println("No valid launcher implementation specified.");
+
+ LOGGER.log(Level.SEVERE, "No valid launcher implementation specified.");
+
return 1;
}
- private ParamBucket m_params = new ParamBucket();
- private org.multimc.Launcher m_launcher;
+ private enum Action {
+ Proceed,
+ Launch,
+ Abort
+ }
+
}
diff --git a/libraries/launcher/org/multimc/Launcher.java b/libraries/launcher/org/multimc/Launcher.java
index d8cb6d1b..c5e8fbc1 100644
--- a/libraries/launcher/org/multimc/Launcher.java
+++ b/libraries/launcher/org/multimc/Launcher.java
@@ -18,5 +18,5 @@ package org.multimc;
public interface Launcher
{
- abstract int launch(ParamBucket params);
+ int launch(ParamBucket params);
}
diff --git a/libraries/launcher/org/multimc/ParamBucket.java b/libraries/launcher/org/multimc/ParamBucket.java
index 2fde1329..8ff03ddc 100644
--- a/libraries/launcher/org/multimc/ParamBucket.java
+++ b/libraries/launcher/org/multimc/ParamBucket.java
@@ -19,62 +19,62 @@ package org.multimc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
+import java.util.Map;
public class ParamBucket
{
+
+ private final Map<String, List<String>> paramsMap = new HashMap<>();
+
public void add(String key, String value)
{
- List<String> coll = null;
- if(!m_params.containsKey(key))
- {
- coll = new ArrayList<String>();
- m_params.put(key, coll);
- }
- else
- {
- coll = m_params.get(key);
- }
- coll.add(value);
+ paramsMap.computeIfAbsent(key, k -> new ArrayList<>())
+ .add(value);
}
public List<String> all(String key) throws NotFoundException
{
- if(!m_params.containsKey(key))
+ List<String> params = paramsMap.get(key);
+
+ if (params == null)
throw new NotFoundException();
- return m_params.get(key);
+
+ return params;
}
public List<String> allSafe(String key, List<String> def)
{
- if(!m_params.containsKey(key) || m_params.get(key).size() < 1)
- {
+ List<String> params = paramsMap.get(key);
+
+ if (params == null || params.isEmpty())
return def;
- }
- return m_params.get(key);
+
+ return params;
}
public List<String> allSafe(String key)
{
- return allSafe(key, new ArrayList<String>());
+ return allSafe(key, new ArrayList<>());
}
public String first(String key) throws NotFoundException
{
List<String> list = all(key);
- if(list.size() < 1)
- {
+
+ if (list.isEmpty())
throw new NotFoundException();
- }
+
return list.get(0);
}
public String firstSafe(String key, String def)
{
- if(!m_params.containsKey(key) || m_params.get(key).size() < 1)
- {
+ List<String> params = paramsMap.get(key);
+
+ if (params == null || params.isEmpty())
return def;
- }
- return m_params.get(key).get(0);
+
+ return params.get(0);
}
public String firstSafe(String key)
@@ -82,5 +82,4 @@ public class ParamBucket
return firstSafe(key, "");
}
- private HashMap<String, List<String>> m_params = new HashMap<String, List<String>>();
}
diff --git a/libraries/launcher/org/multimc/Utils.java b/libraries/launcher/org/multimc/Utils.java
index 353af7d3..e48029c2 100644
--- a/libraries/launcher/org/multimc/Utils.java
+++ b/libraries/launcher/org/multimc/Utils.java
@@ -16,21 +16,10 @@
package org.multimc;
-import java.io.*;
import java.io.File;
import java.lang.reflect.Field;
-import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.*;
-import java.util.Arrays;
-import java.util.Enumeration;
import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
public class Utils
{
@@ -93,27 +82,5 @@ public class Utils
return null;
}
- /**
- * Log to the launcher console
- *
- * @param message A String containing the message
- * @param level A String containing the level name. See MinecraftLauncher::getLevel()
- */
- public static void log(String message, String level)
- {
- // Kinda dirty
- String tag = "!![" + level + "]!";
- System.out.println(tag + message.replace("\n", "\n" + tag));
- }
-
- public static void log(String message)
- {
- log(message, "Launcher");
- }
-
- public static void log()
- {
- System.out.println();
- }
}
diff --git a/libraries/launcher/org/multimc/onesix/OneSixLauncher.java b/libraries/launcher/org/multimc/onesix/OneSixLauncher.java
index ea445995..0058bd43 100644
--- a/libraries/launcher/org/multimc/onesix/OneSixLauncher.java
+++ b/libraries/launcher/org/multimc/onesix/OneSixLauncher.java
@@ -19,14 +19,18 @@ import org.multimc.*;
import java.applet.Applet;
import java.io.File;
-import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
public class OneSixLauncher implements Launcher
{
+
+ private static final Logger LOGGER = Logger.getLogger("OneSixLauncher");
+
// parameters, separated from ParamBucket
private List<String> libraries;
private List<String> mcparams;
@@ -104,7 +108,7 @@ public class OneSixLauncher implements Launcher
if (f == null)
{
- System.err.println("Could not find Minecraft path field.");
+ LOGGER.warning("Could not find Minecraft path field.");
}
else
{
@@ -113,8 +117,12 @@ public class OneSixLauncher implements Launcher
}
} catch (Exception e)
{
- System.err.println("Could not set base folder. Failed to find/access Minecraft main class:");
- e.printStackTrace(System.err);
+ LOGGER.log(
+ Level.SEVERE,
+ "Could not set base folder. Failed to find/access Minecraft main class:",
+ e
+ );
+
return -1;
}
@@ -122,7 +130,7 @@ public class OneSixLauncher implements Launcher
if(!traits.contains("noapplet"))
{
- Utils.log("Launching with applet wrapper...");
+ LOGGER.info("Launching with applet wrapper...");
try
{
Class<?> MCAppletClass = cl.loadClass(appletClass);
@@ -132,10 +140,9 @@ public class OneSixLauncher implements Launcher
return 0;
} catch (Exception e)
{
- Utils.log("Applet wrapper failed:", "Error");
- e.printStackTrace(System.err);
- Utils.log();
- Utils.log("Falling back to using main class.");
+ LOGGER.log(Level.SEVERE, "Applet wrapper failed:", e);
+
+ LOGGER.warning("Falling back to using main class.");
}
}
@@ -147,8 +154,8 @@ public class OneSixLauncher implements Launcher
return 0;
} catch (Exception e)
{
- Utils.log("Failed to invoke the Minecraft main class:", "Fatal");
- e.printStackTrace(System.err);
+ LOGGER.log(Level.SEVERE, "Failed to invoke the Minecraft main class:", e);
+
return -1;
}
}
@@ -185,8 +192,8 @@ public class OneSixLauncher implements Launcher
mc = cl.loadClass(mainClass);
} catch (ClassNotFoundException e)
{
- System.err.println("Failed to find Minecraft main class:");
- e.printStackTrace(System.err);
+ LOGGER.log(Level.SEVERE, "Failed to find Minecraft main class:", e);
+
return -1;
}
@@ -197,8 +204,8 @@ public class OneSixLauncher implements Launcher
meth = mc.getMethod("main", String[].class);
} catch (NoSuchMethodException e)
{
- System.err.println("Failed to acquire the main method:");
- e.printStackTrace(System.err);
+ LOGGER.log(Level.SEVERE, "Failed to acquire the main method:", e);
+
return -1;
}
@@ -210,8 +217,8 @@ public class OneSixLauncher implements Launcher
meth.invoke(null, (Object) paramsArray);
} catch (Exception e)
{
- System.err.println("Failed to start Minecraft:");
- e.printStackTrace(System.err);
+ LOGGER.log(Level.SEVERE, "Failed to start Minecraft:", e);
+
return -1;
}
return 0;
@@ -226,8 +233,8 @@ public class OneSixLauncher implements Launcher
processParams(params);
} catch (NotFoundException e)
{
- System.err.println("Not enough arguments.");
- e.printStackTrace(System.err);
+ LOGGER.log(Level.SEVERE, "Not enough arguments!");
+
return -1;
}
@@ -245,4 +252,5 @@ public class OneSixLauncher implements Launcher
return launchWithMainClass();
}
}
+
}
diff --git a/program_info/genicons.sh b/program_info/genicons.sh
index b553edb5..313bdb53 100755
--- a/program_info/genicons.sh
+++ b/program_info/genicons.sh
@@ -1,5 +1,7 @@
#/bin/bash
+# ICO
+
inkscape -w 16 -h 16 -o polymc_16.png org.polymc.PolyMC.svg
inkscape -w 24 -h 24 -o polymc_24.png org.polymc.PolyMC.svg
inkscape -w 32 -h 32 -o polymc_32.png org.polymc.PolyMC.svg
@@ -9,11 +11,24 @@ inkscape -w 128 -h 128 -o polymc_128.png org.polymc.PolyMC.svg
convert polymc_128.png polymc_64.png polymc_48.png polymc_32.png polymc_24.png polymc_16.png polymc.ico
-inkscape -w 256 -h 256 -o polymc_256.png org.polymc.PolyMC.svg
-inkscape -w 512 -h 512 -o polymc_512.png org.polymc.PolyMC.svg
-inkscape -w 1024 -h 1024 -o polymc_1024.png org.polymc.PolyMC.svg
+rm -f polymc_*.png
+
+inkscape -w 1024 -h 1024 -o polymc_1024.png org.polymc.PolyMC.bigsur.svg
+
+mkdir polymc.iconset
+
+sips -z 16 16 polymc_1024.png --out polymc.iconset/icon_16x16.png
+sips -z 32 32 polymc_1024.png --out polymc.iconset/icon_16x16@2x.png
+sips -z 32 32 polymc_1024.png --out polymc.iconset/icon_32x32.png
+sips -z 64 64 polymc_1024.png --out polymc.iconset/icon_32x32@2x.png
+sips -z 128 128 polymc_1024.png --out polymc.iconset/icon_128x128.png
+sips -z 256 256 polymc_1024.png --out polymc.iconset/icon_128x128@2x.png
+sips -z 256 256 polymc_1024.png --out polymc.iconset/icon_256x256.png
+sips -z 512 512 polymc_1024.png --out polymc.iconset/icon_256x256@2x.png
+sips -z 512 512 polymc_1024.png --out polymc.iconset/icon_512x512.png
+cp polymc_1024.png polymc.iconset/icon_512x512@2x.png
-png2icns polymc.icns polymc_1024.png polymc_512.png polymc_256.png polymc_128.png polymc_32.png polymc_16.png
+iconutil -c icns polymc.iconset
rm -f polymc_*.png
rm -rf polymc.iconset
diff --git a/program_info/org.polymc.PolyMC.bigsur.svg b/program_info/org.polymc.PolyMC.bigsur.svg
new file mode 100644
index 00000000..1d680032
--- /dev/null
+++ b/program_info/org.polymc.PolyMC.bigsur.svg
@@ -0,0 +1,32 @@
+<svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g filter="url(#filter0_d_68_227)">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M924 356.627C924 346.845 924.004 337.062 923.944 327.279C923.895 319.038 923.8 310.799 923.576 302.562C923.092 284.609 922.033 266.502 918.84 248.749C915.602 230.741 910.314 213.98 901.981 197.617C893.789 181.534 883.088 166.817 870.32 154.058C857.555 141.299 842.834 130.605 826.746 122.418C810.366 114.083 793.587 108.797 775.558 105.56C757.803 102.372 739.691 101.315 721.738 100.83C713.495 100.607 705.253 100.513 697.008 100.462C687.22 100.402 677.432 100.407 667.644 100.407L553.997 100H468.997L357.361 100.407C347.554 100.407 337.747 100.402 327.94 100.462C319.678 100.513 311.42 100.607 303.161 100.83C285.167 101.315 267.014 102.373 249.217 105.565C231.164 108.801 214.36 114.085 197.958 122.414C181.835 130.602 167.083 141.297 154.291 154.058C141.501 166.816 130.78 181.53 122.573 197.61C114.217 213.981 108.919 230.752 105.673 248.77C102.477 266.516 101.418 284.617 100.931 302.562C100.709 310.8 100.613 319.039 100.563 327.279C100.503 337.063 100 349.216 100 358.999L100.003 469.089L100 554.998L100.508 667.427C100.508 677.223 100.504 687.019 100.563 696.815C100.613 705.067 100.709 713.317 100.932 721.566C101.418 739.542 102.479 757.675 105.678 775.452C108.923 793.484 114.22 810.269 122.569 826.653C130.777 842.759 141.5 857.495 154.291 870.272C167.082 883.049 181.83 893.757 197.95 901.956C214.362 910.302 231.174 915.595 249.238 918.836C267.027 922.029 285.174 923.088 303.161 923.573C311.42 923.796 319.679 923.891 327.941 923.941C337.748 924.001 347.554 923.997 357.361 923.997L470.006 924H555.217L667.644 923.996C677.432 923.996 687.22 924.001 697.008 923.941C705.253 923.891 713.495 923.796 721.738 923.573C739.698 923.087 757.816 922.027 775.579 918.832C793.597 915.591 810.368 910.3 826.739 901.959C842.831 893.761 857.554 883.051 870.32 870.272C883.086 857.497 893.786 842.763 901.978 826.66C910.316 810.268 915.604 793.475 918.844 775.431C922.034 757.661 923.092 739.535 923.577 721.566C923.8 713.316 923.895 705.066 923.944 696.815C924.005 687.019 924 677.223 924 667.427C924 667.427 923.994 556.983 923.994 554.998V468.999C923.994 467.533 924 356.627 924 356.627Z" fill="url(#paint0_linear_68_227)"/>
+</g>
+<path d="M338.18 779.507C338.18 779.507 338.18 653.214 512.004 653.214C685.874 653.214 685.827 779.507 685.827 779.507H338.18Z" fill="#765338"/>
+<path d="M512.007 653.221L338.183 779.514L230.752 448.878L512.007 653.221Z" fill="#B7835A"/>
+<path d="M512.007 653.221L793.263 448.878L685.831 779.514L512.007 653.221Z" fill="#5B422D"/>
+<path d="M524.909 662.576L512.005 671.951L499.101 662.576C499.101 653.201 512.005 653.201 512.005 653.201C512.005 653.201 524.909 653.201 524.909 662.576Z" fill="#72B147"/>
+<path d="M512.007 653.221C512.007 653.221 512.007 448.878 793.263 448.878L785.288 473.423L752.741 515.819L720.194 520.716L687.647 563.113L655.1 568.009L622.553 610.406L590.006 615.302L557.459 657.699L524.912 662.595L512.007 653.221Z" fill="#5A9A30"/>
+<path d="M499.102 662.576L466.555 657.679L434.008 615.283L401.461 610.386L368.914 567.99L336.367 563.093L303.82 520.697L271.273 515.8L238.726 473.403L230.751 448.859C512.007 448.859 512.007 653.202 512.007 653.202L499.102 662.576Z" fill="#88B858"/>
+<path d="M230.75 448.861L512.006 653.204L793.262 448.861L512.006 244.518L230.75 448.861Z" fill="url(#paint1_linear_68_227)"/>
+<defs>
+<filter id="filter0_d_68_227" x="90" y="100" width="844" height="844" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
+<feFlood flood-opacity="0" result="BackgroundImageFix"/>
+<feColorMatrix 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"/>
+<feOffset dy="10"/>
+<feGaussianBlur stdDeviation="5"/>
+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0"/>
+<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_68_227"/>
+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_68_227" result="shape"/>
+</filter>
+<linearGradient id="paint0_linear_68_227" x1="512" y1="100" x2="512" y2="924" gradientUnits="userSpaceOnUse">
+<stop stop-color="#292929"/>
+<stop offset="1" stop-color="#171717"/>
+</linearGradient>
+<linearGradient id="paint1_linear_68_227" x1="371.378" y1="346.687" x2="652.619" y2="551.034" gradientUnits="userSpaceOnUse">
+<stop stop-color="#88B858"/>
+<stop offset="0.5" stop-color="#72B147"/>
+<stop offset="1" stop-color="#5A9A30"/>
+</linearGradient>
+</defs>
+</svg>
diff --git a/program_info/polymc.icns b/program_info/polymc.icns
index 84148d1a..a090c1b0 100644
--- a/program_info/polymc.icns
+++ b/program_info/polymc.icns
Binary files differ