diff options
author | rubenwardy <rw@rubenwardy.com> | 2022-05-07 16:44:46 +0100 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2022-07-14 22:12:54 +0100 |
commit | 06de82fd86678e0a1c260c67792c5cd192863edd (patch) | |
tree | 82f7fb040860fd3d099ddce43be2710b120da083 /src/client | |
parent | 1d512ef7f4071fadf10078825ce83e77a3707f06 (diff) | |
download | minetest-06de82fd86678e0a1c260c67792c5cd192863edd.tar.gz minetest-06de82fd86678e0a1c260c67792c5cd192863edd.tar.bz2 minetest-06de82fd86678e0a1c260c67792c5cd192863edd.zip |
Refactor ModConfiguration
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/client.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp index 0f8297080..31bbf2463 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -58,6 +58,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "game.h" #include "chatmessage.h" #include "translation.h" +#include "content/mod_configuration.h" extern gui::IGUIEnvironment* guienv; @@ -196,7 +197,21 @@ void Client::loadMods() scanModIntoMemory(BUILTIN_MOD_NAME, getBuiltinLuaPath()); m_script->loadModFromMemory(BUILTIN_MOD_NAME); - ClientModConfiguration modconf(getClientModsLuaPath()); + ModConfiguration modconf; + { + std::unordered_map<std::string, std::string> paths; + std::string path_user = porting::path_user + DIR_DELIM + "clientmods"; + const auto modsPath = getClientModsLuaPath(); + if (modsPath != path_user) { + paths["share"] = modsPath; + } + paths["mods"] = path_user; + + std::string settings_path = path_user + DIR_DELIM + "mods.conf"; + modconf.addModsFromConfig(settings_path, paths); + modconf.checkConflictsAndDeps(); + } + m_mods = modconf.getMods(); // complain about mods with unsatisfied dependencies if (!modconf.isConsistent()) { |