using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("RemoveUpgradeVisualEffect")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("HP")] [assembly: AssemblyProduct("RemoveUpgradeVisualEffect")] [assembly: AssemblyCopyright("Copyright © HP 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("b449420e-0c6d-43c0-ab08-59b5c53bd9b1")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace RemoveUpgradeVisualEffects; [BepInPlugin("TechedCrayon413.RemoveUpgradeVisualEffects", "RemoveUpgradeVisualEffects", "1.0.0")] public class RemoveUpgradeVisualEffects : BaseUnityPlugin { public static ConfigEntry BlackHazeBlurSwitchConfig; public static ConfigEntry UpgradeBoxParticlesSwitchConfig; private void Awake() { BlackHazeBlurSwitchConfig = ((BaseUnityPlugin)this).Config.Bind("Visual Effects", "Camera Blur", false, "Set to true to enable the black haze glitch camera visual effect when you use a upgrade."); UpgradeBoxParticlesSwitchConfig = ((BaseUnityPlugin)this).Config.Bind("Visual Effects", "Upgrade Box Particles", false, "Set to true to enable the upgrade box particles when you use a upgrade."); Harmony.CreateAndPatchAll(typeof(UpgradeVisualPatches), (string)null); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin RemoveUpgradeVisualEffects v1.0.0 loaded successfully"); ((BaseUnityPlugin)this).Logger.LogMessage((object)"Hello from TechedCrayon413"); } } public class UpgradeVisualPatches { [HarmonyPatch(typeof(CameraGlitch), "PlayUpgrade")] [HarmonyPrefix] public static bool Prefix_CameraGlitch_PlayUpgrade() { return RemoveUpgradeVisualEffects.BlackHazeBlurSwitchConfig.Value; } [HarmonyPatch(typeof(ItemUpgrade), "PlayerUpgrade")] [HarmonyPostfix] public static void Postfix_ItemUpgrade_PlayerUpgrade(ItemUpgrade __instance, Transform ___particleEffects) { if (!RemoveUpgradeVisualEffects.UpgradeBoxParticlesSwitchConfig.Value && (Object)(object)___particleEffects != (Object)null) { ((Component)___particleEffects).gameObject.SetActive(false); } } }