summaryrefslogtreecommitdiffstats
path: root/backend/InstanceFactory.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-08-03 23:58:39 +0200
committerPetr Mrázek <peterix@gmail.com>2013-08-03 23:58:39 +0200
commit4f73091bb5bdbdb91329b9a4ef647fc8286d423c (patch)
tree6bc63a2d9ca2265cd7ee6dcf683219b73e25a24e /backend/InstanceFactory.cpp
parent13b1b98f7cf8a3b3b2c15dd42f96537b02c00711 (diff)
downloadMultiMC-4f73091bb5bdbdb91329b9a4ef647fc8286d423c.tar
MultiMC-4f73091bb5bdbdb91329b9a4ef647fc8286d423c.tar.gz
MultiMC-4f73091bb5bdbdb91329b9a4ef647fc8286d423c.tar.lz
MultiMC-4f73091bb5bdbdb91329b9a4ef647fc8286d423c.tar.xz
MultiMC-4f73091bb5bdbdb91329b9a4ef647fc8286d423c.zip
Errr... I forgot.
Diffstat (limited to 'backend/InstanceFactory.cpp')
-rw-r--r--backend/InstanceFactory.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/backend/InstanceFactory.cpp b/backend/InstanceFactory.cpp
index ee582d3f..f3636da3 100644
--- a/backend/InstanceFactory.cpp
+++ b/backend/InstanceFactory.cpp
@@ -21,6 +21,7 @@
#include "BaseInstance.h"
#include "LegacyInstance.h"
#include "OneSixInstance.h"
+#include "InstanceVersion.h"
#include "inifile.h"
#include <inisettingsobject.h>
@@ -61,7 +62,7 @@ InstanceFactory::InstLoadError InstanceFactory::loadInstance(BaseInstance *&inst
}
-InstanceFactory::InstCreateError InstanceFactory::createInstance(BaseInstance *&inst, const QString &instDir)
+InstanceFactory::InstCreateError InstanceFactory::createInstance( BaseInstance*& inst, const InstVersion* version, const QString& instDir )
{
QDir rootDir(instDir);
@@ -70,9 +71,14 @@ InstanceFactory::InstCreateError InstanceFactory::createInstance(BaseInstance *&
{
return InstanceFactory::CantCreateDir;
}
- return InstanceFactory::UnknownCreateError;
- //inst = new BaseInstance(instDir, this);
+ auto m_settings = new INISettingsObject(PathCombine(instDir, "instance.cfg"));
+ m_settings->registerSetting(new Setting("InstanceType", "Legacy"));
+ m_settings->set("InstanceType", "OneSix");
+
+ inst = new OneSixInstance(instDir, m_settings, this);
+ inst->setIntendedVersionId(version->descriptor());
+
//FIXME: really, how do you even know?
return InstanceFactory::NoCreateError;
}