diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-08-12 00:39:19 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-08-12 00:39:19 +0200 |
commit | ff33d4a1a48abf1442cde77c2253f071d0870d50 (patch) | |
tree | 7846f144b2ee2e24574745847c0f921677021d73 /backend/LegacyInstance.cpp | |
parent | 7e78a422e8bb22572706b7fadb58fc45e7b8a7db (diff) | |
download | MultiMC-ff33d4a1a48abf1442cde77c2253f071d0870d50.tar MultiMC-ff33d4a1a48abf1442cde77c2253f071d0870d50.tar.gz MultiMC-ff33d4a1a48abf1442cde77c2253f071d0870d50.tar.lz MultiMC-ff33d4a1a48abf1442cde77c2253f071d0870d50.tar.xz MultiMC-ff33d4a1a48abf1442cde77c2253f071d0870d50.zip |
OneSix instances now have a minecraft folder inside.
Also, the main instance view was expanded with helpful key events:
F2 for rename, F5 for refresh, Enter for start instance, Delete for...
Diffstat (limited to 'backend/LegacyInstance.cpp')
-rw-r--r-- | backend/LegacyInstance.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/backend/LegacyInstance.cpp b/backend/LegacyInstance.cpp index bf5c674b..9102c9c7 100644 --- a/backend/LegacyInstance.cpp +++ b/backend/LegacyInstance.cpp @@ -21,17 +21,6 @@ LegacyInstance::LegacyInstance(const QString& rootDir, SettingsObject* settings, settings->registerSetting(new Setting("IntendedJarVersion", "")); } -QString LegacyInstance::minecraftDir() const -{ - QFileInfo mcDir(PathCombine(rootDir(), "minecraft")); - QFileInfo dotMCDir(PathCombine(rootDir(), ".minecraft")); - - if (dotMCDir.exists() && !mcDir.exists()) - return dotMCDir.filePath(); - else - return mcDir.filePath(); -} - BaseUpdate* LegacyInstance::doUpdate() { return new LegacyUpdate(this, this); @@ -42,10 +31,10 @@ MinecraftProcess* LegacyInstance::prepareForLaunch(QString user, QString session MinecraftProcess * proc = new MinecraftProcess(this); // FIXME: extract the icon - // QImage(":/icons/instances/" + iconKey()).save(PathCombine(minecraftDir(), "icon.png")); + // QImage(":/icons/instances/" + iconKey()).save(PathCombine(minecraftRoot(), "icon.png")); // extract the legacy launcher - QFile(":/launcher/launcher.jar").copy(PathCombine(minecraftDir(), LAUNCHER_FILE)); + QFile(":/launcher/launcher.jar").copy(PathCombine(minecraftRoot(), LAUNCHER_FILE)); // set the process arguments { @@ -88,7 +77,7 @@ MinecraftProcess* LegacyInstance::prepareForLaunch(QString user, QString session } // set the process work path - proc->setMinecraftWorkdir(minecraftDir()); + proc->setMinecraftWorkdir(minecraftRoot()); return proc; } @@ -101,32 +90,32 @@ void LegacyInstance::cleanupAfterRun() QString LegacyInstance::instModsDir() const { - return PathCombine(rootDir(), "instMods"); + return PathCombine(instanceRoot(), "instMods"); } QString LegacyInstance::binDir() const { - return PathCombine(minecraftDir(), "bin"); + return PathCombine(minecraftRoot(), "bin"); } QString LegacyInstance::savesDir() const { - return PathCombine(minecraftDir(), "saves"); + return PathCombine(minecraftRoot(), "saves"); } QString LegacyInstance::mlModsDir() const { - return PathCombine(minecraftDir(), "mods"); + return PathCombine(minecraftRoot(), "mods"); } QString LegacyInstance::coreModsDir() const { - return PathCombine(minecraftDir(), "coremods"); + return PathCombine(minecraftRoot(), "coremods"); } QString LegacyInstance::resourceDir() const { - return PathCombine(minecraftDir(), "resources"); + return PathCombine(minecraftRoot(), "resources"); } QString LegacyInstance::mcJar() const @@ -141,7 +130,7 @@ QString LegacyInstance::mcBackup() const QString LegacyInstance::modListFile() const { - return PathCombine(rootDir(), "modlist"); + return PathCombine(instanceRoot(), "modlist"); } bool LegacyInstance::shouldUpdateCurrentVersion() const @@ -220,10 +209,21 @@ QString LegacyInstance::intendedVersionId() const } bool LegacyInstance::setIntendedVersionId ( QString version ) { - return false; + settings().set("IntendedJarVersion", version); + setShouldUpdate(true); + return true; } bool LegacyInstance::shouldUpdate() const { + I_D(LegacyInstance); + QVariant var = settings().get ( "ShouldUpdate" ); + if ( !var.isValid() || var.toBool() == false ) + { + return intendedVersionId() != currentVersionId(); + } return true; } -void LegacyInstance::setShouldUpdate ( bool val ) {} +void LegacyInstance::setShouldUpdate ( bool val ) +{ + settings().set ( "ShouldUpdate", val ); +} |