From 43c5640a8d9011b8acd81fefa2ec6c7732cda62a Mon Sep 17 00:00:00 2001 From: NiggoJaecha Date: Tue, 2 Jan 2024 00:01:52 +0100 Subject: [PATCH] [MapLights] Add setting to toggle warning --- src/KK_Fix_UnlimitedMapLights/UnlimitedMapLights.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/KK_Fix_UnlimitedMapLights/UnlimitedMapLights.cs b/src/KK_Fix_UnlimitedMapLights/UnlimitedMapLights.cs index 5bac075..c1d4455 100644 --- a/src/KK_Fix_UnlimitedMapLights/UnlimitedMapLights.cs +++ b/src/KK_Fix_UnlimitedMapLights/UnlimitedMapLights.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Reflection.Emit; using BepInEx.Logging; +using BepInEx.Configuration; namespace IllusionFixes { @@ -16,16 +17,21 @@ public class UnlimitedMapLights : BaseUnityPlugin private static new ManualLogSource Logger; + private static ConfigEntry showWarning; + private void Awake() { Logger = base.Logger; + + showWarning = Config.Bind("Logging", "Show Maplight Warning", true, "Toggle the Warning that gets displayed if more than two maplights are added to the scene"); + Harmony.CreateAndPatchAll(typeof(UnlimitedMapLights)); } [HarmonyPostfix, HarmonyPatch(typeof(Studio.SceneInfo), nameof(Studio.SceneInfo.AddLight))] private static void UnlimitedLights(Studio.SceneInfo __instance) { - if(__instance.lightCount > 2) + if(__instance.lightCount > 2 && showWarning.Value) Logger.LogMessage("Warning: Lights above 2 might not affect characters and some items!"); }