summaryrefslogtreecommitdiffstats
path: root/logic/OneSixInstance.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-05-06 22:38:28 +0200
committerPetr Mrázek <peterix@gmail.com>2014-06-09 01:38:29 +0200
commit2590c6be15ab549256f0a39028aefb887ac5131a (patch)
treed999e2e399d43c613254bce19cb190218f8b07ba /logic/OneSixInstance.cpp
parent4c3bd416c65ec887209fa06b0a5634099b77f322 (diff)
downloadMultiMC-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/OneSixInstance.cpp')
-rw-r--r--logic/OneSixInstance.cpp64
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;