NOISSUE preview of LWJGL version changing
It still needs work - some LWJGL versions are exclusive to macOS. This has to be encoded in the json.
This commit is contained in:
@ -1,3 +1,6 @@
|
||||
#include <meta/VersionList.h>
|
||||
#include <meta/Index.h>
|
||||
#include <Env.h>
|
||||
#include "ProfilePatch.h"
|
||||
|
||||
#include "meta/Version.h"
|
||||
@ -35,6 +38,15 @@ std::shared_ptr<class VersionFile> ProfilePatch::getVersionFile()
|
||||
return m_file;
|
||||
}
|
||||
|
||||
std::shared_ptr<class Meta::VersionList> ProfilePatch::getVersionList()
|
||||
{
|
||||
if(m_metaVersion)
|
||||
{
|
||||
return ENV.metadataIndex()->get(m_metaVersion->uid());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int ProfilePatch::getOrder()
|
||||
{
|
||||
if(m_orderOverride)
|
||||
@ -113,6 +125,15 @@ bool ProfilePatch::isMoveable()
|
||||
}
|
||||
bool ProfilePatch::isVersionChangeable()
|
||||
{
|
||||
auto list = getVersionList();
|
||||
if(list)
|
||||
{
|
||||
if(!list->isLoaded())
|
||||
{
|
||||
list->load();
|
||||
}
|
||||
return list->count() != 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -132,3 +153,23 @@ void ProfilePatch::setMovable (bool state)
|
||||
{
|
||||
m_isMovable = state;
|
||||
}
|
||||
|
||||
ProblemSeverity ProfilePatch::getProblemSeverity()
|
||||
{
|
||||
auto file = getVersionFile();
|
||||
if(file)
|
||||
{
|
||||
return file->getProblemSeverity();
|
||||
}
|
||||
return ProblemSeverity::Error;
|
||||
}
|
||||
|
||||
const QList<PatchProblem> ProfilePatch::getProblems()
|
||||
{
|
||||
auto file = getVersionFile();
|
||||
if(file)
|
||||
{
|
||||
return file->getProblems();
|
||||
}
|
||||
return {PatchProblem(ProblemSeverity::Error, QObject::tr("Patch is not loaded yet."))};
|
||||
}
|
||||
|
Reference in New Issue
Block a user