diff options
author | F1F7Y <64418963+F1F7Y@users.noreply.github.com> | 2023-07-02 13:24:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-02 13:24:41 +0200 |
commit | 10cb6e53ac9cc2536726445ab6782d22a74e71b8 (patch) | |
tree | e03db820dbf2ce76f3de079081cec01ac9350084 | |
parent | e4de2f314516d1432022537880eb6347e33e5cf4 (diff) | |
download | NorthstarLauncher-1.16.0-rc2.tar.gz NorthstarLauncher-1.16.0-rc2.zip |
Basic mods blacklisting (#474)v1.16.0-rc2v1.16.0
-rw-r--r-- | NorthstarDLL/mods/modmanager.cpp | 7 | ||||
-rw-r--r-- | NorthstarDLL/mods/modmanager.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/NorthstarDLL/mods/modmanager.cpp b/NorthstarDLL/mods/modmanager.cpp index 8ac9ac54..cdfe5384 100644 --- a/NorthstarDLL/mods/modmanager.cpp +++ b/NorthstarDLL/mods/modmanager.cpp @@ -56,6 +56,13 @@ Mod::Mod(fs::path modDir, char* jsonBuf) Name = modJson["Name"].GetString(); + // Don't load blacklisted mods + if (!strstr(GetCommandLineA(), "-nomodblacklist") && MODS_BLACKLIST.find(Name) != std::end(MODS_BLACKLIST)) + { + spdlog::warn("Skipping blacklisted mod \"{}\"!", Name); + return; + } + if (modJson.HasMember("Description")) Description = modJson["Description"].GetString(); else diff --git a/NorthstarDLL/mods/modmanager.h b/NorthstarDLL/mods/modmanager.h index a4c72f77..c25c95ba 100644 --- a/NorthstarDLL/mods/modmanager.h +++ b/NorthstarDLL/mods/modmanager.h @@ -13,6 +13,8 @@ const std::string REMOTE_MOD_FOLDER_SUFFIX = "/runtime/remote/mods"; const fs::path MOD_OVERRIDE_DIR = "mod"; const std::string COMPILED_ASSETS_SUFFIX = "/runtime/compiled"; +const std::set<std::string> MODS_BLACKLIST = {"Mod Settings"}; + struct ModConVar { public: |