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
This commit is contained in:
Petr Mrázek
2013-12-22 04:31:30 +01:00
parent 82c87aa06f
commit 74b5b5f535
5 changed files with 214 additions and 131 deletions

View File

@ -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: