From 9890f0c6770274f8e64d2c97857189d18ce14522 Mon Sep 17 00:00:00 2001
From: Aireil <33433913+Aireil@users.noreply.github.com>
Date: Mon, 12 Sep 2022 04:03:04 +0200
Subject: [PATCH] feat: reload manifest before trying to load when
hot-reloading
---
Dalamud/Plugin/Internal/Types/LocalPlugin.cs | 22 ++++++++++----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/Dalamud/Plugin/Internal/Types/LocalPlugin.cs b/Dalamud/Plugin/Internal/Types/LocalPlugin.cs
index da4872ca0..38a0c691e 100644
--- a/Dalamud/Plugin/Internal/Types/LocalPlugin.cs
+++ b/Dalamud/Plugin/Internal/Types/LocalPlugin.cs
@@ -217,7 +217,7 @@ internal class LocalPlugin : IDisposable
///
/// Gets a value indicating whether or not this plugin is orphaned(belongs to a repo) or not.
///
- public bool IsOrphaned => !this.IsDev &&
+ public bool IsOrphaned => !this.IsDev &&
!this.Manifest.InstalledFromUrl.IsNullOrEmpty() && // TODO(api8): Remove this, all plugins will have a proper flag
Service.Get().Repos.All(x => x.PluginMasterUrl != this.Manifest.InstalledFromUrl) &&
this.Manifest.InstalledFromUrl != LocalPluginManifest.FlagMainRepo;
@@ -285,6 +285,16 @@ internal class LocalPlugin : IDisposable
await this.pluginLoadStateLock.WaitAsync();
try
{
+ if (reloading && this.IsDev)
+ {
+ // Reload the manifest in-case there were changes here too.
+ var manifestDevFile = LocalPluginManifest.GetManifestFile(this.DllFile);
+ if (manifestDevFile.Exists)
+ {
+ this.Manifest = LocalPluginManifest.Load(manifestDevFile);
+ }
+ }
+
switch (this.State)
{
case PluginState.Loaded:
@@ -359,16 +369,6 @@ internal class LocalPlugin : IDisposable
}
this.loader.Reload();
-
- if (this.IsDev)
- {
- // Reload the manifest in-case there were changes here too.
- var manifestDevFile = LocalPluginManifest.GetManifestFile(this.DllFile);
- if (manifestDevFile.Exists)
- {
- this.Manifest = LocalPluginManifest.Load(manifestDevFile);
- }
- }
}
// Load the assembly