Browse Source

Added check to DisabledConfig reload for first load

pull/46/head
Anairkoen Schno 4 years ago
parent
commit
2b7f8ae425
2 changed files with 9 additions and 0 deletions
  1. +4
    -0
      IPA.Loader/Loader/DisabledConfig.cs
  2. +5
    -0
      IPA.Loader/Loader/PluginLoader.cs

+ 4
- 0
IPA.Loader/Loader/DisabledConfig.cs View File

@ -51,6 +51,8 @@ namespace IPA.Loader
Reset = false; Reset = false;
} }
if (!PluginLoader.IsFirstLoadComplete) return; // if the first load isn't complete, skip all of this
var referToState = unchecked(++updateState); var referToState = unchecked(++updateState);
var copy = DisabledModIds.ToArray(); var copy = DisabledModIds.ToArray();
if (disableUpdateTask == null || disableUpdateTask.IsCompleted) if (disableUpdateTask == null || disableUpdateTask.IsCompleted)
@ -83,6 +85,8 @@ namespace IPA.Loader
try try
{ {
if (transaction.WillNeedRestart)
Logger.loader.Warn("Runtime disabled config reload will need game restart to apply");
return transaction.Commit().ContinueWith(t => return transaction.Commit().ContinueWith(t =>
{ {
if (t.IsFaulted) if (t.IsFaulted)


+ 5
- 0
IPA.Loader/Loader/PluginLoader.cs View File

@ -865,6 +865,8 @@ namespace IPA.Loader
return exec; return exec;
} }
internal static bool IsFirstLoadComplete { get; private set; } = false;
internal static List<PluginExecutor> LoadPlugins() internal static List<PluginExecutor> LoadPlugins()
{ {
InitFeatures(); InitFeatures();
@ -882,6 +884,9 @@ namespace IPA.Loader
} }
} }
// TODO: should this be somewhere else?
IsFirstLoadComplete = true;
return list; return list;
} }
} }

Loading…
Cancel
Save