NVG+T7 fully operational, Thermal Scopes WIP

This commit is contained in:
LimboFPS 2023-09-14 15:20:49 -04:00
parent 03d15f8921
commit e2b9579b22
2 changed files with 98 additions and 14 deletions

View File

@ -13,13 +13,68 @@ namespace ClearVision {
[PatchPostfix]
static void Postfix() {
// Get Camera
GameObject maincam = GameObject.Find("FPS Camera");
NightVision nv = maincam.GetComponent<NightVision>();
bool isNVGOn = nv.On;
if(isNVGOn) {
nv.Mask = nv.AnvisMaskTexture;
nv.Intensity = Plugin.GPIntensity.Value;
Debug.LogError("GogglesPatches Postfix()");
if(Plugin.GlobalEnabled.Value) { // sanity check
// Get Camera
GameObject maincam = GameObject.Find("FPS Camera");
NightVision nv = maincam.GetComponent<NightVision>();
CC_Vintage vintage = maincam.GetComponent<CC_Vintage>();
if(nv.On || nv.InProcessSwitching) {
// Apply each individual setting depending on original texmask, hence why we cannot change it, but rather disable it.
if(nv.TextureMask.Mask == nv.AnvisMaskTexture) {
nv.Intensity = Plugin.GPIntensity.Value;
nv.NoiseIntensity = Plugin.GPNoiseIntensity.Value;
nv.NoiseScale = Plugin.GPNoiseScale.Value;
if (Plugin.GPMaskEnabled.Value) {
nv.TextureMask.enabled = true;
nv.TextureMask.Size = Plugin.GPMaskSize.Value;
}
else {
nv.TextureMask.enabled = false;
}
nv.Color = Plugin.GPColor.Value;
}
else if (nv.TextureMask.Mask == nv.BinocularMaskTexture) {
nv.Intensity = Plugin.GPIntensity.Value;
nv.NoiseIntensity = Plugin.GPNoiseIntensity.Value;
nv.NoiseScale = Plugin.GPNoiseScale.Value;
if (Plugin.GPMaskEnabled.Value) {
nv.TextureMask.enabled = true;
nv.TextureMask.Size = Plugin.GPMaskSize.Value;
}
else {
nv.TextureMask.enabled = false;
}
nv.Color = Plugin.GPColor.Value;
}
else if (nv.TextureMask.Mask == nv.OldMonocularMaskTexture) {
nv.Intensity = Plugin.GPIntensity.Value;
nv.NoiseIntensity = Plugin.GPNoiseIntensity.Value;
nv.NoiseScale = Plugin.GPNoiseScale.Value;
if (Plugin.GPMaskEnabled.Value) {
nv.TextureMask.enabled = true;
nv.TextureMask.Size = Plugin.GPMaskSize.Value;
}
else {
nv.TextureMask.enabled = false;
}
nv.Color = Plugin.GPColor.Value;
}
else { // makes any other exception to the above be noiseless, but still otherwise vanilla.
nv.Intensity = 2.3f;
nv.NoiseIntensity = 0.0f;
nv.NoiseScale = 0.0f;
nv.TextureMask.enabled = true;
nv.TextureMask.Size = 1.2f;
// color left default
}
vintage.enabled = false;
return;
}
else {
vintage.enabled = true;
return;
}
}
}
}
@ -34,7 +89,40 @@ namespace ClearVision {
[PatchPostfix]
static void Postfix() {
//
Debug.LogError("ScopePatches Postfix()");
if(Plugin.GlobalEnabled.Value) { // sanity check
// Get Camera
GameObject maincam = GameObject.Find("FPS Camera");
ThermalVision t7 = maincam.GetComponent<ThermalVision>();
CC_Vintage vintage = maincam.GetComponent<CC_Vintage>();
// Get BaseOpticScope(Clone) obj
GameObject scope = GameObject.FindGameObjectWithTag("OpticCamera");
ThermalVision thermal = scope.GetComponent<ThermalVision>();
if(t7.On) {
t7.IsGlitch = Plugin.T7Glitch.Value;
t7.IsPixelated = Plugin.T7Pixel.Value;
t7.IsNoisy = Plugin.T7Glitch.Value;
t7.IsFpsStuck = Plugin.T7Glitch.Value;
if (Plugin.T7Glitch.Value) {
t7.StuckFpsUtilities.MaxFramerate = Plugin.T7FpsMax.Value;
t7.StuckFpsUtilities.MinFramerate = Plugin.T7FpsMax.Value;
}
t7.TextureMask.Size = Plugin.T7MaskSize.Value;
vintage.enabled = false;
// no idea how to change the clip plane distance, YET.
}
else if (thermal.On && !t7.On) { // Make sure the thermal headgear isn't on, no need to do worthless changes.
//how do I determine which scope is which FUCK
vintage.enabled = false;
}
else {
vintage.enabled = true;
return;
}
}
else
return;
}
}
}

View File

@ -1,10 +1,6 @@
using Aki.Reflection.Patching;
using BepInEx;
using BepInEx;
using BepInEx.Configuration;
using System.Reflection;
using UnityEngine;
using EFT;
using System.Threading.Tasks;
namespace ClearVision {
[BepInPlugin("com.LimboFPS.ClearVision", "ClearVision", "1.0.0")]
@ -62,7 +58,7 @@ namespace ClearVision {
public static ConfigEntry<bool> T7MaskEnabled { get; set; }
public static ConfigEntry<float> T7MaskSize { get; set; }
// REAP-IR WhiteHot/BlackHot Thermal
// REAP-IR Thermal
public static ConfigEntry<bool> IREnabled { get; set; }
public static ConfigEntry<bool> IRGlitch { get; set; }
public static ConfigEntry<bool> IRNoise { get; set; }