summaryrefslogtreecommitdiffstats
path: root/logic/OneSixInstance.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-09-20 01:21:48 +0200
committerPetr Mrázek <peterix@gmail.com>2013-09-20 01:21:48 +0200
commitc2c7293083de8e8d40190992ccd6a65b613a4d06 (patch)
treea43112766db65c7fa8f456566b66c4e384d624a6 /logic/OneSixInstance.cpp
parent930b07afd4229e952d0cd47ca62cd94235499a0c (diff)
downloadMultiMC-c2c7293083de8e8d40190992ccd6a65b613a4d06.tar
MultiMC-c2c7293083de8e8d40190992ccd6a65b613a4d06.tar.gz
MultiMC-c2c7293083de8e8d40190992ccd6a65b613a4d06.tar.lz
MultiMC-c2c7293083de8e8d40190992ccd6a65b613a4d06.tar.xz
MultiMC-c2c7293083de8e8d40190992ccd6a65b613a4d06.zip
Things... and stuff... with 1.6 modding. Maybe.
Diffstat (limited to 'logic/OneSixInstance.cpp')
-rw-r--r--logic/OneSixInstance.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp
index 7b038c46..8124b4a0 100644
--- a/logic/OneSixInstance.cpp
+++ b/logic/OneSixInstance.cpp
@@ -226,6 +226,30 @@ QString OneSixInstance::currentVersionId() const
return intendedVersionId();
}
+bool OneSixInstance::customizeVersion()
+{
+ if(!versionIsCustom())
+ {
+ auto pathCustom = PathCombine(instanceRoot(), "custom.json");
+ auto pathOrig = PathCombine(instanceRoot(), "version.json");
+ QFile::copy(pathOrig, pathCustom);
+ return reloadFullVersion();
+ }
+ else return true;
+}
+
+bool OneSixInstance::revertCustomVersion()
+{
+ if(versionIsCustom())
+ {
+ auto path = PathCombine(instanceRoot(), "custom.json");
+ QFile::remove(path);
+ return reloadFullVersion();
+ }
+ else return true;
+}
+
+
bool OneSixInstance::reloadFullVersion()
{
I_D(OneSixInstance);