diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-08-18 18:06:45 +0200 |
---|---|---|
committer | Sefa Eyeoglu <contact@scrumplex.net> | 2022-08-18 18:14:01 +0200 |
commit | 01505910f44a193510012a3b1b1f57b84d1d37c6 (patch) | |
tree | f13c8c90ba23052d67cf3ab90bc3fc0c94d8d67b /launcher | |
parent | ab766a05989adbe3fcb61e8ca865e2dab5b2cc74 (diff) | |
download | PrismLauncher-01505910f44a193510012a3b1b1f57b84d1d37c6.tar.gz PrismLauncher-01505910f44a193510012a3b1b1f57b84d1d37c6.tar.bz2 PrismLauncher-01505910f44a193510012a3b1b1f57b84d1d37c6.zip |
refactor: move classpath definition into NewLaunch itself
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'launcher')
-rw-r--r-- | launcher/minecraft/MinecraftInstance.cpp | 5 | ||||
-rw-r--r-- | launcher/minecraft/launch/LauncherPartLaunch.cpp | 25 |
2 files changed, 8 insertions, 22 deletions
diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index 5a6f8de0..036659da 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -562,6 +562,11 @@ QString MinecraftInstance::createLaunchScript(AuthSessionPtr session, MinecraftS if(!profile) return QString(); + for (auto cp : getClassPath()) + { + launchScript += "classPath " + cp + "\n"; + } + auto mainClass = getMainClass(); if (!mainClass.isEmpty()) { diff --git a/launcher/minecraft/launch/LauncherPartLaunch.cpp b/launcher/minecraft/launch/LauncherPartLaunch.cpp index 63e4d90f..3b905bf5 100644 --- a/launcher/minecraft/launch/LauncherPartLaunch.cpp +++ b/launcher/minecraft/launch/LauncherPartLaunch.cpp @@ -95,8 +95,8 @@ bool fitsInLocal8bit(const QString & string) void LauncherPartLaunch::executeTask() { - QString jarPath = APPLICATION->getJarPath("NewLaunch.jar"); - if (jarPath.isEmpty()) + QString newLaunchJar = APPLICATION->getJarPath("NewLaunch.jar"); + if (newLaunchJar.isEmpty()) { const char *reason = QT_TR_NOOP("Launcher library could not be found. Please check your installation."); emit logLine(tr(reason), MessageLevel::Fatal); @@ -119,9 +119,6 @@ void LauncherPartLaunch::executeTask() // make detachable - this will keep the process running even if the object is destroyed m_process.setDetachable(true); - auto classPath = minecraftInstance->getClassPath(); - classPath.prepend(jarPath); - auto natPath = minecraftInstance->getNativePath(); #ifdef Q_OS_WIN if (!fitsInLocal8bit(natPath)) @@ -137,23 +134,7 @@ void LauncherPartLaunch::executeTask() #endif args << "-cp"; -#ifdef Q_OS_WIN - QStringList processed; - for(auto & item: classPath) - { - if (!fitsInLocal8bit(item)) - { - processed << shortPathName(item); - } - else - { - processed << item; - } - } - args << processed.join(';'); -#else - args << classPath.join(':'); -#endif + args << newLaunchJar; args << "org.polymc.EntryPoint"; qDebug() << args.join(' '); |