Forge works now too, and so does forge+liteloader

This commit is contained in:
Jan Dalheimer
2014-01-23 21:31:41 +01:00
parent c39d26f445
commit 156bc8f276
13 changed files with 245 additions and 81 deletions

View File

@@ -27,6 +27,7 @@
QMap<QString, QString> LiteLoaderInstaller::m_launcherWrapperVersionMapping;
LiteLoaderInstaller::LiteLoaderInstaller()
: BaseInstaller()
{
if (m_launcherWrapperVersionMapping.isEmpty())
{
@@ -42,24 +43,11 @@ bool LiteLoaderInstaller::canApply(DerpInstance *instance) const
return m_launcherWrapperVersionMapping.contains(instance->intendedVersionId());
}
bool LiteLoaderInstaller::isApplied(DerpInstance *on)
{
return QFile::exists(filename(on->instanceRoot()));
}
bool LiteLoaderInstaller::add(DerpInstance *to)
{
if (!patchesDir(to->instanceRoot()).exists())
if (!BaseInstaller::add(to))
{
QDir(to->instanceRoot()).mkdir("patches");
}
if (isApplied(to))
{
if (!remove(to))
{
return false;
}
return false;
}
QJsonObject obj;
@@ -102,17 +90,3 @@ bool LiteLoaderInstaller::add(DerpInstance *to)
return true;
}
bool LiteLoaderInstaller::remove(DerpInstance *from)
{
return QFile::remove(filename(from->instanceRoot()));
}
QString LiteLoaderInstaller::filename(const QString &root) const
{
return patchesDir(root).absoluteFilePath(id() + ".json");
}
QDir LiteLoaderInstaller::patchesDir(const QString &root) const
{
return QDir(root + "/patches/");
}