diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 000000000..11ddc9cfc --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,4 @@ +Checks: + - modernize-use-using + +SystemHeaders: false diff --git a/launcher/BaseInstance.cpp b/launcher/BaseInstance.cpp index 725036395..33dc3f741 100644 --- a/launcher/BaseInstance.cpp +++ b/launcher/BaseInstance.cpp @@ -388,7 +388,7 @@ QString BaseInstance::name() const QString BaseInstance::windowTitle() const { - return BuildConfig.LAUNCHER_DISPLAYNAME + ": " + name().replace(QRegularExpression("\\s+"), " "); + return BuildConfig.LAUNCHER_DISPLAYNAME + ": " + name(); } // FIXME: why is this here? move it to MinecraftInstance!!! diff --git a/launcher/BaseInstance.h b/launcher/BaseInstance.h index 47fff5957..f4ed9113c 100644 --- a/launcher/BaseInstance.h +++ b/launcher/BaseInstance.h @@ -64,7 +64,7 @@ class LaunchTask; class BaseInstance; // pointer for lazy people -typedef std::shared_ptr InstancePtr; +using InstancePtr = std::shared_ptr; /*! * \brief Base class for instances. diff --git a/launcher/BaseVersionList.h b/launcher/BaseVersionList.h index fe1550c21..231887c4e 100644 --- a/launcher/BaseVersionList.h +++ b/launcher/BaseVersionList.h @@ -51,7 +51,7 @@ class BaseVersionList : public QAbstractListModel { ArchitectureRole, SortRole }; - typedef QList RoleList; + using RoleList = QList; explicit BaseVersionList(QObject* parent = 0); diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp index 652ba2995..c7d5f85fa 100644 --- a/launcher/FileSystem.cpp +++ b/launcher/FileSystem.cpp @@ -123,26 +123,35 @@ namespace fs = ghc::filesystem; #if defined(__MINGW32__) -typedef struct _DUPLICATE_EXTENTS_DATA { +struct _DUPLICATE_EXTENTS_DATA { HANDLE FileHandle; LARGE_INTEGER SourceFileOffset; LARGE_INTEGER TargetFileOffset; LARGE_INTEGER ByteCount; -} DUPLICATE_EXTENTS_DATA, *PDUPLICATE_EXTENTS_DATA; +}; -typedef struct _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER { +using DUPLICATE_EXTENTS_DATA = _DUPLICATE_EXTENTS_DATA; +using PDUPLICATE_EXTENTS_DATA = _DUPLICATE_EXTENTS_DATA*; + +struct _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER { WORD ChecksumAlgorithm; // Checksum algorithm. e.g. CHECKSUM_TYPE_UNCHANGED, CHECKSUM_TYPE_NONE, CHECKSUM_TYPE_CRC32 WORD Reserved; // Must be 0 DWORD Flags; // FSCTL_INTEGRITY_FLAG_xxx DWORD ChecksumChunkSizeInBytes; DWORD ClusterSizeInBytes; -} FSCTL_GET_INTEGRITY_INFORMATION_BUFFER, *PFSCTL_GET_INTEGRITY_INFORMATION_BUFFER; +}; -typedef struct _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER { +using FSCTL_GET_INTEGRITY_INFORMATION_BUFFER = _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER; +using PFSCTL_GET_INTEGRITY_INFORMATION_BUFFER = _FSCTL_GET_INTEGRITY_INFORMATION_BUFFER*; + +struct _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER { WORD ChecksumAlgorithm; // Checksum algorithm. e.g. CHECKSUM_TYPE_UNCHANGED, CHECKSUM_TYPE_NONE, CHECKSUM_TYPE_CRC32 WORD Reserved; // Must be 0 DWORD Flags; // FSCTL_INTEGRITY_FLAG_xxx -} FSCTL_SET_INTEGRITY_INFORMATION_BUFFER, *PFSCTL_SET_INTEGRITY_INFORMATION_BUFFER; +}; + +using FSCTL_SET_INTEGRITY_INFORMATION_BUFFER = _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER; +using PFSCTL_SET_INTEGRITY_INFORMATION_BUFFER = _FSCTL_SET_INTEGRITY_INFORMATION_BUFFER*; #endif diff --git a/launcher/MMCZip.h b/launcher/MMCZip.h index 1c6ebe34a..45b1df0b3 100644 --- a/launcher/MMCZip.h +++ b/launcher/MMCZip.h @@ -172,7 +172,7 @@ class ExportToZipTask : public Task { void setExcludeFiles(QStringList excludeFiles) { m_exclude_files = excludeFiles; } void addExtraFile(QString fileName, QByteArray data) { m_extra_files.insert(fileName, data); } - typedef std::optional ZipResult; + using ZipResult = std::optional; protected: virtual void executeTask() override; diff --git a/launcher/VersionProxyModel.h b/launcher/VersionProxyModel.h index c7d5fd94e..57c711d58 100644 --- a/launcher/VersionProxyModel.h +++ b/launcher/VersionProxyModel.h @@ -10,7 +10,7 @@ class VersionProxyModel : public QAbstractProxyModel { Q_OBJECT public: enum Column { Name, ParentVersion, Branch, Type, Architecture, Path, Time }; - typedef QHash> FilterMap; + using FilterMap = QHash>; public: VersionProxyModel(QObject* parent = 0); diff --git a/launcher/java/JavaChecker.h b/launcher/java/JavaChecker.h index 743f49417..7111f8522 100644 --- a/launcher/java/JavaChecker.h +++ b/launcher/java/JavaChecker.h @@ -22,8 +22,8 @@ struct JavaCheckResult { enum class Validity { Errored, ReturnedInvalidData, Valid } validity = Validity::Errored; }; -typedef shared_qobject_ptr QProcessPtr; -typedef shared_qobject_ptr JavaCheckerPtr; +using QProcessPtr = shared_qobject_ptr; +using JavaCheckerPtr = shared_qobject_ptr; class JavaChecker : public QObject { Q_OBJECT public: diff --git a/launcher/java/JavaCheckerJob.h b/launcher/java/JavaCheckerJob.h index 009687917..ddf827968 100644 --- a/launcher/java/JavaCheckerJob.h +++ b/launcher/java/JavaCheckerJob.h @@ -20,7 +20,7 @@ #include "tasks/Task.h" class JavaCheckerJob; -typedef shared_qobject_ptr JavaCheckerJobPtr; +using JavaCheckerJobPtr = shared_qobject_ptr; // FIXME: this just seems horribly redundant class JavaCheckerJob : public Task { diff --git a/launcher/java/JavaInstall.h b/launcher/java/JavaInstall.h index 49e9ed06e..8c2743a00 100644 --- a/launcher/java/JavaInstall.h +++ b/launcher/java/JavaInstall.h @@ -42,4 +42,4 @@ struct JavaInstall : public BaseVersion { bool recommended = false; }; -typedef std::shared_ptr JavaInstallPtr; +using JavaInstallPtr = std::shared_ptr; diff --git a/launcher/minecraft/Agent.h b/launcher/minecraft/Agent.h index 8958521e5..bc385a74e 100644 --- a/launcher/minecraft/Agent.h +++ b/launcher/minecraft/Agent.h @@ -6,7 +6,7 @@ class Agent; -typedef std::shared_ptr AgentPtr; +using AgentPtr = std::shared_ptr; class Agent { public: diff --git a/launcher/minecraft/Component.h b/launcher/minecraft/Component.h index 3474a22e0..fdb61c45e 100644 --- a/launcher/minecraft/Component.h +++ b/launcher/minecraft/Component.h @@ -105,4 +105,4 @@ class Component : public QObject, public ProblemProvider { bool m_loaded = false; }; -typedef shared_qobject_ptr ComponentPtr; +using ComponentPtr = shared_qobject_ptr; diff --git a/launcher/minecraft/Library.h b/launcher/minecraft/Library.h index f8816a97b..adb89c4c6 100644 --- a/launcher/minecraft/Library.h +++ b/launcher/minecraft/Library.h @@ -52,7 +52,7 @@ class Library; class MinecraftInstance; -typedef std::shared_ptr LibraryPtr; +using LibraryPtr = std::shared_ptr; class Library { friend class OneSixVersionFormat; diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index 55fd864bb..a4571e626 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -710,7 +710,7 @@ QString MinecraftInstance::createLaunchScript(AuthSessionPtr session, MinecraftS { QString windowParams; if (settings()->get("LaunchMaximized").toBool()) - windowParams = "max"; + windowParams = "maximized"; else windowParams = QString("%1x%2").arg(settings()->get("MinecraftWinWidth").toInt()).arg(settings()->get("MinecraftWinHeight").toInt()); @@ -718,6 +718,19 @@ QString MinecraftInstance::createLaunchScript(AuthSessionPtr session, MinecraftS launchScript += "windowParams " + windowParams + "\n"; } + // launcher info + { + launchScript += "launcherBrand " + BuildConfig.LAUNCHER_NAME + "\n"; + launchScript += "launcherVersion " + BuildConfig.printableVersionString() + "\n"; + } + + // instance info + { + launchScript += "instanceName " + name() + "\n"; + launchScript += "instanceIconKey " + name() + "\n"; + launchScript += "instanceIconPath icon.png\n"; // we already save a copy here + } + // legacy auth if (session) { launchScript += "userName " + session->player_name + "\n"; diff --git a/launcher/minecraft/MinecraftInstance.h b/launcher/minecraft/MinecraftInstance.h index a816a3e60..b1f305201 100644 --- a/launcher/minecraft/MinecraftInstance.h +++ b/launcher/minecraft/MinecraftInstance.h @@ -174,4 +174,4 @@ class MinecraftInstance : public BaseInstance { mutable std::shared_ptr m_game_options; }; -typedef std::shared_ptr MinecraftInstancePtr; +using MinecraftInstancePtr = std::shared_ptr; diff --git a/launcher/minecraft/MojangDownloadInfo.h b/launcher/minecraft/MojangDownloadInfo.h index 855dbe005..eb64f95b7 100644 --- a/launcher/minecraft/MojangDownloadInfo.h +++ b/launcher/minecraft/MojangDownloadInfo.h @@ -5,7 +5,7 @@ struct MojangDownloadInfo { // types - typedef std::shared_ptr Ptr; + using Ptr = std::shared_ptr; // data /// Local filesystem path. WARNING: not used, only here so we can pass through mojang files unmolested! @@ -23,7 +23,7 @@ struct MojangLibraryDownloadInfo { MojangLibraryDownloadInfo() {} // types - typedef std::shared_ptr Ptr; + using Ptr = std::shared_ptr; // methods MojangDownloadInfo* getDownloadInfo(QString classifier) @@ -42,7 +42,7 @@ struct MojangLibraryDownloadInfo { struct MojangAssetIndexInfo : public MojangDownloadInfo { // types - typedef std::shared_ptr Ptr; + using Ptr = std::shared_ptr; // methods MojangAssetIndexInfo() {} diff --git a/launcher/minecraft/ProfileUtils.h b/launcher/minecraft/ProfileUtils.h index 98a7ff739..edabe0bf0 100644 --- a/launcher/minecraft/ProfileUtils.h +++ b/launcher/minecraft/ProfileUtils.h @@ -38,7 +38,7 @@ #include "VersionFile.h" namespace ProfileUtils { -typedef QStringList PatchOrder; +using PatchOrder = QStringList; /// Read and parse a OneSix format order file bool readOverrideOrders(QString path, PatchOrder& order); diff --git a/launcher/minecraft/auth/AuthSession.h b/launcher/minecraft/auth/AuthSession.h index 074b2d6e3..cec238033 100644 --- a/launcher/minecraft/auth/AuthSession.h +++ b/launcher/minecraft/auth/AuthSession.h @@ -43,4 +43,4 @@ struct AuthSession { bool demo = false; }; -typedef std::shared_ptr AuthSessionPtr; +using AuthSessionPtr = std::shared_ptr; diff --git a/launcher/minecraft/auth/MinecraftAccount.h b/launcher/minecraft/auth/MinecraftAccount.h index 910f4a28a..c4e9756a9 100644 --- a/launcher/minecraft/auth/MinecraftAccount.h +++ b/launcher/minecraft/auth/MinecraftAccount.h @@ -54,7 +54,7 @@ class Task; class AccountTask; class MinecraftAccount; -typedef shared_qobject_ptr MinecraftAccountPtr; +using MinecraftAccountPtr = shared_qobject_ptr; Q_DECLARE_METATYPE(MinecraftAccountPtr) /** diff --git a/launcher/minecraft/launch/MinecraftServerTarget.h b/launcher/minecraft/launch/MinecraftServerTarget.h index af8d6550b..2edd8a30d 100644 --- a/launcher/minecraft/launch/MinecraftServerTarget.h +++ b/launcher/minecraft/launch/MinecraftServerTarget.h @@ -26,4 +26,4 @@ struct MinecraftServerTarget { static MinecraftServerTarget parse(const QString& fullAddress); }; -typedef std::shared_ptr MinecraftServerTargetPtr; +using MinecraftServerTargetPtr = std::shared_ptr; diff --git a/launcher/modplatform/import_ftb/PackHelpers.h b/launcher/modplatform/import_ftb/PackHelpers.h index 5400252b6..221eb5bf6 100644 --- a/launcher/modplatform/import_ftb/PackHelpers.h +++ b/launcher/modplatform/import_ftb/PackHelpers.h @@ -45,7 +45,7 @@ struct Modpack { QIcon icon; }; -typedef QList ModpackList; +using ModpackList = QList; Modpack parseDirectory(QString path); diff --git a/launcher/modplatform/legacy_ftb/PackHelpers.h b/launcher/modplatform/legacy_ftb/PackHelpers.h index 4fb535530..f2d18f802 100644 --- a/launcher/modplatform/legacy_ftb/PackHelpers.h +++ b/launcher/modplatform/legacy_ftb/PackHelpers.h @@ -31,7 +31,7 @@ struct Modpack { QString packCode; }; -typedef QList ModpackList; +using ModpackList = QList; } // namespace LegacyFTB diff --git a/launcher/net/NetRequest.h b/launcher/net/NetRequest.h index 917495ed9..02da1921b 100644 --- a/launcher/net/NetRequest.h +++ b/launcher/net/NetRequest.h @@ -88,7 +88,7 @@ class NetRequest : public NetAction { std::unique_ptr m_sink; Options m_options; - typedef const QLoggingCategory& (*logCatFunc)(); + using logCatFunc = const QLoggingCategory& (*)(); logCatFunc logCat = taskUploadLogC; std::chrono::steady_clock m_clock; diff --git a/launcher/news/NewsEntry.h b/launcher/news/NewsEntry.h index 2d409a9fb..ab717ec89 100644 --- a/launcher/news/NewsEntry.h +++ b/launcher/news/NewsEntry.h @@ -51,4 +51,4 @@ class NewsEntry : public QObject { QString link; }; -typedef std::shared_ptr NewsEntryPtr; +using NewsEntryPtr = std::shared_ptr; diff --git a/launcher/pathmatcher/IPathMatcher.h b/launcher/pathmatcher/IPathMatcher.h index cd6121979..f3b01e8cf 100644 --- a/launcher/pathmatcher/IPathMatcher.h +++ b/launcher/pathmatcher/IPathMatcher.h @@ -4,7 +4,7 @@ class IPathMatcher { public: - typedef std::shared_ptr Ptr; + using Ptr = std::shared_ptr; public: virtual ~IPathMatcher() {} diff --git a/launcher/settings/SettingsObject.h b/launcher/settings/SettingsObject.h index 75631f247..f133f2f7f 100644 --- a/launcher/settings/SettingsObject.h +++ b/launcher/settings/SettingsObject.h @@ -26,8 +26,8 @@ class Setting; class SettingsObject; -typedef std::shared_ptr SettingsObjectPtr; -typedef std::weak_ptr SettingsObjectWeakPtr; +using SettingsObjectPtr = std::shared_ptr; +using SettingsObjectWeakPtr = std::weak_ptr; /*! * \brief The SettingsObject handles communicating settings between the application and a diff --git a/launcher/tasks/Task.h b/launcher/tasks/Task.h index 94b4089f3..883408c97 100644 --- a/launcher/tasks/Task.h +++ b/launcher/tasks/Task.h @@ -77,7 +77,7 @@ struct TaskStepProgress { Q_DECLARE_METATYPE(TaskStepProgress) -typedef QList> TaskStepProgressList; +using TaskStepProgressList = QList>; class Task : public QObject, public QRunnable { Q_OBJECT diff --git a/launcher/ui/dialogs/ExportInstanceDialog.h b/launcher/ui/dialogs/ExportInstanceDialog.h index 02f38f63d..183681f57 100644 --- a/launcher/ui/dialogs/ExportInstanceDialog.h +++ b/launcher/ui/dialogs/ExportInstanceDialog.h @@ -43,7 +43,7 @@ #include "FileIgnoreProxy.h" class BaseInstance; -typedef std::shared_ptr InstancePtr; +using InstancePtr = std::shared_ptr; namespace Ui { class ExportInstanceDialog; diff --git a/launcher/ui/instanceview/AccessibleInstanceView_p.h b/launcher/ui/instanceview/AccessibleInstanceView_p.h index e99f85069..1a3a62d9f 100644 --- a/launcher/ui/instanceview/AccessibleInstanceView_p.h +++ b/launcher/ui/instanceview/AccessibleInstanceView_p.h @@ -59,7 +59,7 @@ class AccessibleInstanceView : public QAccessibleTableInterface, public QAccessi protected: // maybe vector - typedef QHash ChildCache; + using ChildCache = QHash; mutable ChildCache childToId; virtual ~AccessibleInstanceView(); diff --git a/launcher/ui/pages/BasePage.h b/launcher/ui/pages/BasePage.h index d35206a08..cb3a7633d 100644 --- a/launcher/ui/pages/BasePage.h +++ b/launcher/ui/pages/BasePage.h @@ -77,4 +77,4 @@ class BasePage { bool isOpened = false; }; -typedef std::shared_ptr BasePagePtr; +using BasePagePtr = std::shared_ptr; diff --git a/launcher/ui/pages/BasePageProvider.h b/launcher/ui/pages/BasePageProvider.h index 4c3ecd6c1..422891e6b 100644 --- a/launcher/ui/pages/BasePageProvider.h +++ b/launcher/ui/pages/BasePageProvider.h @@ -26,7 +26,7 @@ class BasePageProvider { }; class GenericPageProvider : public BasePageProvider { - typedef std::function PageCreator; + using PageCreator = std::function; public: explicit GenericPageProvider(const QString& dialogTitle) : m_dialogTitle(dialogTitle) {} diff --git a/launcher/ui/pages/instance/ScreenshotsPage.cpp b/launcher/ui/pages/instance/ScreenshotsPage.cpp index 25f978cea..83fb0d5ff 100644 --- a/launcher/ui/pages/instance/ScreenshotsPage.cpp +++ b/launcher/ui/pages/instance/ScreenshotsPage.cpp @@ -68,8 +68,8 @@ #include #include "RWStorage.h" -typedef RWStorage SharedIconCache; -typedef std::shared_ptr SharedIconCachePtr; +using SharedIconCache = RWStorage; +using SharedIconCachePtr = std::shared_ptr; class ThumbnailingResult : public QObject { Q_OBJECT diff --git a/launcher/ui/pages/modplatform/atlauncher/AtlListModel.h b/launcher/ui/pages/modplatform/atlauncher/AtlListModel.h index ed1fdc9f9..bcadd7c91 100644 --- a/launcher/ui/pages/modplatform/atlauncher/AtlListModel.h +++ b/launcher/ui/pages/modplatform/atlauncher/AtlListModel.h @@ -24,8 +24,8 @@ namespace Atl { -typedef QMap LogoMap; -typedef std::function LogoCallback; +using LogoMap = QMap; +using LogoCallback = std::function; class ListModel : public QAbstractListModel { Q_OBJECT diff --git a/launcher/ui/pages/modplatform/flame/FlameModel.h b/launcher/ui/pages/modplatform/flame/FlameModel.h index fd8496dfb..5a07ef6bb 100644 --- a/launcher/ui/pages/modplatform/flame/FlameModel.h +++ b/launcher/ui/pages/modplatform/flame/FlameModel.h @@ -19,8 +19,8 @@ namespace Flame { -typedef QMap LogoMap; -typedef std::function LogoCallback; +using LogoMap = QMap; +using LogoCallback = std::function; class ListModel : public QAbstractListModel { Q_OBJECT diff --git a/launcher/ui/pages/modplatform/legacy_ftb/ListModel.h b/launcher/ui/pages/modplatform/legacy_ftb/ListModel.h index c802a4b56..f35012078 100644 --- a/launcher/ui/pages/modplatform/legacy_ftb/ListModel.h +++ b/launcher/ui/pages/modplatform/legacy_ftb/ListModel.h @@ -13,8 +13,8 @@ namespace LegacyFTB { -typedef QMap FTBLogoMap; -typedef std::function LogoCallback; +using FTBLogoMap = QMap; +using LogoCallback = std::function; class FilterModel : public QSortFilterProxyModel { Q_OBJECT diff --git a/launcher/ui/pages/modplatform/technic/TechnicModel.h b/launcher/ui/pages/modplatform/technic/TechnicModel.h index aeb4f3084..09e9294bb 100644 --- a/launcher/ui/pages/modplatform/technic/TechnicModel.h +++ b/launcher/ui/pages/modplatform/technic/TechnicModel.h @@ -42,7 +42,7 @@ namespace Technic { -typedef std::function LogoCallback; +using LogoCallback = std::function; class ListModel : public QAbstractListModel { Q_OBJECT diff --git a/launcher/ui/setupwizard/JavaWizardPage.cpp b/launcher/ui/setupwizard/JavaWizardPage.cpp index e2c444373..abe4860da 100644 --- a/launcher/ui/setupwizard/JavaWizardPage.cpp +++ b/launcher/ui/setupwizard/JavaWizardPage.cpp @@ -64,8 +64,7 @@ bool JavaWizardPage::validatePage() } case JavaSettingsWidget::ValidationStatus::AllOK: { settings->set("JavaPath", m_java_widget->javaPath()); - return true; - } + } /* fallthrough */ case JavaSettingsWidget::ValidationStatus::JavaBad: { // Memory auto s = APPLICATION->settings(); diff --git a/libraries/.clang-tidy b/libraries/.clang-tidy new file mode 100644 index 000000000..358b093b9 --- /dev/null +++ b/libraries/.clang-tidy @@ -0,0 +1,2 @@ +# We don't care about linting third-party code. +Checks: -* diff --git a/libraries/launcher/org/prismlauncher/EntryPoint.java b/libraries/launcher/org/prismlauncher/EntryPoint.java index 3ef161b40..699adfe30 100644 --- a/libraries/launcher/org/prismlauncher/EntryPoint.java +++ b/libraries/launcher/org/prismlauncher/EntryPoint.java @@ -105,13 +105,16 @@ public final class EntryPoint { return ExitCode.ABORT; } + setProperties(params); + + String launcherType = params.getString("launcher"); + try { LegacyProxy.applyOnlineFixes(params); Launcher launcher; - String type = params.getString("launcher"); - switch (type) { + switch (launcherType) { case "standard": launcher = new StandardLauncher(params); break; @@ -121,7 +124,7 @@ public final class EntryPoint { break; default: - throw new IllegalArgumentException("Invalid launcher type: " + type); + throw new IllegalArgumentException("Invalid launcher type: " + launcherType); } launcher.launch(); @@ -138,6 +141,39 @@ public final class EntryPoint { } } + private static void setProperties(Parameters params) { + String launcherBrand = params.getString("launcherBrand", null); + String launcherVersion = params.getString("launcherVersion", null); + String name = params.getString("instanceName", null); + String iconId = params.getString("instanceIconKey", null); + String iconPath = params.getString("instanceIconPath", null); + String windowTitle = params.getString("windowTitle", null); + String windowDimensions = params.getString("windowParams", null); + + if (launcherBrand != null) + System.setProperty("minecraft.launcher.brand", launcherBrand); + if (launcherVersion != null) + System.setProperty("minecraft.launcher.version", launcherVersion); + + // set useful properties for mods + if (name != null) + System.setProperty("org.prismlauncher.instance.name", name); + if (iconId != null) + System.setProperty("org.prismlauncher.instance.icon.id", iconId); + if (iconPath != null) + System.setProperty("org.prismlauncher.instance.icon.path", iconPath); + if (windowTitle != null) + System.setProperty("org.prismlauncher.window.title", windowTitle); + if (windowDimensions != null) + System.setProperty("org.prismlauncher.window.dimensions", windowDimensions); + + // set multimc properties for compatibility + if (name != null) + System.setProperty("multimc.instance.title", name); + if (iconId != null) + System.setProperty("multimc.instance.icon", iconId); + } + private static PreLaunchAction parseLine(String input, Parameters params) throws ParseException { switch (input) { case "": diff --git a/libraries/launcher/org/prismlauncher/launcher/impl/AbstractLauncher.java b/libraries/launcher/org/prismlauncher/launcher/impl/AbstractLauncher.java index 761837041..de28a0401 100644 --- a/libraries/launcher/org/prismlauncher/launcher/impl/AbstractLauncher.java +++ b/libraries/launcher/org/prismlauncher/launcher/impl/AbstractLauncher.java @@ -83,7 +83,7 @@ public abstract class AbstractLauncher implements Launcher { String windowParams = params.getString("windowParams", null); - if ("max".equals(windowParams) || windowParams == null) { + if ("maximized".equals(windowParams) || windowParams == null) { maximize = windowParams != null; width = DEFAULT_WINDOW_WIDTH;