From 4b2afc2e5fccabed97becb6976bda9a590e2f652 Mon Sep 17 00:00:00 2001 From: andruzzzhka Date: Wed, 16 May 2018 19:02:04 +0700 Subject: [PATCH] Fixed plugins that referenced other plugins (like BeatSaverDownloader) --- IllusionInjector/PluginManager.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/IllusionInjector/PluginManager.cs b/IllusionInjector/PluginManager.cs index 4d5e8b38..de9fb691 100644 --- a/IllusionInjector/PluginManager.cs +++ b/IllusionInjector/PluginManager.cs @@ -57,13 +57,20 @@ namespace IllusionInjector } } - String[] files = Directory.GetFiles(pluginDirectory, "*.dll"); - foreach (string s in files) + //Copy plugins to .cache + string[] originalPlugins = Directory.GetFiles(pluginDirectory, "*.dll"); + foreach (string s in originalPlugins) { - string pluginCopy = pluginDirectory + "\\.cache" + s.Substring(s.LastIndexOf('\\')); File.Copy(Path.Combine(pluginDirectory, s), pluginCopy); - _Plugins.AddRange(LoadPluginsFromFile(pluginCopy, exeName)); + } + + //Load copied plugins + string copiedPluginsDirectory = pluginDirectory + "\\.cache"; + string[] copiedPlugins = Directory.GetFiles(copiedPluginsDirectory, "*.dll"); + foreach (string s in copiedPlugins) + { + _Plugins.AddRange(LoadPluginsFromFile(s, exeName)); }