From db19362a970d2ffb4b25d1fbc2a5b1a1139205b9 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 22 Oct 2023 21:19:44 +0200 Subject: [PATCH] feat: add launcher brand and version props Signed-off-by: Sefa Eyeoglu --- launcher/minecraft/MinecraftInstance.cpp | 6 ++++++ libraries/launcher/org/prismlauncher/EntryPoint.java | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index f324ce87a..a4571e626 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -718,6 +718,12 @@ 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"; diff --git a/libraries/launcher/org/prismlauncher/EntryPoint.java b/libraries/launcher/org/prismlauncher/EntryPoint.java index eec2df9a9..699adfe30 100644 --- a/libraries/launcher/org/prismlauncher/EntryPoint.java +++ b/libraries/launcher/org/prismlauncher/EntryPoint.java @@ -142,12 +142,19 @@ 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);