summaryrefslogtreecommitdiff
path: root/src/modinfo.cpp
diff options
context:
space:
mode:
authorJeremy Rimpo <jeremy.rimpo@servermonkey.com>2017-12-13 13:10:09 -0600
committerGitHub <noreply@github.com>2017-12-13 13:10:09 -0600
commit062e0cce2de4fd86a9842a88c2bb65936f1ab115 (patch)
treeb905a4c8280bdce21324b13050af72770dc05680 /src/modinfo.cpp
parent2226a483d1415a315d7b558b0e2dc9919dfa858b (diff)
parent027f941bb10b9dde2207d1eaa316bd63b4f8e9d4 (diff)
Merge pull request #145 from Silarn/mainline_dev
A number of fixes and improvements
Diffstat (limited to 'src/modinfo.cpp')
-rw-r--r--src/modinfo.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/modinfo.cpp b/src/modinfo.cpp
index 77df6216..4f74086f 100644
--- a/src/modinfo.cpp
+++ b/src/modinfo.cpp
@@ -79,10 +79,11 @@ ModInfo::Ptr ModInfo::createFrom(const QDir &dir, DirectoryEntry **directoryStru
ModInfo::Ptr ModInfo::createFromPlugin(const QString &modName,
const QString &espName,
const QStringList &bsaNames,
+ ModInfo::EModType modType,
DirectoryEntry **directoryStructure) {
QMutexLocker locker(&s_Mutex);
ModInfo::Ptr result = ModInfo::Ptr(
- new ModInfoForeign(modName, espName, bsaNames, directoryStructure));
+ new ModInfoForeign(modName, espName, bsaNames, modType, directoryStructure));
s_Collection.push_back(result);
return result;
}
@@ -224,9 +225,13 @@ void ModInfo::updateFromDisc(const QString &modDirectory,
UnmanagedMods *unmanaged = game->feature<UnmanagedMods>();
if (unmanaged != nullptr) {
for (const QString &modName : unmanaged->mods(!displayForeign)) {
+ ModInfo::EModType modType = game->DLCPlugins().contains(unmanaged->referenceFile(modName).fileName(), Qt::CaseInsensitive) ? ModInfo::EModType::MOD_DLC :
+ (game->CCPlugins().contains(unmanaged->referenceFile(modName).fileName(), Qt::CaseInsensitive) ? ModInfo::EModType::MOD_CC : ModInfo::EModType::MOD_DEFAULT);
+
createFromPlugin(unmanaged->displayName(modName),
unmanaged->referenceFile(modName).absoluteFilePath(),
unmanaged->secondaryFiles(modName),
+ modType,
directoryStructure);
}
}