diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:27:24 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-07 00:27:24 +0200 |
commit | 795889d934e8f4ebe89be1a49a3417fd98e89be1 (patch) | |
tree | c5b0d30d425003c4b88e84a2908e63eb5ed797b9 /api/logic/minecraft/onesix/OneSixInstance.cpp | |
parent | 160b5033a79e6b5ee9f3e2a001b96c677f41ddcb (diff) | |
parent | 8e58d61150b0bdbe9eb91065d36342f3004fe97b (diff) | |
download | MultiMC-795889d934e8f4ebe89be1a49a3417fd98e89be1.tar MultiMC-795889d934e8f4ebe89be1a49a3417fd98e89be1.tar.gz MultiMC-795889d934e8f4ebe89be1a49a3417fd98e89be1.tar.lz MultiMC-795889d934e8f4ebe89be1a49a3417fd98e89be1.tar.xz MultiMC-795889d934e8f4ebe89be1a49a3417fd98e89be1.zip |
Merge branch 'feature/meta' into develop
Diffstat (limited to 'api/logic/minecraft/onesix/OneSixInstance.cpp')
-rw-r--r-- | api/logic/minecraft/onesix/OneSixInstance.cpp | 66 |
1 files changed, 58 insertions, 8 deletions
diff --git a/api/logic/minecraft/onesix/OneSixInstance.cpp b/api/logic/minecraft/onesix/OneSixInstance.cpp index b471ff3e..fd54f544 100644 --- a/api/logic/minecraft/onesix/OneSixInstance.cpp +++ b/api/logic/minecraft/onesix/OneSixInstance.cpp @@ -34,7 +34,15 @@ OneSixInstance::OneSixInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) : MinecraftInstance(globalSettings, settings, rootDir) { + // set explicitly during instance creation m_settings->registerSetting({"IntendedVersion", "MinecraftVersion"}, ""); + + // defaults to the version we've been using for years (2.9.1) + m_settings->registerSetting("LWJGLVersion", "2.9.1"); + + // optionals + m_settings->registerSetting("ForgeVersion", ""); + m_settings->registerSetting("LiteloaderVersion", ""); } void OneSixInstance::init() @@ -275,6 +283,8 @@ QStringList OneSixInstance::verboseDescription(AuthSessionPtr session) printLibFile(file); } printLibFile(mainJarPath()); + out << ""; + out << "Native libraries:"; for(auto file: nativeJars) { printLibFile(file); @@ -480,7 +490,32 @@ std::shared_ptr<WorldList> OneSixInstance::worldList() const bool OneSixInstance::setIntendedVersionId(QString version) { - settings()->set("IntendedVersion", version); + return setComponentVersion("net.minecraft", version); +} + +QString OneSixInstance::intendedVersionId() const +{ + return getComponentVersion("net.minecraft"); +} + +bool OneSixInstance::setComponentVersion(const QString& uid, const QString& version) +{ + if(uid == "net.minecraft") + { + settings()->set("IntendedVersion", version); + } + else if (uid == "org.lwjgl") + { + settings()->set("LWJGLVersion", version); + } + else if (uid == "net.minecraftforge") + { + settings()->set("ForgeVersion", version); + } + else if (uid == "com.mumfrey.liteloader") + { + settings()->set("LiteloaderVersion", version); + } if(getMinecraftProfile()) { clearProfile(); @@ -489,6 +524,27 @@ bool OneSixInstance::setIntendedVersionId(QString version) return true; } +QString OneSixInstance::getComponentVersion(const QString& uid) const +{ + if(uid == "net.minecraft") + { + return settings()->get("IntendedVersion").toString(); + } + else if(uid == "org.lwjgl") + { + return settings()->get("LWJGLVersion").toString(); + } + else if(uid == "net.minecraftforge") + { + return settings()->get("ForgeVersion").toString(); + } + else if(uid == "com.mumfrey.liteloader") + { + return settings()->get("LiteloaderVersion").toString(); + } + return QString(); +} + QList< Mod > OneSixInstance::getJarMods() const { QList<Mod> mods; @@ -500,12 +556,6 @@ QList< Mod > OneSixInstance::getJarMods() const return mods; } - -QString OneSixInstance::intendedVersionId() const -{ - return settings()->get("IntendedVersion").toString(); -} - void OneSixInstance::setShouldUpdate(bool) { } @@ -523,7 +573,7 @@ QString OneSixInstance::currentVersionId() const void OneSixInstance::reloadProfile() { m_profile->reload(); - setVersionBroken(m_profile->getProblemSeverity() == ProblemSeverity::PROBLEM_ERROR); + setVersionBroken(m_profile->getProblemSeverity() == ProblemSeverity::Error); emit versionReloaded(); } |