mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 18:59:57 +00:00
AddOn files can be checked if game file is checked, but dependencies do not exist.
This commit is contained in:
parent
cc815c63f1
commit
9d61457956
1 changed files with 5 additions and 11 deletions
|
@ -110,15 +110,14 @@ Qt::ItemFlags ContentSelectorModel::ContentModel::flags(const QModelIndex &index
|
||||||
if (!file)
|
if (!file)
|
||||||
return Qt::NoItemFlags;
|
return Qt::NoItemFlags;
|
||||||
|
|
||||||
//game files can always be checked
|
//game files are not shown
|
||||||
if (file->isGameFile())
|
if (file->isGameFile())
|
||||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
|
return Qt::NoItemFlags;
|
||||||
|
|
||||||
Qt::ItemFlags returnFlags;
|
Qt::ItemFlags returnFlags;
|
||||||
bool allDependenciesFound = true;
|
|
||||||
bool gamefileChecked = false;
|
bool gamefileChecked = false;
|
||||||
|
|
||||||
//addon can be checked if its gamefile is and all other dependencies exist
|
// addon can be checked if its gamefile is
|
||||||
foreach (const QString &fileName, file->gameFiles())
|
foreach (const QString &fileName, file->gameFiles())
|
||||||
{
|
{
|
||||||
bool depFound = false;
|
bool depFound = false;
|
||||||
|
@ -144,16 +143,11 @@ Qt::ItemFlags ContentSelectorModel::ContentModel::flags(const QModelIndex &index
|
||||||
if (gamefileChecked || !(dependency->isGameFile()))
|
if (gamefileChecked || !(dependency->isGameFile()))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
allDependenciesFound = allDependenciesFound && depFound;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gamefileChecked)
|
if (gamefileChecked)
|
||||||
{
|
{
|
||||||
if (allDependenciesFound)
|
returnFlags = Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsDragEnabled;
|
||||||
returnFlags = returnFlags | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsDragEnabled;
|
|
||||||
else
|
|
||||||
returnFlags = Qt::ItemIsSelectable;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnFlags;
|
return returnFlags;
|
||||||
|
@ -468,7 +462,7 @@ void ContentSelectorModel::ContentModel::addFiles(const QString &path)
|
||||||
file->setDescription(QString::fromUtf8(fileReader.getDesc().c_str()));
|
file->setDescription(QString::fromUtf8(fileReader.getDesc().c_str()));
|
||||||
|
|
||||||
// HACK
|
// HACK
|
||||||
// Bloodmoon.esm requires Tribunal.esm, but this requirement is missing
|
// Load order constraint of Bloodmoon.esm needing Tribunal.esm is missing
|
||||||
// from the file supplied by Bethesda, so we have to add it ourselves
|
// from the file supplied by Bethesda, so we have to add it ourselves
|
||||||
if (file->fileName().compare("Bloodmoon.esm", Qt::CaseInsensitive) == 0)
|
if (file->fileName().compare("Bloodmoon.esm", Qt::CaseInsensitive) == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue