From c2c7293083de8e8d40190992ccd6a65b613a4d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 20 Sep 2013 01:21:48 +0200 Subject: Things... and stuff... with 1.6 modding. Maybe. --- logic/OneSixInstance.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'logic/OneSixInstance.cpp') 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); -- cgit v1.2.3