Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support openmw file types #1994

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,9 @@ void MainWindow::updateBSAList(const QStringList& defaultArchives,
m_OrganizerCore.findFiles("", [](const QString& fileName) -> bool {
return fileName.endsWith(".esp", Qt::CaseInsensitive) ||
fileName.endsWith(".esm", Qt::CaseInsensitive) ||
fileName.endsWith(".esl", Qt::CaseInsensitive);
fileName.endsWith(".esl", Qt::CaseInsensitive) ||
fileName.endsWith(".omwaddon", Qt::CaseInsensitive) ||
fileName.endsWith(".omwscripts", Qt::CaseInsensitive);
});

auto hasAssociatedPlugin = [&](const QString& bsaName) -> bool {
Expand Down
3 changes: 2 additions & 1 deletion src/modinfodialogesps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ void ESPsTab::clear()

bool ESPsTab::feedFile(const QString& rootPath, const QString& fullPath)
{
static const QString extensions[] = {".esp", ".esm", ".esl"};
static const QString extensions[] = {".esp", ".esm", ".esl", ".omwaddon",
".omwscripts"};

for (const auto& e : extensions) {
if (fullPath.endsWith(e, Qt::CaseInsensitive)) {
Expand Down
35 changes: 35 additions & 0 deletions src/organizercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,41 @@ void OrganizerCore::updateModsActiveState(const QList<unsigned int>& modIndices,
++enabled;
}
}

QStringList omwaddons = dir.entryList(QStringList() << "*.omwaddon", QDir::Files);
for (const QString& omwaddon : omwaddons) {
const FileEntryPtr file = m_DirectoryStructure->findFile(ToWString(omwaddon));
if (file.get() == nullptr) {
log::warn("failed to activate {}", omwaddon);
continue;
}

if (active != m_PluginList.isEnabled(omwaddon) &&
file->getAlternatives().empty()) {
m_PluginList.blockSignals(true);
m_PluginList.enableESP(omwaddon, active);
m_PluginList.blockSignals(false);
++enabled;
}
}

QStringList omwscripts =
dir.entryList(QStringList() << "*.omwscripts", QDir::Files);
for (const QString& omwscript : omwscripts) {
const FileEntryPtr file = m_DirectoryStructure->findFile(ToWString(omwscript));
if (file.get() == nullptr) {
log::warn("failed to activate {}", omwscript);
continue;
}

if (active != m_PluginList.isEnabled(omwscript) &&
file->getAlternatives().empty()) {
m_PluginList.blockSignals(true);
m_PluginList.enableESP(omwscript, active);
m_PluginList.blockSignals(false);
++enabled;
}
}
}
if (active && (enabled > 1)) {
MessageDialog::showMessage(
Expand Down
8 changes: 6 additions & 2 deletions src/pluginlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ void PluginList::highlightPlugins(const std::vector<unsigned int>& modIndices,
QDir dir(selectedMod->absolutePath());
QStringList plugins = dir.entryList(QStringList() << "*.esp"
<< "*.esm"
<< "*.esl");
<< "*.esl"
<< "*.omwaddon"
<< "*.omwscripts");
const MOShared::FilesOrigin& origin =
directoryEntry.getOriginByName(selectedMod->internalName().toStdWString());
if (plugins.size() > 0) {
Expand Down Expand Up @@ -196,7 +198,9 @@ void PluginList::refresh(const QString& profileName,

if (filename.endsWith(".esp", Qt::CaseInsensitive) ||
filename.endsWith(".esm", Qt::CaseInsensitive) ||
filename.endsWith(".esl", Qt::CaseInsensitive)) {
filename.endsWith(".esl", Qt::CaseInsensitive) ||
filename.endsWith(".omwaddon", Qt::CaseInsensitive) ||
filename.endsWith(".omwscripts", Qt::CaseInsensitive)) {

availablePlugins.append(filename);

Expand Down