diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-12-22 04:31:30 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-12-22 04:31:30 +0100 |
commit | 74b5b5f535ec8d98ba93c629804c75fda9e32475 (patch) | |
tree | d24bf1a9219595db0b1e8356e78c8c34698a6a7c /logic/InstanceFactory.cpp | |
parent | 82c87aa06f793b9f38e6cb42d284f00695f4bac5 (diff) | |
download | MultiMC-74b5b5f535ec8d98ba93c629804c75fda9e32475.tar MultiMC-74b5b5f535ec8d98ba93c629804c75fda9e32475.tar.gz MultiMC-74b5b5f535ec8d98ba93c629804c75fda9e32475.tar.lz MultiMC-74b5b5f535ec8d98ba93c629804c75fda9e32475.tar.xz MultiMC-74b5b5f535ec8d98ba93c629804c75fda9e32475.zip |
Make FTB instances behave better
* Do not re-create on every reload
* Use the version.json/custom.json logic properly
* Should be offline-friendly
* FTB instances can be copied, turn into normal instances
Diffstat (limited to 'logic/InstanceFactory.cpp')
-rw-r--r-- | logic/InstanceFactory.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/logic/InstanceFactory.cpp b/logic/InstanceFactory.cpp index 31a287dd..7c778035 100644 --- a/logic/InstanceFactory.cpp +++ b/logic/InstanceFactory.cpp @@ -170,7 +170,17 @@ InstanceFactory::InstCreateError InstanceFactory::copyInstance(BaseInstance *&ne rootDir.removeRecursively(); return InstanceFactory::CantCreateDir; } + auto m_settings = new INISettingsObject(PathCombine(instDir, "instance.cfg")); + m_settings->registerSetting(new Setting("InstanceType", "Legacy")); + QString inst_type = m_settings->get("InstanceType").toString(); + + if(inst_type == "OneSixFTB") + m_settings->set("InstanceType", "OneSix"); + if(inst_type == "LegacyFTB") + m_settings->set("InstanceType", "Legacy"); + auto error = loadInstance(newInstance, instDir); + switch (error) { case NoLoadError: |