summaryrefslogtreecommitdiff
path: root/src/modinforegular.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modinforegular.cpp')
-rw-r--r--src/modinforegular.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/modinforegular.cpp b/src/modinforegular.cpp
index 231e5497..9d94002b 100644
--- a/src/modinforegular.cpp
+++ b/src/modinforegular.cpp
@@ -420,6 +420,9 @@ std::vector<ModInfo::EFlag> ModInfoRegular::getFlags() const
if (m_Notes.length() != 0) {
result.push_back(ModInfo::FLAG_NOTES);
}
+ if (m_PluginSelected) {
+ result.push_back(ModInfo::FLAG_PLUGIN_SELECTED);
+ }
return result;
}
@@ -430,7 +433,7 @@ std::vector<ModInfo::EContent> ModInfoRegular::getContents() const
if (m_LastContentCheck.isNull() || (m_LastContentCheck.secsTo(now) > 60)) {
m_CachedContent.clear();
QDir dir(absolutePath());
- if (dir.entryList(QStringList() << "*.esp" << "*.esm").size() > 0) {
+ if (dir.entryList(QStringList() << "*.esp" << "*.esm" << "*.esl").size() > 0) {
m_CachedContent.push_back(CONTENT_PLUGIN);
}
if (dir.entryList(QStringList() << "*.bsa" << "*.ba2").size() > 0) {
@@ -442,7 +445,7 @@ std::vector<ModInfo::EContent> ModInfoRegular::getContents() const
->feature<ScriptExtender>();
if (extender != nullptr) {
- QString sePluginPath = extender->name() + "/plugins";
+ QString sePluginPath = extender->PluginPath();
if (dir.exists(sePluginPath))
m_CachedContent.push_back(CONTENT_SKSE);
}
@@ -458,6 +461,8 @@ std::vector<ModInfo::EContent> ModInfoRegular::getContents() const
m_CachedContent.push_back(CONTENT_SCRIPT);
if (dir.exists("SkyProc Patchers"))
m_CachedContent.push_back(CONTENT_SKYPROC);
+ if (dir.exists("MCM"))
+ m_CachedContent.push_back(CONTENT_MCM);
m_LastContentCheck = QTime::currentTime();
}
@@ -469,14 +474,19 @@ std::vector<ModInfo::EContent> ModInfoRegular::getContents() const
int ModInfoRegular::getHighlight() const
{
- return isValid() ? HIGHLIGHT_NONE: HIGHLIGHT_INVALID;
+ if (!isValid())
+ return HIGHLIGHT_INVALID;
+ auto flags = getFlags();
+ if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_PLUGIN_SELECTED) != flags.end())
+ return HIGHLIGHT_PLUGIN;
+ return HIGHLIGHT_NONE;
}
QString ModInfoRegular::getDescription() const
{
if (!isValid()) {
- return tr("%1 contains no esp/esm and no asset (textures, meshes, interface, ...) directory").arg(name());
+ return tr("%1 contains no esp/esm/esl and no asset (textures, meshes, interface, ...) directory").arg(name());
} else {
const std::set<int> &categories = getCategories();
std::wostringstream categoryString;