summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-02-20 17:06:32 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-02-20 17:06:32 +0100
commit43881b9cdba95259395c8bf633b670c8a6fead9a (patch)
treef8cfab198d6ca3d04888e2bf453179ab7ee03499
parent5cf599673db88b39100ffca78e10bbe5e10200d7 (diff)
downloadMultiMC-43881b9cdba95259395c8bf633b670c8a6fead9a.tar
MultiMC-43881b9cdba95259395c8bf633b670c8a6fead9a.tar.gz
MultiMC-43881b9cdba95259395c8bf633b670c8a6fead9a.tar.lz
MultiMC-43881b9cdba95259395c8bf633b670c8a6fead9a.tar.xz
MultiMC-43881b9cdba95259395c8bf633b670c8a6fead9a.zip
Use FTB's libraries/ and versions/ folders for non-copied instances
-rw-r--r--logic/OneSixFTBInstance.cpp9
-rw-r--r--logic/OneSixFTBInstance.h3
-rw-r--r--logic/OneSixInstance.cpp17
-rw-r--r--logic/OneSixInstance.h3
4 files changed, 27 insertions, 5 deletions
diff --git a/logic/OneSixFTBInstance.cpp b/logic/OneSixFTBInstance.cpp
index ca88142a..8f745f93 100644
--- a/logic/OneSixFTBInstance.cpp
+++ b/logic/OneSixFTBInstance.cpp
@@ -95,6 +95,15 @@ QString OneSixFTBInstance::id() const
return "FTB/" + BaseInstance::id();
}
+QDir OneSixFTBInstance::librariesPath() const
+{
+ return QDir(MMC->settings()->get("FTBRoot").toString() + "/libraries");
+}
+QDir OneSixFTBInstance::versionsPath() const
+{
+ return QDir(MMC->settings()->get("FTBRoot").toString() + "/versions");
+}
+
QString OneSixFTBInstance::getStatusbarDescription()
{
return "OneSix FTB: " + intendedVersionId();
diff --git a/logic/OneSixFTBInstance.h b/logic/OneSixFTBInstance.h
index bc543aeb..d3ceb190 100644
--- a/logic/OneSixFTBInstance.h
+++ b/logic/OneSixFTBInstance.h
@@ -17,6 +17,9 @@ public:
virtual QString id() const;
+ virtual QDir librariesPath() const override;
+ virtual QDir versionsPath() const override;
+
private:
std::shared_ptr<OneSixLibrary> m_forge;
};
diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp
index ae172f21..8b4de641 100644
--- a/logic/OneSixInstance.cpp
+++ b/logic/OneSixInstance.cpp
@@ -192,12 +192,10 @@ MinecraftProcess *OneSixInstance::prepareForLaunch(AuthSessionPtr session)
auto libs = version->getActiveNormalLibs();
for (auto lib : libs)
{
- QFileInfo fi(QString("libraries/") + lib->storagePath());
- launchScript += "cp " + fi.absoluteFilePath() + "\n";
+ launchScript += "cp " + librariesPath().absoluteFilePath(lib->storagePath()) + "\n";
}
- QString targetstr = "versions/" + version->id + "/" + version->id + ".jar";
- QFileInfo fi(targetstr);
- launchScript += "cp " + fi.absoluteFilePath() + "\n";
+ QString targetstr = version->id + "/" + version->id + ".jar";
+ launchScript += "cp " + versionsPath().absoluteFilePath(targetstr) + "\n";
}
launchScript += "mainClass " + version->mainClass + "\n";
@@ -374,6 +372,15 @@ QString OneSixInstance::getStatusbarDescription()
return descr;
}
+QDir OneSixInstance::librariesPath() const
+{
+ return QDir::current().absoluteFilePath("libraries");
+}
+QDir OneSixInstance::versionsPath() const
+{
+ return QDir::current().absoluteFilePath("versions");
+}
+
QString OneSixInstance::loaderModsDir() const
{
return PathCombine(minecraftRoot(), "mods");
diff --git a/logic/OneSixInstance.h b/logic/OneSixInstance.h
index ae95eab1..4ea5fce1 100644
--- a/logic/OneSixInstance.h
+++ b/logic/OneSixInstance.h
@@ -68,6 +68,9 @@ public:
virtual bool menuActionEnabled(QString action_name) const override;
virtual QString getStatusbarDescription() override;
+ virtual QDir librariesPath() const;
+ virtual QDir versionsPath() const;
+
signals:
void versionReloaded();