Browse Source

Plugin state transitions now no longer leave SingleStartInit plugins in a state where they are neither or both enabled and disabled

pull/62/head
Anairkoen Schno 3 years ago
parent
commit
6b2dc6990a
Signed by: DaNike GPG Key ID: BEFB74D5F3FC4387
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      IPA.Loader/Loader/PluginManager.cs

+ 4
- 2
IPA.Loader/Loader/PluginManager.cs View File

@ -136,13 +136,14 @@ namespace IPA.Loader
if (executor == null) continue; // couldn't initialize, skip to next if (executor == null) continue; // couldn't initialize, skip to next
} }
PluginLoader.DisabledPlugins.Remove(meta);
DisabledConfig.Instance.DisabledModIds.Remove(meta.Id ?? meta.Name); DisabledConfig.Instance.DisabledModIds.Remove(meta.Id ?? meta.Name);
PluginEnabled?.Invoke(meta, meta.RuntimeOptions != RuntimeOptions.DynamicInit); PluginEnabled?.Invoke(meta, meta.RuntimeOptions != RuntimeOptions.DynamicInit);
if (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); _bsPlugins.Add(executor);
try try
@ -173,10 +174,11 @@ namespace IPA.Loader
foreach (var exec in disableExecs) foreach (var exec in disableExecs)
{ {
PluginLoader.DisabledPlugins.Add(exec.Metadata);
DisabledConfig.Instance.DisabledModIds.Add(exec.Metadata.Id ?? exec.Metadata.Name); DisabledConfig.Instance.DisabledModIds.Add(exec.Metadata.Id ?? exec.Metadata.Name);
if (exec.Metadata.RuntimeOptions == RuntimeOptions.DynamicInit) 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); runtimeDisabledPlugins.Add(exec);
_bsPlugins.Remove(exec); _bsPlugins.Remove(exec);
} }


Loading…
Cancel
Save