Fix dev plugin dependency loading when not auto-load

This commit is contained in:
Raymond 2021-12-27 10:29:59 -05:00
parent 264c85b0dc
commit c0545c0b52
2 changed files with 15 additions and 5 deletions

View file

@ -1606,7 +1606,7 @@ namespace Dalamud.Interface.Internal.Windows
if (!enableTask.Result)
return;
var loadTask = Task.Run(() => plugin.Load(PluginLoadReason.Installer, plugin is LocalDevPlugin))
var loadTask = Task.Run(() => plugin.Load(PluginLoadReason.Installer))
.ContinueWith(this.DisplayErrorContinuation, Locs.ErrorModal_LoadFail(plugin.Name));
loadTask.Wait();

View file

@ -271,13 +271,23 @@ namespace Dalamud.Plugin.Internal
{
this.loader ??= PluginLoader.CreateFromAssemblyFile(this.DllFile.FullName, this.SetupLoaderConfig);
if (reloading)
if (reloading || this.IsDev)
{
this.loader.Reload();
// Reload the manifest in-case there were changes here too.
if (this.IsDev)
{
// If a dev plugin is set to not autoload on boot, but we want to reload it at the arbitrary load
// time, we need to essentially "Unload" the plugin, but we can't call plugin.Unload because of the
// load state checks. Null any references to the assembly and types, then proceed with regular reload
// operations.
this.pluginAssembly = null;
this.pluginType = null;
}
this.loader.Reload();
if (this.IsDev)
{
// Reload the manifest in-case there were changes here too.
var manifestFile = LocalPluginManifest.GetManifestFile(this.DllFile);
if (manifestFile.Exists)
{