Things... and stuff... with 1.6 modding. Maybe.
This commit is contained in:
@ -226,6 +226,30 @@ QString OneSixInstance::currentVersionId() const
|
||||
return intendedVersionId();
|
||||
}
|
||||
|
||||
bool OneSixInstance::customizeVersion()
|
||||
{
|
||||
if(!versionIsCustom())
|
||||
{
|
||||
auto pathCustom = PathCombine(instanceRoot(), "custom.json");
|
||||
auto pathOrig = PathCombine(instanceRoot(), "version.json");
|
||||
QFile::copy(pathOrig, pathCustom);
|
||||
return reloadFullVersion();
|
||||
}
|
||||
else return true;
|
||||
}
|
||||
|
||||
bool OneSixInstance::revertCustomVersion()
|
||||
{
|
||||
if(versionIsCustom())
|
||||
{
|
||||
auto path = PathCombine(instanceRoot(), "custom.json");
|
||||
QFile::remove(path);
|
||||
return reloadFullVersion();
|
||||
}
|
||||
else return true;
|
||||
}
|
||||
|
||||
|
||||
bool OneSixInstance::reloadFullVersion()
|
||||
{
|
||||
I_D(OneSixInstance);
|
||||
|
@ -41,6 +41,10 @@ public:
|
||||
bool reloadFullVersion();
|
||||
/// get the current full version info
|
||||
QSharedPointer<OneSixVersion> getFullVersion();
|
||||
/// revert the current custom version back to base
|
||||
bool revertCustomVersion();
|
||||
/// customize the current base version
|
||||
bool customizeVersion();
|
||||
/// is the current version original, or custom?
|
||||
bool versionIsCustom();
|
||||
|
||||
|
@ -220,6 +220,7 @@ void ForgeListLoadTask::list_downloaded()
|
||||
QJsonArray files = obj.value("files").toArray();
|
||||
QString url, jobbuildver, mcver, buildtype, filename;
|
||||
QString changelog_url, installer_url;
|
||||
QString installer_filename;
|
||||
bool valid = false;
|
||||
for(int j = 0; j < files.count(); j++)
|
||||
{
|
||||
@ -246,6 +247,8 @@ void ForgeListLoadTask::list_downloaded()
|
||||
else if(buildtype == "installer")
|
||||
{
|
||||
installer_url = file.value("url").toString();
|
||||
int lastSlash = installer_url.lastIndexOf('/');
|
||||
installer_filename = installer_url.mid(lastSlash+1);
|
||||
}
|
||||
}
|
||||
if(valid)
|
||||
@ -258,6 +261,7 @@ void ForgeListLoadTask::list_downloaded()
|
||||
fVersion->jobbuildver = jobbuildver;
|
||||
fVersion->mcver = mcver;
|
||||
fVersion->filename = filename;
|
||||
fVersion->filename = installer_filename;
|
||||
fVersion->m_buildnr = build_nr;
|
||||
tempList.append(fVersion);
|
||||
}
|
||||
|
Reference in New Issue
Block a user