From 6b2dc6990a6d75373df648508d26e4b48a8ef468 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Wed, 6 Jan 2021 23:38:38 -0600 Subject: [PATCH] Plugin state transitions now no longer leave SingleStartInit plugins in a state where they are neither or both enabled and disabled --- IPA.Loader/Loader/PluginManager.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IPA.Loader/Loader/PluginManager.cs b/IPA.Loader/Loader/PluginManager.cs index 580ab1a6..07c682ce 100644 --- a/IPA.Loader/Loader/PluginManager.cs +++ b/IPA.Loader/Loader/PluginManager.cs @@ -136,13 +136,14 @@ namespace IPA.Loader if (executor == null) continue; // couldn't initialize, skip to next } - PluginLoader.DisabledPlugins.Remove(meta); DisabledConfig.Instance.DisabledModIds.Remove(meta.Id ?? meta.Name); PluginEnabled?.Invoke(meta, meta.RuntimeOptions != RuntimeOptions.DynamicInit); if (meta.RuntimeOptions == RuntimeOptions.DynamicInit) { + // it should only be marked as not disabled if it actually was + PluginLoader.DisabledPlugins.Remove(meta); _bsPlugins.Add(executor); try @@ -173,10 +174,11 @@ namespace IPA.Loader foreach (var exec in disableExecs) { - PluginLoader.DisabledPlugins.Add(exec.Metadata); DisabledConfig.Instance.DisabledModIds.Add(exec.Metadata.Id ?? exec.Metadata.Name); if (exec.Metadata.RuntimeOptions == RuntimeOptions.DynamicInit) { + // it should only be marked as disabled if it was actually fully disabled + PluginLoader.DisabledPlugins.Add(exec.Metadata); runtimeDisabledPlugins.Add(exec); _bsPlugins.Remove(exec); }