From 0b1aac10a5968f862d2a01888c1471382bfb2c7a Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Sat, 8 Sep 2018 20:59:57 -0500 Subject: [PATCH] Created an IPA config source Moved some logger init stuff around --- IPA.Loader/Loader/PluginManager.cs | 5 +++++ IPA.Loader/Logging/StandardLogger.cs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/IPA.Loader/Loader/PluginManager.cs b/IPA.Loader/Loader/PluginManager.cs index c661a703..3bb6ae69 100644 --- a/IPA.Loader/Loader/PluginManager.cs +++ b/IPA.Loader/Loader/PluginManager.cs @@ -77,6 +77,8 @@ namespace IPA.Loader } private static List _ipaPlugins = null; + internal static IConfigProvider SelfConfigProvider { get; set; } = null; + internal static List configProviders = new List(); private static void LoadPlugins() @@ -162,6 +164,9 @@ namespace IPA.Loader _bsPlugins.Add(selfPlugin); + configProviders.Add(SelfConfigProvider = new JsonConfigProvider() { Filename = Path.Combine("UserData", SelfPlugin.IPA_Name) }); + SelfConfigProvider.Load(); + //Load copied plugins string[] copiedPlugins = Directory.GetFiles(cacheDir, "*.dll"); foreach (string s in copiedPlugins) diff --git a/IPA.Loader/Logging/StandardLogger.cs b/IPA.Loader/Logging/StandardLogger.cs index 789dd0d4..dbde3578 100644 --- a/IPA.Loader/Logging/StandardLogger.cs +++ b/IPA.Loader/Logging/StandardLogger.cs @@ -53,7 +53,7 @@ namespace IPA.Logging /// /// All levels defined by this filter will be sent to loggers. All others will be ignored. /// - public static LogLevel PrintFilter { get; set; } = ModPrefs.GetBool("IPA", "PrintDebug", false, true) ? LogLevel.All : LogLevel.InfoUp; + public static LogLevel PrintFilter { get; set; } private List printers = new List(defaultPrinters); private Dictionary children = new Dictionary(); @@ -61,6 +61,7 @@ namespace IPA.Logging static StandardLogger() { showSourceClass = ModPrefs.GetBool("IPA", "DebugShowCallSource", false, true); + PrintFilter = ModPrefs.GetBool("IPA", "PrintDebug", false, true) ? LogLevel.All : LogLevel.InfoUp; } private StandardLogger(string mainName, string subName, params LogPrinter[] inherited)