summaryrefslogtreecommitdiffstats
path: root/logic/OneSixInstance.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-06-08 20:11:09 +0200
committerPetr Mrázek <peterix@gmail.com>2014-06-09 01:38:31 +0200
commitbf7b07050873770bd0b2ed5d73965b5a88d7a351 (patch)
treef29a06ac56d9197ac7bbd1df19faa7824e9d6cc5 /logic/OneSixInstance.cpp
parent223a7aba7bfa6019d8a2cfa5e8f8a4791a96d136 (diff)
downloadMultiMC-bf7b07050873770bd0b2ed5d73965b5a88d7a351.tar
MultiMC-bf7b07050873770bd0b2ed5d73965b5a88d7a351.tar.gz
MultiMC-bf7b07050873770bd0b2ed5d73965b5a88d7a351.tar.lz
MultiMC-bf7b07050873770bd0b2ed5d73965b5a88d7a351.tar.xz
MultiMC-bf7b07050873770bd0b2ed5d73965b5a88d7a351.zip
Show texture/resource packs when appropriate.
Diffstat (limited to 'logic/OneSixInstance.cpp')
-rw-r--r--logic/OneSixInstance.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp
index 58781c15..d306470c 100644
--- a/logic/OneSixInstance.cpp
+++ b/logic/OneSixInstance.cpp
@@ -32,6 +32,8 @@
#include "gui/pagedialog/PageDialog.h"
#include "gui/pages/VersionPage.h"
#include <gui/pages/ModFolderPage.h>
+#include <gui/pages/ResourcePackPage.h>
+#include <gui/pages/TexturePackPage.h>
OneSixInstance::OneSixInstance(const QString &rootDir, SettingsObject *settings,
QObject *parent)
@@ -60,8 +62,8 @@ QList<BasePage *> OneSixInstance::getPages()
values.append(new VersionPage(this));
values.append(new ModFolderPage(loaderModList(), "mods", "centralmods", tr("Loader Mods")));
values.append(new ModFolderPage(coreModList(), "coremods", "viewfolder", tr("Core Mods")));
- values.append(new ModFolderPage(resourcePackList(), "resourcepacks", "viewfolder", tr("Resource Packs")));
- values.append(new ModFolderPage(texturePackList(), "texturepacks", "viewfolder", tr("Texture Packs")));
+ values.append(new ResourcePackPage(this));
+ values.append(new TexturePackPage(this));
return values;
}
@@ -70,6 +72,17 @@ QString OneSixInstance::dialogTitle()
return tr("Edit Instance (%1)").arg(name());
}
+QSet<QString> OneSixInstance::traits()
+{
+ auto version = getFullVersion();
+ if (!version)
+ {
+ return {"version-incomplete"};
+ }
+ else
+ return version->traits;
+}
+
std::shared_ptr<Task> OneSixInstance::doUpdate()
{
return std::shared_ptr<Task>(new OneSixUpdate(this));
@@ -234,11 +247,11 @@ bool OneSixInstance::prepareForLaunch(AuthSessionPtr session, QString &launchScr
}
launchScript += "cp " + versionsPath().absoluteFilePath(minecraftjarpath) + "\n";
}
- if(!version->mainClass.isEmpty())
+ if (!version->mainClass.isEmpty())
{
launchScript += "mainClass " + version->mainClass + "\n";
}
- if(!version->appletClass.isEmpty())
+ if (!version->appletClass.isEmpty())
{
launchScript += "appletClass " + version->appletClass + "\n";
}
@@ -261,7 +274,7 @@ bool OneSixInstance::prepareForLaunch(AuthSessionPtr session, QString &launchScr
launchScript += "windowTitle " + windowTitle() + "\n";
launchScript += "windowParams " + windowParams + "\n";
}
-
+
// legacy auth
{
launchScript += "userName " + session->player_name + "\n";
@@ -278,7 +291,7 @@ bool OneSixInstance::prepareForLaunch(AuthSessionPtr session, QString &launchScr
}
launchScript += "natives " + natives_dir.absolutePath() + "\n";
}
-
+
// traits. including legacyLaunch and others ;)
for (auto trait : version->traits)
{
@@ -398,9 +411,8 @@ void OneSixInstance::reloadVersion()
d->m_flags.remove(VersionBrokenFlag);
emit versionReloaded();
}
- catch (VersionIncomplete & error)
+ catch (VersionIncomplete &error)
{
-
}
catch (MMCError &error)
{
@@ -532,7 +544,6 @@ QString OneSixInstance::texturePacksDir() const
return PathCombine(minecraftRoot(), "texturepacks");
}
-
QString OneSixInstance::instanceConfigFolder() const
{
return PathCombine(minecraftRoot(), "config");