From 3838003f5821fcde2b40cb92eb0ecfe75d7f1eec Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Sun, 5 Apr 2020 01:15:27 -0500 Subject: [PATCH] Added check to DisabledConfig reload for first load --- IPA.Loader/Loader/DisabledConfig.cs | 4 ++++ IPA.Loader/Loader/PluginLoader.cs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/IPA.Loader/Loader/DisabledConfig.cs b/IPA.Loader/Loader/DisabledConfig.cs index b06bc8a6..a8adcfe1 100644 --- a/IPA.Loader/Loader/DisabledConfig.cs +++ b/IPA.Loader/Loader/DisabledConfig.cs @@ -51,6 +51,8 @@ namespace IPA.Loader Reset = false; } + if (!PluginLoader.IsFirstLoadComplete) return; // if the first load isn't complete, skip all of this + var referToState = unchecked(++updateState); var copy = DisabledModIds.ToArray(); if (disableUpdateTask == null || disableUpdateTask.IsCompleted) @@ -83,6 +85,8 @@ namespace IPA.Loader try { + if (transaction.WillNeedRestart) + Logger.loader.Warn("Runtime disabled config reload will need game restart to apply"); return transaction.Commit().ContinueWith(t => { if (t.IsFaulted) diff --git a/IPA.Loader/Loader/PluginLoader.cs b/IPA.Loader/Loader/PluginLoader.cs index 1155efaa..f86014ba 100644 --- a/IPA.Loader/Loader/PluginLoader.cs +++ b/IPA.Loader/Loader/PluginLoader.cs @@ -865,6 +865,8 @@ namespace IPA.Loader return exec; } + internal static bool IsFirstLoadComplete { get; private set; } = false; + internal static List LoadPlugins() { InitFeatures(); @@ -882,6 +884,9 @@ namespace IPA.Loader } } + // TODO: should this be somewhere else? + IsFirstLoadComplete = true; + return list; } }