feat: add launcher brand and version props

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2023-10-22 21:19:44 +02:00
parent cf33927f21
commit db19362a97
No known key found for this signature in database
GPG Key ID: E13DFD4B47127951
2 changed files with 13 additions and 0 deletions

View File

@ -718,6 +718,12 @@ QString MinecraftInstance::createLaunchScript(AuthSessionPtr session, MinecraftS
launchScript += "windowParams " + windowParams + "\n"; launchScript += "windowParams " + windowParams + "\n";
} }
// launcher info
{
launchScript += "launcherBrand " + BuildConfig.LAUNCHER_NAME + "\n";
launchScript += "launcherVersion " + BuildConfig.printableVersionString() + "\n";
}
// instance info // instance info
{ {
launchScript += "instanceName " + name() + "\n"; launchScript += "instanceName " + name() + "\n";

View File

@ -142,12 +142,19 @@ public final class EntryPoint {
} }
private static void setProperties(Parameters params) { 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 name = params.getString("instanceName", null);
String iconId = params.getString("instanceIconKey", null); String iconId = params.getString("instanceIconKey", null);
String iconPath = params.getString("instanceIconPath", null); String iconPath = params.getString("instanceIconPath", null);
String windowTitle = params.getString("windowTitle", null); String windowTitle = params.getString("windowTitle", null);
String windowDimensions = params.getString("windowParams", 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 // set useful properties for mods
if (name != null) if (name != null)
System.setProperty("org.prismlauncher.instance.name", name); System.setProperty("org.prismlauncher.instance.name", name);