From 30f7fefbf16b73efaadf8bd6f27f423157ccb5a3 Mon Sep 17 00:00:00 2001 From: LimboFPS Date: Sun, 17 Sep 2023 21:13:27 -0400 Subject: [PATCH] Removal of thermal sights --- ClientMod/ClearVisionPatches.cs | 30 +++++------------------------- ClientMod/Plugin.cs | 19 +------------------ 2 files changed, 6 insertions(+), 43 deletions(-) diff --git a/ClientMod/ClearVisionPatches.cs b/ClientMod/ClearVisionPatches.cs index 8da47dc..9aaa0e9 100644 --- a/ClientMod/ClearVisionPatches.cs +++ b/ClientMod/ClearVisionPatches.cs @@ -8,7 +8,7 @@ using EFT; namespace ClearVision { public class GogglesPatches : ModulePatch { protected override MethodBase GetTargetMethod() { - Debug.Log("GogglesPatches GTM()"); + Logger.LogInfo("GogglesPatches GTM()"); var result = typeof(NightVision).GetMethod("method_1", BindingFlags.Instance | BindingFlags.NonPublic); return result; } @@ -21,7 +21,7 @@ namespace ClearVision { NightVision nv = maincam.GetComponent(); CC_Vintage vintage = maincam.GetComponent(); if(nv != null && nv.On) { - Debug.Log("nv is not null and is enabled/being enabled"); + Logger.LogInfo("nv is not null and is enabled/being enabled"); nv.Intensity = Plugin.NVGIntensity.Value; nv.NoiseIntensity = Plugin.NVGNoiseIntensity.Value; nv.NoiseScale = Plugin.NVGNoiseScale.Value; @@ -50,7 +50,7 @@ namespace ClearVision { public class ScopePatches : ModulePatch { protected override MethodBase GetTargetMethod() { - Debug.Log("ScopePatches GTM()"); + Logger.LogInfo("ScopePatches GTM()"); var result = typeof(ThermalVision).GetMethod("method_1", BindingFlags.Instance | BindingFlags.NonPublic); return result; } @@ -58,14 +58,9 @@ namespace ClearVision { [PatchPostfix] static void Postfix() { if(Plugin.GlobalEnabled.Value && Singleton.Instantiated) { // sanity check - // Get Camera GameObject maincam = GameObject.Find("FPS Camera"); ThermalVision t7 = maincam.GetComponent(); - // Get BaseOpticScope(Clone) obj, but need to check if it actually exists - GameObject scope = GameObject.FindGameObjectWithTag("OpticCamera"); - ThermalVision thermal = scope.GetComponent(); - if(t7 != null && t7.On) { - Debug.Log("t7 is not null and is on!"); + if(t7.On) { t7.IsGlitch = Plugin.T7Glitch.Value; t7.IsPixelated = Plugin.T7Pixel.Value; t7.IsNoisy = Plugin.T7Noise.Value; @@ -86,24 +81,9 @@ namespace ClearVision { // just need to see where it is in the data structure return; } - else if (scope != null && thermal != null && thermal.On && !t7.On) { - Debug.Log("scope and thermal script are not null and is on!"); - thermal.IsGlitch = Plugin.ThermalGlitch.Value; - thermal.IsPixelated = Plugin.ThermalPixel.Value; - thermal.IsNoisy = Plugin.ThermalNoise.Value; - thermal.IsMotionBlurred = Plugin.ThermalMotionBlur.Value; - thermal.IsFpsStuck = Plugin.ThermalFpsLock.Value; - if (Plugin.ThermalFpsLock.Value) { - thermal.StuckFpsUtilities.MaxFramerate = Plugin.ThermalFpsMax.Value; - thermal.StuckFpsUtilities.MinFramerate = Plugin.ThermalFpsMax.Value; - } - return; - } - else + else return; } - else - return; } } } \ No newline at end of file diff --git a/ClientMod/Plugin.cs b/ClientMod/Plugin.cs index 52aacf0..b8d5ed2 100644 --- a/ClientMod/Plugin.cs +++ b/ClientMod/Plugin.cs @@ -26,18 +26,9 @@ namespace ClearVision { public static ConfigEntry T7MotionBlur { get; set; } public static ConfigEntry T7MaskEnabled { get; set; } public static ConfigEntry T7MaskSize { get; set; } - - // All Thermal Sights - public static ConfigEntry ThermalEnabled { get; set; } - public static ConfigEntry ThermalGlitch { get; set; } - public static ConfigEntry ThermalNoise { get; set; } - public static ConfigEntry ThermalPixel { get; set; } - public static ConfigEntry ThermalFpsLock { get; set; } - public static ConfigEntry ThermalFpsMax { get; set; } - public static ConfigEntry ThermalMotionBlur { get; set; } private void Start() { - Debug.Log("ClearVision Start()"); + Logger.LogInfo("ClearVision Start()"); GlobalEnabled = Config.Bind("ClearVision", "GlobalEnabled", true, new ConfigDescription("Main Toggle", null)); // NVG Goggles NVGEnabled = Config.Bind("NVG", "NVGEnabled", true, new ConfigDescription("Enable GPNVG-18", null)); @@ -58,14 +49,6 @@ namespace ClearVision { T7FpsMax = Config.Bind("T7", "T7FpsMax", 60, new ConfigDescription("T-7 FPS Max FPS", new AcceptableValueRange(15, 60))); T7MaskEnabled = Config.Bind("T7", "T7MaskEnabled", false, new ConfigDescription("T-7 Mask Overlay On/Off", null)); T7MaskSize = Config.Bind("T7", "T7MaskSize", 1.5f, new ConfigDescription("T-7 Mask Overlay Size", new AcceptableValueRange(0f, 5f))); - // Thermal 60Hz - ThermalEnabled = Config.Bind("Scopes", "ThermalEnabled", true, new ConfigDescription("Enable Thermal Sights", null)); - ThermalNoise = Config.Bind("Scopes", "ThermalNosie", false, new ConfigDescription("Thermal Noise", null)); - ThermalGlitch = Config.Bind("Scopes", "ThermalGlitch", false, new ConfigDescription("Thermal Glitchiness", null)); - ThermalPixel = Config.Bind("Scopes", "ThermalPixel", false, new ConfigDescription("Thermal Pixelation", null)); - ThermalMotionBlur = Config.Bind("Scopes", "ThermalMotionBlur", false, new ConfigDescription("Thermal Motion Blur", null)); - ThermalFpsLock = Config.Bind("Scopes", "ThermalFpsLock", true, new ConfigDescription("Thermal FPS Lock Enabled", null)); - ThermalFpsMax = Config.Bind("Scopes", "ThermalFpsMax", 60, new ConfigDescription("Thermal FPS Max FPS", new AcceptableValueRange(15, 60))); new GogglesPatches().Enable(); new ScopePatches().Enable();