| 622 | } |
| 623 | |
| 624 | InstancePtr InstanceList::loadInstance(const InstanceId& id) |
| 625 | { |
| 626 | if (!m_groupsLoaded) { |
| 627 | loadGroupList(); |
| 628 | } |
| 629 | |
| 630 | auto instanceRoot = FS::PathCombine(m_instDir, id); |
| 631 | auto instanceSettings = std::make_shared<INISettingsObject>(FS::PathCombine(instanceRoot, "instance.cfg")); |
| 632 | InstancePtr inst; |
| 633 | |
| 634 | instanceSettings->registerSetting("InstanceType", ""); |
| 635 | |
| 636 | QString inst_type = instanceSettings->get("InstanceType").toString(); |
| 637 | |
| 638 | // NOTE: Some launcher versions didn't save the InstanceType properly. We will just bank on the probability that this is probably a |
| 639 | // OneSix instance |
| 640 | if (inst_type == "OneSix" || inst_type.isEmpty()) { |
| 641 | inst.reset(new MinecraftInstance(m_globalSettings, instanceSettings, instanceRoot)); |
| 642 | } else { |
| 643 | inst.reset(new NullInstance(m_globalSettings, instanceSettings, instanceRoot)); |
| 644 | } |
| 645 | qDebug() << "Loaded instance " << inst->name() << " from " << inst->instanceRoot(); |
| 646 | return inst; |
| 647 | } |
| 648 | |
| 649 | void InstanceList::increaseGroupCount(const QString& group) |
| 650 | { |
nothing calls this directly
no test coverage detected