Support loading plugins from subdirs (#460)

Support loading plugins from subdirs to allow for better organising plugins and easier mod-manager installation
This commit is contained in:
cat_or_not 2023-05-05 12:20:51 -04:00 committed by GitHub
parent 6fa48abd33
commit 6857b93f62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -52,8 +52,8 @@ std::optional<Plugin> PluginManager::LoadPlugin(fs::path path, PluginInitFuncs*
Plugin plugin {};
std::string pathstring = (pluginPath / path).string();
std::wstring wpath = (pluginPath / path).wstring();
std::string pathstring = path.string();
std::wstring wpath = path.wstring();
LPCWSTR wpptr = wpath.c_str();
HMODULE datafile = LoadLibraryExW(wpptr, 0, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE); // Load the DLL as a data file
@ -222,7 +222,7 @@ bool PluginManager::LoadPlugins()
for (auto const& entry : iterator)
{
if (fs::is_regular_file(entry) && entry.path().extension() == ".dll")
paths.emplace_back(entry.path().filename());
paths.emplace_back(entry.path());
}
for (fs::path path : paths)
{