Begin the transformation!

Nuke all the things.
This commit is contained in:
Petr Mrázek
2014-04-23 02:27:40 +02:00
parent 3a0cdf2d3d
commit aade36860c
55 changed files with 1066 additions and 1590 deletions

View File

@@ -23,7 +23,6 @@
#include "LegacyFTBInstance.h"
#include "OneSixInstance.h"
#include "OneSixFTBInstance.h"
#include "NostalgiaInstance.h"
#include "OneSixInstance.h"
#include "BaseVersion.h"
#include "MinecraftVersion.h"
@@ -51,7 +50,7 @@ InstanceFactory::InstLoadError InstanceFactory::loadInstance(InstancePtr &inst,
QString inst_type = m_settings->get("InstanceType").toString();
// FIXME: replace with a map lookup, where instance classes register their types
if (inst_type == "OneSix")
if (inst_type == "OneSix" || inst_type == "Nostalgia")
{
inst.reset(new OneSixInstance(instDir, m_settings, this));
}
@@ -59,10 +58,6 @@ InstanceFactory::InstLoadError InstanceFactory::loadInstance(InstancePtr &inst,
{
inst.reset(new LegacyInstance(instDir, m_settings, this));
}
else if (inst_type == "Nostalgia")
{
inst.reset(new NostalgiaInstance(instDir, m_settings, this));
}
else if (inst_type == "LegacyFTB")
{
inst.reset(new LegacyFTBInstance(instDir, m_settings, this));
@@ -98,55 +93,26 @@ InstanceFactory::InstCreateError InstanceFactory::createInstance(InstancePtr &in
if (type == NormalInst)
{
switch (mcVer->type)
{
case MinecraftVersion::Legacy:
// TODO new instance type
m_settings->set("InstanceType", "Legacy");
inst.reset(new LegacyInstance(instDir, m_settings, this));
inst->setIntendedVersionId(version->descriptor());
inst->setShouldUseCustomBaseJar(false);
break;
case MinecraftVersion::OneSix:
m_settings->set("InstanceType", "OneSix");
inst.reset(new OneSixInstance(instDir, m_settings, this));
inst->setIntendedVersionId(version->descriptor());
inst->setShouldUseCustomBaseJar(false);
break;
case MinecraftVersion::Nostalgia:
m_settings->set("InstanceType", "Nostalgia");
inst.reset(new NostalgiaInstance(instDir, m_settings, this));
inst->setIntendedVersionId(version->descriptor());
inst->setShouldUseCustomBaseJar(false);
break;
default:
{
delete m_settings;
return InstanceFactory::NoSuchVersion;
}
}
m_settings->set("InstanceType", "OneSix");
inst.reset(new OneSixInstance(instDir, m_settings, this));
inst->setIntendedVersionId(version->descriptor());
inst->setShouldUseCustomBaseJar(false);
}
else if (type == FTBInstance)
{
switch (mcVer->type)
if(mcVer->usesLegacyLauncher())
{
case MinecraftVersion::Legacy:
m_settings->set("InstanceType", "LegacyFTB");
inst.reset(new LegacyFTBInstance(instDir, m_settings, this));
inst->setIntendedVersionId(version->descriptor());
inst->setShouldUseCustomBaseJar(false);
break;
case MinecraftVersion::OneSix:
}
else
{
m_settings->set("InstanceType", "OneSixFTB");
inst.reset(new OneSixFTBInstance(instDir, m_settings, this));
inst->setIntendedVersionId(version->descriptor());
inst->setShouldUseCustomBaseJar(false);
break;
default:
{
delete m_settings;
return InstanceFactory::NoSuchVersion;
}
}
}
else