From 626f438dcc4de7a2581f630356dce91bd5717cba Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Tue, 27 Feb 2024 01:09:46 +0000 Subject: [PATCH] Make builtin.omwscripts actually mandatory Previously it was quasi-mandatory - lots of things would add it, e.g. when running openmw through the CS, but it could technically be disabled. Now it's treated like the resources/vfs directory and implicitly added by the engine etc. --- apps/bulletobjecttool/main.cpp | 4 +++- apps/navmeshtool/main.cpp | 4 +++- apps/opencs/model/doc/runner.cpp | 1 - apps/openmw/main.cpp | 3 ++- components/contentselector/model/contentmodel.cpp | 4 ---- files/openmw.cfg | 1 - files/openmw.cfg.local | 1 - 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/bulletobjecttool/main.cpp b/apps/bulletobjecttool/main.cpp index 884c196e53..b27c8135d6 100644 --- a/apps/bulletobjecttool/main.cpp +++ b/apps/bulletobjecttool/main.cpp @@ -146,7 +146,9 @@ namespace dataDirs.insert(dataDirs.begin(), resDir / "vfs"); const Files::Collections fileCollections(dataDirs); const auto& archives = variables["fallback-archive"].as(); - const auto& contentFiles = variables["content"].as(); + StringsVector contentFiles{ "builtin.omwscripts" }; + const auto& configContentFiles = variables["content"].as(); + contentFiles.insert(contentFiles.end(), configContentFiles.begin(), configContentFiles.end()); Fallback::Map::init(variables["fallback"].as().mMap); diff --git a/apps/navmeshtool/main.cpp b/apps/navmeshtool/main.cpp index 3ec34114af..94ab7ef082 100644 --- a/apps/navmeshtool/main.cpp +++ b/apps/navmeshtool/main.cpp @@ -165,7 +165,9 @@ namespace NavMeshTool dataDirs.insert(dataDirs.begin(), resDir / "vfs"); const Files::Collections fileCollections(dataDirs); const auto& archives = variables["fallback-archive"].as(); - const auto& contentFiles = variables["content"].as(); + StringsVector contentFiles{ "builtin.omwscripts" }; + const auto& configContentFiles = variables["content"].as(); + contentFiles.insert(contentFiles.end(), configContentFiles.begin(), configContentFiles.end()); const std::size_t threadsNumber = variables["threads"].as(); if (threadsNumber < 1) diff --git a/apps/opencs/model/doc/runner.cpp b/apps/opencs/model/doc/runner.cpp index 0099cb2f94..d647d6b498 100644 --- a/apps/opencs/model/doc/runner.cpp +++ b/apps/opencs/model/doc/runner.cpp @@ -93,7 +93,6 @@ void CSMDoc::Runner::start(bool delayed) arguments << "--data=\"" + Files::pathToQString(mProjectPath.parent_path()) + "\""; arguments << "--replace=content"; - arguments << "--content=builtin.omwscripts"; for (const auto& mContentFile : mContentFiles) { diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 5bbc0211c1..beaa452f19 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -108,7 +108,8 @@ bool parseOptions(int argc, char** argv, OMW::Engine& engine, Files::Configurati Log(Debug::Error) << "No content file given (esm/esp, nor omwgame/omwaddon). Aborting..."; return false; } - std::set contentDedupe; + engine.addContentFile("builtin.omwscripts"); + std::set contentDedupe{ "builtin.omwscripts" }; for (const auto& contentFile : content) { if (!contentDedupe.insert(contentFile).second) diff --git a/components/contentselector/model/contentmodel.cpp b/components/contentselector/model/contentmodel.cpp index d800112712..377edc3b1c 100644 --- a/components/contentselector/model/contentmodel.cpp +++ b/components/contentselector/model/contentmodel.cpp @@ -434,10 +434,6 @@ void ContentSelectorModel::ContentModel::addFiles(const QString& path, bool newf { QFileInfo info(dir.absoluteFilePath(path2)); - // Enabled by default in system openmw.cfg; shouldn't be shown in content list. - if (info.fileName().compare("builtin.omwscripts", Qt::CaseInsensitive) == 0) - continue; - EsmFile* file = const_cast(item(info.fileName())); bool add = file == nullptr; std::unique_ptr newFile; diff --git a/files/openmw.cfg b/files/openmw.cfg index 37ecda3b1d..20e11323cf 100644 --- a/files/openmw.cfg +++ b/files/openmw.cfg @@ -2,7 +2,6 @@ # Modifications should be done on the user openmw.cfg file instead # (see: https://openmw.readthedocs.io/en/master/reference/modding/paths.html) -content=builtin.omwscripts data-local="?userdata?data" user-data="?userdata?" config="?userconfig?" diff --git a/files/openmw.cfg.local b/files/openmw.cfg.local index c9949f2447..65f8b31136 100644 --- a/files/openmw.cfg.local +++ b/files/openmw.cfg.local @@ -2,7 +2,6 @@ # Modifications should be done on the user openmw.cfg file instead # (see: https://openmw.readthedocs.io/en/master/reference/modding/paths.html) -content=builtin.omwscripts data-local="?userdata?data" user-data="?userdata?" config="?userconfig?"