From bf7b07050873770bd0b2ed5d73965b5a88d7a351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 8 Jun 2014 20:11:09 +0200 Subject: Show texture/resource packs when appropriate. --- logic/OneSixInstance.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'logic/OneSixInstance.cpp') 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 +#include +#include OneSixInstance::OneSixInstance(const QString &rootDir, SettingsObject *settings, QObject *parent) @@ -60,8 +62,8 @@ QList 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 OneSixInstance::traits() +{ + auto version = getFullVersion(); + if (!version) + { + return {"version-incomplete"}; + } + else + return version->traits; +} + std::shared_ptr OneSixInstance::doUpdate() { return std::shared_ptr(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"); -- cgit v1.2.3