diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 20781be76..2c62e7319 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1926,16 +1926,11 @@ void MainWindow::updateBSAList(const QStringList& defaultArchives, m_OrganizerCore.managedGame()->feature(); std::vector files = m_OrganizerCore.directoryStructure()->getFiles(); - GamePlugins* gamePlugins = m_OrganizerCore.managedGame()->feature(); - bool supportsLight = false; - if (gamePlugins) { - supportsLight = gamePlugins->lightPluginsAreSupported(); - } QStringList plugins = - m_OrganizerCore.findFiles("", [supportsLight](const QString& fileName) -> bool { + m_OrganizerCore.findFiles("", [](const QString& fileName) -> bool { return fileName.endsWith(".esp", Qt::CaseInsensitive) || fileName.endsWith(".esm", Qt::CaseInsensitive) || - (supportsLight && fileName.endsWith(".esl", Qt::CaseInsensitive)); + fileName.endsWith(".esl", Qt::CaseInsensitive); }); auto hasAssociatedPlugin = [&](const QString& bsaName) -> bool { diff --git a/src/modinfodialogesps.cpp b/src/modinfodialogesps.cpp index 47ffb250a..f9a3ba8c8 100644 --- a/src/modinfodialogesps.cpp +++ b/src/modinfodialogesps.cpp @@ -5,8 +5,6 @@ #include #include -#include "gameplugins.h" - using namespace MOBase; class ESPItem @@ -219,12 +217,7 @@ void ESPsTab::clear() bool ESPsTab::feedFile(const QString& rootPath, const QString& fullPath) { - QStringList extensions = QStringList() << ".esp" - << ".esm"; - GamePlugins* gamePlugins = core().managedGame()->feature(); - if (gamePlugins && gamePlugins->lightPluginsAreSupported()) { - extensions << ".esl"; - } + static const QString extensions[] = {".esp", ".esm", ".esl"}; for (const auto& e : extensions) { if (fullPath.endsWith(e, Qt::CaseInsensitive)) { diff --git a/src/organizercore.cpp b/src/organizercore.cpp index f38f08426..5bc3851cc 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -71,7 +71,6 @@ #include #include -#include "gameplugins.h" #include "organizerproxy.h" using namespace MOShared; @@ -1318,21 +1317,18 @@ void OrganizerCore::updateModsActiveState(const QList& modIndices, } } - GamePlugins* gamePlugins = managedGame()->feature(); - if (gamePlugins && gamePlugins->lightPluginsAreSupported()) { - for (const QString& esl : dir.entryList(QStringList() << "*.esl", QDir::Files)) { - const FileEntryPtr file = m_DirectoryStructure->findFile(ToWString(esl)); - if (file.get() == nullptr) { - log::warn("failed to activate {}", esl); - continue; - } + for (const QString& esl : dir.entryList(QStringList() << "*.esl", QDir::Files)) { + const FileEntryPtr file = m_DirectoryStructure->findFile(ToWString(esl)); + if (file.get() == nullptr) { + log::warn("failed to activate {}", esl); + continue; + } - if (active != m_PluginList.isEnabled(esl) && file->getAlternatives().empty()) { - m_PluginList.blockSignals(true); - m_PluginList.enableESP(esl, active); - m_PluginList.blockSignals(false); - ++enabled; - } + if (active != m_PluginList.isEnabled(esl) && file->getAlternatives().empty()) { + m_PluginList.blockSignals(true); + m_PluginList.enableESP(esl, active); + m_PluginList.blockSignals(false); + ++enabled; } } QStringList esps = dir.entryList(QStringList() << "*.esp", QDir::Files); diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index e2808e72e..b1fd97579 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -132,12 +132,9 @@ void PluginList::highlightPlugins(const std::vector& modIndices, ModInfo::Ptr selectedMod = ModInfo::getByIndex(modIndex); if (!selectedMod.isNull() && profile->modEnabled(modIndex)) { QDir dir(selectedMod->absolutePath()); - QStringList extensions = QStringList() << "*.esp" - << "*.esm"; - if (m_GamePlugin->feature()->lightPluginsAreSupported()) { - extensions << "*.esl"; - } - QStringList plugins = dir.entryList(extensions); + QStringList plugins = dir.entryList(QStringList() << "*.esp" + << "*.esm" + << "*.esl"); const MOShared::FilesOrigin& origin = directoryEntry.getOriginByName(selectedMod->internalName().toStdWString()); if (plugins.size() > 0) { @@ -199,7 +196,7 @@ void PluginList::refresh(const QString& profileName, if (filename.endsWith(".esp", Qt::CaseInsensitive) || filename.endsWith(".esm", Qt::CaseInsensitive) || - (lightPluginsAreSupported && filename.endsWith(".esl", Qt::CaseInsensitive))) { + filename.endsWith(".esl", Qt::CaseInsensitive)) { availablePlugins.append(filename); @@ -213,6 +210,9 @@ void PluginList::refresh(const QString& profileName, bool forceDisabled = m_GamePlugin->loadOrderMechanism() == IPluginGame::LoadOrderMechanism::None && !forceLoaded && !forceEnabled; + if (!lightPluginsAreSupported && filename.endsWith(".esl")) { + forceDisabled = true; + } bool archive = false; try { @@ -1358,8 +1358,13 @@ QVariant PluginList::tooltipData(const QModelIndex& modelIndex) const } if (esp.forceDisabled) { - toolTip += "

" + tr("This game does not currently permit custom plugin " - "loading. There may be manual workarounds."); + if (m_GamePlugin->feature() && esp.hasLightExtension && + !m_GamePlugin->feature()->lightPluginsAreSupported()) { + toolTip += "

" + tr("Light plugins (ESL) are not supported by this game."); + } else { + toolTip += "

" + tr("This game does not currently permit custom plugin " + "loading. There may be manual workarounds."); + } } // additional info @@ -1807,7 +1812,7 @@ PluginList::ESPInfo::ESPInfo(const QString& name, bool forceLoaded, bool forceEn ESP::File file(ToWString(fullPath)); auto extension = name.right(3).toLower(); hasMasterExtension = (extension == "esm"); - hasLightExtension = lightSupported && (extension == "esl"); + hasLightExtension = (extension == "esl"); isMasterFlagged = file.isMaster(); isOverlayFlagged = overlaySupported && file.isOverlay(); isLightFlagged =