mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Merge pull request #1004 from Aireil/reload_first
feat: reload manifest before trying to load when hot-reloading
This commit is contained in:
commit
bba41fe779
1 changed files with 11 additions and 11 deletions
|
|
@ -217,7 +217,7 @@ internal class LocalPlugin : IDisposable
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value indicating whether or not this plugin is orphaned(belongs to a repo) or not.
|
/// Gets a value indicating whether or not this plugin is orphaned(belongs to a repo) or not.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
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
|
!this.Manifest.InstalledFromUrl.IsNullOrEmpty() && // TODO(api8): Remove this, all plugins will have a proper flag
|
||||||
Service<PluginManager>.Get().Repos.All(x => x.PluginMasterUrl != this.Manifest.InstalledFromUrl) &&
|
Service<PluginManager>.Get().Repos.All(x => x.PluginMasterUrl != this.Manifest.InstalledFromUrl) &&
|
||||||
this.Manifest.InstalledFromUrl != LocalPluginManifest.FlagMainRepo;
|
this.Manifest.InstalledFromUrl != LocalPluginManifest.FlagMainRepo;
|
||||||
|
|
@ -285,6 +285,16 @@ internal class LocalPlugin : IDisposable
|
||||||
await this.pluginLoadStateLock.WaitAsync();
|
await this.pluginLoadStateLock.WaitAsync();
|
||||||
try
|
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)
|
switch (this.State)
|
||||||
{
|
{
|
||||||
case PluginState.Loaded:
|
case PluginState.Loaded:
|
||||||
|
|
@ -359,16 +369,6 @@ internal class LocalPlugin : IDisposable
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loader.Reload();
|
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
|
// Load the assembly
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue