Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Disable Fog and Blur v1.0.0
BepInEx/plugins/DisableFogAndBlur.dll
Decompiled a month agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("BeplnexMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BeplnexMod")] [assembly: AssemblyTitle("BeplnexMod")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace SilksongPerformanceMod { [BepInPlugin("disablefogandblur", "Disable Fog and Blur", "1.0.3")] public class PerformanceMod : BaseUnityPlugin { private ConfigEntry<bool> disableBlur; private ConfigEntry<bool> disableTempFog; private ConfigEntry<bool> disableFog; private ConfigEntry<bool> disableMovingFog; private ConfigEntry<bool> disableHaze; private ConfigEntry<bool> disableWaterFog; private ConfigEntry<bool> disableAbyssMist; private ConfigEntry<bool> disableGreymoorFog; private ConfigEntry<bool> disablePeakTwinkle; private ConfigEntry<bool> disableHeroLight; private ConfigEntry<float> heroLightRadius; private ConfigEntry<bool> disableVignette; private ConfigEntry<bool> enableBloomOverride; private ConfigEntry<float> bloomIntensity; private ConfigEntry<float> bloomThreshold; private ConfigEntry<bool> disableBloomBlur; private GameObject tkCamera; private FieldInfo currentBlurSize; private FieldInfo currentIntensity; private FieldInfo currentThreshold; private bool isBloomOverrided = false; private void Awake() { disableBlur = ((BaseUnityPlugin)this).Config.Bind<bool>("BackgroundGeneral", "Disable Blur", true, "Remove the blurry effect from the background"); disableTempFog = ((BaseUnityPlugin)this).Config.Bind<bool>("BackgroundGeneral", "Disable Temp Fog", true, "Remove the static large blurry fog mask from the background. In some area, this layer will also make background brighter. Disabling will make background darker but more clear"); disableFog = ((BaseUnityPlugin)this).Config.Bind<bool>("BackgroundGeneral", "Disable Fog", true, "Remove the static small fog hovering on the ground or in the background"); disableMovingFog = ((BaseUnityPlugin)this).Config.Bind<bool>("BackgroundGeneral", "Disable Moving Fog", false, "Remove the flowing fog like storm or water steam from the background"); disableHaze = ((BaseUnityPlugin)this).Config.Bind<bool>("BackgroundGeneral", "Disable Haze", false, "Remove static illuminating haze effects like godray from the background and entrance."); disableWaterFog = ((BaseUnityPlugin)this).Config.Bind<bool>("BackgroundGeneral", "Disable Water Fog", false, "Remove the static fog flowing under or above the water."); disableAbyssMist = ((BaseUnityPlugin)this).Config.Bind<bool>("BackgroundSpecific", "Disable Mist In Abyss", false, "Remove the flowing mist effect in The Abyss."); disableGreymoorFog = ((BaseUnityPlugin)this).Config.Bind<bool>("BackgroundSpecific", "Disable FG Fog In Greymoor", false, "Remove the blue toned foreground fog effect in The Greymoor. This will make Greymoor darker."); disablePeakTwinkle = ((BaseUnityPlugin)this).Config.Bind<bool>("BackgroundSpecific", "Disable Twinkle In Peak", false, "Remove the twinkle effect on water in the Mount Fay."); disableHeroLight = ((BaseUnityPlugin)this).Config.Bind<bool>("HeroLight", "Disable HeroLight", false, "Remove the light emanating from the player."); heroLightRadius = ((BaseUnityPlugin)this).Config.Bind<float>("HeroLight", "HeroLight Radius", 3f, "The radius of the hero's light."); disableVignette = ((BaseUnityPlugin)this).Config.Bind<bool>("CameraEffect", "Disable Vignette", true, "Remove the vignette effect around the player."); enableBloomOverride = ((BaseUnityPlugin)this).Config.Bind<bool>("Bloom", "Enable Bloom Override", false, "Whether to override game's bloom settings. If true, you can adjust the bloom intensity and threshold at will"); bloomIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("Bloom", "Bloom Intensity", 0.43f, "Control the strength of bloom post-processing effect. How bright will the glow around a highlighted surface be. 0 will make the whole game look darker, high value(0.18-0.25) will make game brighter"); bloomThreshold = ((BaseUnityPlugin)this).Config.Bind<float>("Bloom", "Bloom Threshold", 0.35f, "Control the strength of bloom suppression. This option will limit the effect of Bloom, preventing it from causing 'overburnt' bloom effect"); disableBloomBlur = ((BaseUnityPlugin)this).Config.Bind<bool>("Bloom", "Disable Bloom Blur", true, "Remove the blurry glow around the bloom objects"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Disable Fog and Blur Loaded"); } private void Update() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("Hero_Hornet(Clone)"); if (!((Object)(object)val != (Object)null)) { return; } if (disableHeroLight.Value) { Transform val2 = val.transform.Find("HeroLight"); if ((Object)(object)val2 != (Object)null) { ((Component)val2).gameObject.SetActive(false); } } else { Transform val3 = val.transform.Find("HeroLight"); if ((Object)(object)val3 != (Object)null) { ((Component)val3).gameObject.SetActive(true); val3.localScale = new Vector3(heroLightRadius.Value, heroLightRadius.Value, 1f); } } if (disableVignette.Value) { Transform val4 = val.transform.Find("Vignette"); if ((Object)(object)val4 != (Object)null) { ((Component)val4).gameObject.SetActive(false); } } else { Transform val5 = val.transform.Find("Vignette"); if ((Object)(object)val5 != (Object)null) { ((Component)val5).gameObject.SetActive(true); } } tkCamera = GameObject.Find("tk2dCamera"); currentBlurSize = typeof(BloomOptimized).GetField("currentBlurSize", BindingFlags.Instance | BindingFlags.NonPublic); currentIntensity = typeof(BloomOptimized).GetField("currentIntensity", BindingFlags.Instance | BindingFlags.NonPublic); currentThreshold = typeof(BloomOptimized).GetField("currentThreshold", BindingFlags.Instance | BindingFlags.NonPublic); if (!((Object)(object)tkCamera != (Object)null)) { return; } if (enableBloomOverride.Value) { if (!((Object)(object)tkCamera != (Object)null)) { return; } BloomOptimized component = tkCamera.GetComponent<BloomOptimized>(); if (!((Object)(object)component != (Object)null)) { return; } if (currentBlurSize != null) { if (disableBloomBlur.Value) { currentBlurSize.SetValue(component, 0); } else { currentBlurSize.SetValue(component, 2); } } if (currentIntensity != null) { currentIntensity.SetValue(component, bloomIntensity.Value); } if (currentThreshold != null) { currentThreshold.SetValue(component, bloomThreshold.Value); } isBloomOverrided = true; } else if (isBloomOverrided) { BloomOptimized component2 = tkCamera.GetComponent<BloomOptimized>(); currentBlurSize.SetValue(component2, 2f); currentIntensity.SetValue(component2, ((ConfigEntryBase)bloomIntensity).DefaultValue); currentThreshold.SetValue(component2, ((ConfigEntryBase)bloomThreshold).DefaultValue); isBloomOverrided = false; } } private void OnEnable() { SceneManager.sceneLoaded += OnSceneLoaded; } private void OnDisable() { SceneManager.sceneLoaded -= OnSceneLoaded; } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>(); GameObject[] array2 = array; foreach (GameObject val in array2) { if (((Object)val).name.StartsWith("BlurPlane") && disableBlur.Value) { val.SetActive(false); } if ((((Object)val).name.StartsWith("temp fog") || ((Object)val).name.StartsWith("ant_fog") || ((Object)val).name.StartsWith("greymoor_fog_set")) && disableTempFog.Value) { val.SetActive(false); } if ((((Object)val).name.StartsWith("fog") || ((Object)val).name.StartsWith("abyss_fog") || ((Object)val).name.StartsWith("dream_fog")) && disableFog.Value) { val.SetActive(false); } if ((((Object)val).name.StartsWith("Peak_fog_thick_moving") || ((Object)val).name.StartsWith("peak_fog_thin_moving")) && disableMovingFog.Value) { val.SetActive(false); } if (((Object)val).name.StartsWith("haze") && disableHaze.Value) { val.SetActive(false); } if (((Object)val).name.StartsWith("water_fog") && disableWaterFog.Value) { val.SetActive(false); } if (((Scene)(ref scene)).name.StartsWith("Abyss")) { if (disableAbyssMist.Value && ((Object)val).name.StartsWith("abyss_mist")) { val.SetActive(false); } } else if (((Scene)(ref scene)).name.StartsWith("Greymoor")) { if (disableGreymoorFog.Value && ((Object)val).name.StartsWith("Greymoor_fog_set")) { val.SetActive(false); } } else if (((Scene)(ref scene)).name.StartsWith("Peak") && disablePeakTwinkle.Value && ((Object)val).name.StartsWith("Twinkle (")) { val.SetActive(false); } } } } }