mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 20:33:40 +01:00
feat: let users delete policy-blocked and orphaned plugins
This commit is contained in:
parent
098607cca8
commit
2c011b6bcd
3 changed files with 44 additions and 20 deletions
|
|
@ -771,8 +771,8 @@ internal partial class PluginManager : IDisposable, IServiceType
|
|||
/// <param name="plugin">Plugin to remove.</param>
|
||||
public void RemovePlugin(LocalPlugin plugin)
|
||||
{
|
||||
if (plugin.State != PluginState.Unloaded)
|
||||
throw new InvalidPluginOperationException($"Unable to remove {plugin.Name}, not unloaded");
|
||||
if (plugin.State != PluginState.Unloaded && plugin.HasEverStartedLoad)
|
||||
throw new InvalidPluginOperationException($"Unable to remove {plugin.Name}, not unloaded and had loaded before");
|
||||
|
||||
lock (this.pluginListLock)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -189,6 +189,11 @@ internal class LocalPlugin : IDisposable
|
|||
/// </summary>
|
||||
public string BanReason { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the plugin has ever started to load.
|
||||
/// </summary>
|
||||
public bool HasEverStartedLoad { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the plugin is loaded and running.
|
||||
/// </summary>
|
||||
|
|
@ -335,6 +340,8 @@ internal class LocalPlugin : IDisposable
|
|||
"Please refer to https://github.com/goatcorp/Dalamud/discussions/603 for more information.");
|
||||
}
|
||||
|
||||
this.HasEverStartedLoad = true;
|
||||
|
||||
this.loader ??= PluginLoader.CreateFromAssemblyFile(this.DllFile.FullName, SetupLoaderConfig);
|
||||
|
||||
if (reloading || this.IsDev)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue