diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-05-06 22:38:28 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-06-09 01:38:29 +0200 |
commit | 2590c6be15ab549256f0a39028aefb887ac5131a (patch) | |
tree | d999e2e399d43c613254bce19cb190218f8b07ba /logic | |
parent | 4c3bd416c65ec887209fa06b0a5634099b77f322 (diff) | |
download | MultiMC-2590c6be15ab549256f0a39028aefb887ac5131a.tar MultiMC-2590c6be15ab549256f0a39028aefb887ac5131a.tar.gz MultiMC-2590c6be15ab549256f0a39028aefb887ac5131a.tar.lz MultiMC-2590c6be15ab549256f0a39028aefb887ac5131a.tar.xz MultiMC-2590c6be15ab549256f0a39028aefb887ac5131a.zip |
Fix launcher part for legacy in onesix.
Diffstat (limited to 'logic')
-rw-r--r-- | logic/OneSixInstance.cpp | 64 |
1 files changed, 47 insertions, 17 deletions
diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp index 9057a6e3..ffd40325 100644 --- a/logic/OneSixInstance.cpp +++ b/logic/OneSixInstance.cpp @@ -200,6 +200,8 @@ bool OneSixInstance::prepareForLaunch(AuthSessionPtr account, QString &launchScr auto version = d->version; if (!version) return nullptr; + + // libraries and class path. { auto libs = version->getActiveNormalLibs(); for (auto lib : libs) @@ -223,36 +225,64 @@ bool OneSixInstance::prepareForLaunch(AuthSessionPtr account, QString &launchScr } launchScript += "mainClass " + version->mainClass + "\n"; + // generic minecraft params for (auto param : processMinecraftArgs(account)) { launchScript += "param " + param + "\n"; } - // Set the width and height for 1.6 instances - bool maximize = settings().get("LaunchMaximized").toBool(); - if (maximize) + // window size, title and state, legacy { - // this is probably a BAD idea - // launchScript += "param --fullscreen\n"; + QString windowParams; + if (settings().get("LaunchMaximized").toBool()) + windowParams = "max"; + else + windowParams = QString("%1x%2") + .arg(settings().get("MinecraftWinWidth").toInt()) + .arg(settings().get("MinecraftWinHeight").toInt()); + launchScript += "windowTitle " + windowTitle() + "\n"; + launchScript += "windowParams " + windowParams + "\n"; } - else + + // window size, title and state, onesix { - launchScript += - "param --width\nparam " + settings().get("MinecraftWinWidth").toString() + "\n"; - launchScript += - "param --height\nparam " + settings().get("MinecraftWinHeight").toString() + "\n"; + bool maximize = settings().get("LaunchMaximized").toBool(); + if (maximize) + { + // FIXME: there is no good way to maximize the minecraft window in onesix. + // this is probably a BAD idea + // launchScript += "param --fullscreen\n"; + } + else + { + launchScript += + "param --width\nparam " + settings().get("MinecraftWinWidth").toString() + "\n"; + launchScript += + "param --height\nparam " + settings().get("MinecraftWinHeight").toString() + "\n"; + } + } + + // legacy auth + { + launchScript += "userName " + session->player_name + "\n"; + launchScript += "sessionId " + session->session + "\n"; } - QDir natives_dir(PathCombine(instanceRoot(), "natives/")); - launchScript += "windowTitle " + windowTitle() + "\n"; - for (auto native : version->getActiveNativeLibs()) + + // native libraries (mostly LWJGL) { - QFileInfo finfo(PathCombine("libraries", native->storagePath())); - launchScript += "ext " + finfo.absoluteFilePath() + "\n"; + QDir natives_dir(PathCombine(instanceRoot(), "natives/")); + for (auto native : version->getActiveNativeLibs()) + { + QFileInfo finfo(PathCombine("libraries", native->storagePath())); + launchScript += "ext " + finfo.absoluteFilePath() + "\n"; + } + launchScript += "natives " + natives_dir.absolutePath() + "\n"; } - launchScript += "natives " + natives_dir.absolutePath() + "\n"; + + // traits. including legacyLaunch and others ;) for (auto trait : version->traits) { - launchScript += "trait " + trait + "\n"; + launchScript += "traits " + trait + "\n"; } launchScript += "launcher onesix\n"; return true; |