aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NorthstarDLL/mods/modmanager.cpp15
-rw-r--r--NorthstarDLL/mods/modmanager.h1
2 files changed, 13 insertions, 3 deletions
diff --git a/NorthstarDLL/mods/modmanager.cpp b/NorthstarDLL/mods/modmanager.cpp
index a47aa854..38966236 100644
--- a/NorthstarDLL/mods/modmanager.cpp
+++ b/NorthstarDLL/mods/modmanager.cpp
@@ -354,6 +354,7 @@ void ModManager::LoadMods()
// ensure dirs exist
fs::remove_all(GetCompiledAssetsPath());
fs::create_directories(GetModFolderPath());
+ fs::create_directories(GetRemoteModFolderPath());
m_DependencyConstants.clear();
@@ -374,9 +375,13 @@ void ModManager::LoadMods()
}
// get mod directories
- for (fs::directory_entry dir : fs::directory_iterator(GetModFolderPath()))
- if (fs::exists(dir.path() / "mod.json"))
- modDirs.push_back(dir.path());
+ std::filesystem::directory_iterator classicModsDir = fs::directory_iterator(GetModFolderPath());
+ std::filesystem::directory_iterator remoteModsDir = fs::directory_iterator(GetRemoteModFolderPath());
+
+ for (std::filesystem::directory_iterator modIterator : {classicModsDir, remoteModsDir})
+ for (fs::directory_entry dir : modIterator)
+ if (fs::exists(dir.path() / "mod.json"))
+ modDirs.push_back(dir.path());
for (fs::path modDir : modDirs)
{
@@ -805,6 +810,10 @@ fs::path GetModFolderPath()
{
return fs::path(GetNorthstarPrefix() + MOD_FOLDER_SUFFIX);
}
+fs::path GetRemoteModFolderPath()
+{
+ return fs::path(GetNorthstarPrefix() + REMOTE_MOD_FOLDER_SUFFIX);
+}
fs::path GetCompiledAssetsPath()
{
return fs::path(GetNorthstarPrefix() + COMPILED_ASSETS_SUFFIX);
diff --git a/NorthstarDLL/mods/modmanager.h b/NorthstarDLL/mods/modmanager.h
index ded6ff06..c2335d09 100644
--- a/NorthstarDLL/mods/modmanager.h
+++ b/NorthstarDLL/mods/modmanager.h
@@ -161,6 +161,7 @@ class ModManager
};
fs::path GetModFolderPath();
+fs::path GetRemoteModFolderPath();
fs::path GetCompiledAssetsPath();
extern ModManager* g_pModManager;