pollymc/logic/ftb/LegacyFTBInstance.cpp

32 lines
896 B
C++
Raw Normal View History

#include "LegacyFTBInstance.h"
2015-02-09 06:21:14 +05:30
#include <settings/INISettingsObject.h>
#include <QDir>
2015-02-01 07:38:25 +05:30
LegacyFTBInstance::LegacyFTBInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) :
LegacyInstance(globalSettings, settings, rootDir)
{
}
QString LegacyFTBInstance::getStatusbarDescription()
{
2014-09-06 21:46:56 +05:30
if (flags() & VersionBrokenFlag)
{
return "Legacy FTB: " + intendedVersionId() + " (broken)";
}
return "Legacy FTB: " + intendedVersionId();
}
QString LegacyFTBInstance::id() const
{
return "FTB/" + BaseInstance::id();
}
void LegacyFTBInstance::copy(const QDir &newDir)
{
// set the target instance to be plain Legacy
INISettingsObject settings_obj(newDir.absoluteFilePath("instance.cfg"));
settings_obj.registerSetting("InstanceType", "Legacy");
QString inst_type = settings_obj.get("InstanceType").toString();
settings_obj.set("InstanceType", "Legacy");
}