├── LICENSE ├── AmandsGraphics.sln └── AmandsGraphics ├── AmandsGraphics.csproj ├── ConfigurationManagerAttributes.cs ├── Program.cs └── AmandsGraphicsClass.cs /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Amands2Mello 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /AmandsGraphics.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32811.315 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AmandsGraphics", "AmandsGraphics\AmandsGraphics.csproj", "{E1F4631C-7767-4EB8-B34F-EBB8F4E85709}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E1F4631C-7767-4EB8-B34F-EBB8F4E85709}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {E1F4631C-7767-4EB8-B34F-EBB8F4E85709}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {E1F4631C-7767-4EB8-B34F-EBB8F4E85709}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {E1F4631C-7767-4EB8-B34F-EBB8F4E85709}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {6A2A6D78-FB08-4DD0-805C-78C294042C09} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /AmandsGraphics/AmandsGraphics.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {E1F4631C-7767-4EB8-B34F-EBB8F4E85709} 8 | Library 9 | Properties 10 | AmandsGraphics 11 | AmandsGraphics 12 | v4.7.2 13 | 512 14 | true 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | ..\References\Aki.Common.dll 36 | 37 | 38 | ..\References\Aki.Reflection.dll 39 | 40 | 41 | ..\References\Assembly-CSharp.dll 42 | 43 | 44 | ..\References\Assembly-CSharp-firstpass.dll 45 | 46 | 47 | ..\References\BepInEx.dll 48 | 49 | 50 | ..\References\Comfort.dll 51 | 52 | 53 | ..\References\DOTween.dll 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | ..\References\Unity.Postprocessing.Runtime.dll 65 | 66 | 67 | ..\References\UnityEngine.dll 68 | 69 | 70 | ..\References\UnityEngine.CoreModule.dll 71 | 72 | 73 | ..\References\UnityEngine.InputLegacyModule.dll 74 | 75 | 76 | ..\References\UnityEngine.PhysicsModule.dll 77 | 78 | 79 | ..\References\UnityEngine.UI.dll 80 | 81 | 82 | ..\References\UnityEngine.UnityWebRequestModule.dll 83 | 84 | 85 | ..\References\UnityEngine.UnityWebRequestTextureModule.dll 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /AmandsGraphics/ConfigurationManagerAttributes.cs: -------------------------------------------------------------------------------- 1 | /// 2 | /// Class that specifies how a setting should be displayed inside the ConfigurationManager settings window. 3 | /// 4 | /// Usage: 5 | /// This class template has to be copied inside the plugin's project and referenced by its code directly. 6 | /// make a new instance, assign any fields that you want to override, and pass it as a tag for your setting. 7 | /// 8 | /// If a field is null (default), it will be ignored and won't change how the setting is displayed. 9 | /// If a field is non-null (you assigned a value to it), it will override default behavior. 10 | /// 11 | /// 12 | /// 13 | /// Here's an example of overriding order of settings and marking one of the settings as advanced: 14 | /// 15 | /// // Override IsAdvanced and Order 16 | /// Config.AddSetting("X", "1", 1, new ConfigDescription("", null, new ConfigurationManagerAttributes { IsAdvanced = true, Order = 3 })); 17 | /// // Override only Order, IsAdvanced stays as the default value assigned by ConfigManager 18 | /// Config.AddSetting("X", "2", 2, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 1 })); 19 | /// Config.AddSetting("X", "3", 3, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 2 })); 20 | /// 21 | /// 22 | /// 23 | /// 24 | /// You can read more and see examples in the readme at https://github.com/BepInEx/BepInEx.ConfigurationManager 25 | /// You can optionally remove fields that you won't use from this class, it's the same as leaving them null. 26 | /// 27 | #pragma warning disable 0169, 0414, 0649 28 | internal sealed class ConfigurationManagerAttributes 29 | { 30 | /// 31 | /// Should the setting be shown as a percentage (only use with value range settings). 32 | /// 33 | public bool? ShowRangeAsPercent; 34 | 35 | /// 36 | /// Custom setting editor (OnGUI code that replaces the default editor provided by ConfigurationManager). 37 | /// See below for a deeper explanation. Using a custom drawer will cause many of the other fields to do nothing. 38 | /// 39 | public System.Action CustomDrawer; 40 | 41 | /// 42 | /// Show this setting in the settings screen at all? If false, don't show. 43 | /// 44 | public bool? Browsable; 45 | 46 | /// 47 | /// Category the setting is under. Null to be directly under the plugin. 48 | /// 49 | public string Category; 50 | 51 | /// 52 | /// If set, a "Default" button will be shown next to the setting to allow resetting to default. 53 | /// 54 | public object DefaultValue; 55 | 56 | /// 57 | /// Force the "Reset" button to not be displayed, even if a valid DefaultValue is available. 58 | /// 59 | public bool? HideDefaultButton; 60 | 61 | /// 62 | /// Force the setting name to not be displayed. Should only be used with a to get more space. 63 | /// Can be used together with to gain even more space. 64 | /// 65 | public bool? HideSettingName; 66 | 67 | /// 68 | /// Optional description shown when hovering over the setting. 69 | /// Not recommended, provide the description when creating the setting instead. 70 | /// 71 | public string Description; 72 | 73 | /// 74 | /// Name of the setting. 75 | /// 76 | public string DispName; 77 | 78 | /// 79 | /// Order of the setting on the settings list relative to other settings in a category. 80 | /// 0 by default, higher number is higher on the list. 81 | /// 82 | public int? Order; 83 | 84 | /// 85 | /// Only show the value, don't allow editing it. 86 | /// 87 | public bool? ReadOnly; 88 | 89 | /// 90 | /// If true, don't show the setting by default. User has to turn on showing advanced settings or search for it. 91 | /// 92 | public bool? IsAdvanced; 93 | 94 | /// 95 | /// Custom converter from setting type to string for the built-in editor textboxes. 96 | /// 97 | public System.Func ObjToStr; 98 | 99 | /// 100 | /// Custom converter from string to setting type for the built-in editor textboxes. 101 | /// 102 | public System.Func StrToObj; 103 | } -------------------------------------------------------------------------------- /AmandsGraphics/Program.cs: -------------------------------------------------------------------------------- 1 | 2 | using SPT.Common.Utils; 3 | using SPT.Reflection.Patching; 4 | using BepInEx; 5 | using BepInEx.Configuration; 6 | using System; 7 | using System.IO; 8 | using System.Reflection; 9 | using System.Linq; 10 | using UnityEngine; 11 | using UnityEngine.Rendering.PostProcessing; 12 | using EFT.CameraControl; 13 | using EFT.InventoryLogic; 14 | using HarmonyLib; 15 | using EFT.UI; 16 | using System.Collections.Generic; 17 | using EFT; 18 | using System.Threading.Tasks; 19 | 20 | namespace AmandsGraphics 21 | { 22 | [BepInPlugin("com.Amanda.Graphics", "Graphics", "1.6.5")] 23 | public class AmandsGraphicsPlugin : BaseUnityPlugin 24 | { 25 | public static GameObject Hook; 26 | public static AmandsGraphicsClass AmandsGraphicsClassComponent; 27 | public static Type PainKillerEffectType; 28 | public static Type PainEffectType; 29 | 30 | public static ConfigEntry GraphicsToggle { get; set; } 31 | public static ConfigEntry DebugMode { get; set; } 32 | 33 | public static ConfigEntry MotionBlur { get; set; } 34 | public static ConfigEntry MotionBlurSampleCount { get; set; } 35 | public static ConfigEntry MotionBlurShutterAngle { get; set; } 36 | 37 | public static ConfigEntry HBAO { get; set; } 38 | public static ConfigEntry HBAOIntensity { get; set; } 39 | public static ConfigEntry HBAOSaturation { get; set; } 40 | public static ConfigEntry HBAOAlbedoMultiplier { get; set; } 41 | public static ConfigEntry LabsHBAOIntensity { get; set; } 42 | public static ConfigEntry LabsHBAOSaturation { get; set; } 43 | public static ConfigEntry LabsHBAOAlbedoMultiplier { get; set; } 44 | 45 | public static ConfigEntry SurroundDepthOfField { get; set; } 46 | public static ConfigEntry SurroundDOFOpticZoom { get; set; } 47 | public static ConfigEntry SurroundDOFAperture { get; set; } 48 | public static ConfigEntry SurroundDOFSpeed { get; set; } 49 | public static ConfigEntry SurroundDOFFocalLength { get; set; } 50 | public static ConfigEntry SurroundDOFFocalLengthOff { get; set; } 51 | public static ConfigEntry DOFKernelSize { get; set; } 52 | 53 | public static ConfigEntry UIDepthOfField { get; set; } 54 | public static ConfigEntry UIDOFAperture { get; set; } 55 | public static ConfigEntry UIDOFDistance { get; set; } 56 | public static ConfigEntry UIDOFSpeed { get; set; } 57 | public static ConfigEntry UIDOFFocalLength { get; set; } 58 | 59 | public static ConfigEntry WeaponDepthOfField { get; set; } 60 | public static ConfigEntry WeaponDOFSpeed { get; set; } 61 | public static ConfigEntry WeaponDOFWeaponMaxBlurSize { get; set; } 62 | public static ConfigEntry WeaponDOFIronSightMaxBlurSize { get; set; } 63 | public static ConfigEntry WeaponDOFSightMaxBlurSize { get; set; } 64 | public static ConfigEntry WeaponDOFNVGMaxBlurSize { get; set; } 65 | public static ConfigEntry WeaponDOFWeaponFocalLength { get; set; } 66 | public static ConfigEntry WeaponDOFIronSightFocalLength { get; set; } 67 | public static ConfigEntry WeaponDOFSightFocalLength { get; set; } 68 | public static ConfigEntry WeaponDOFNVGFocalLength { get; set; } 69 | public static ConfigEntry WeaponDOFAperture { get; set; } 70 | public static ConfigEntry WeaponDOFBlurSampleCount { get; set; } 71 | 72 | public static ConfigEntry OpticDepthOfField { get; set; } 73 | public static ConfigEntry OpticDOFOpticZoom { get; set; } 74 | public static ConfigEntry OpticDOFAperture1x { get; set; } 75 | public static ConfigEntry OpticDOFAperture2x { get; set; } 76 | public static ConfigEntry OpticDOFAperture4x { get; set; } 77 | public static ConfigEntry OpticDOFAperture6x { get; set; } 78 | public static ConfigEntry OpticDOFSpeed { get; set; } 79 | public static ConfigEntry OpticDOFFocalLengthMode { get; set; } 80 | public static ConfigEntry OpticDOFFocalLength { get; set; } 81 | public static ConfigEntry OpticDOFKernelSize { get; set; } 82 | public static ConfigEntry OpticDOFRaycastQuality { get; set; } 83 | public static ConfigEntry OpticDOFDistanceSpeed { get; set; } 84 | public static ConfigEntry OpticDOFRaycastDistance { get; set; } 85 | public static ConfigEntry OpticDOFTargetDistance { get; set; } 86 | 87 | public static ConfigEntry Flashlight { get; set; } 88 | public static ConfigEntry FlashlightRange { get; set; } 89 | public static ConfigEntry FlashlightExtinctionCoef { get; set; } 90 | 91 | public static ConfigEntry NVG { get; set; } 92 | public static ConfigEntry NVGTonemap { get; set; } 93 | public static ConfigEntry NVGAmbientContrast { get; set; } 94 | public static ConfigEntry InterchangeNVGAmbientContrast { get; set; } 95 | public static ConfigEntry NVGNoiseIntensity { get; set; } 96 | public static ConfigEntry InterchangeNVGNoiseIntensity { get; set; } 97 | public static ConfigEntry NVGOriginalColor { get; set; } 98 | public static ConfigEntry NVGOriginalSkyColor { get; set; } 99 | public static ConfigEntry InterchangeNVGOriginalSkyColor { get; set; } 100 | public static ConfigEntry NVGMoonLightIntensity { get; set; } 101 | 102 | public static ConfigEntry NightAmbientLight { get; set; } 103 | public static ConfigEntry NightAmbientContrast { get; set; } 104 | public static ConfigEntry InterchangeNightAmbientContrast { get; set; } 105 | 106 | public static ConfigEntry MysticalGlow { get; set; } 107 | public static ConfigEntry MysticalGlowIntensity { get; set; } 108 | public static ConfigEntry GroundZeroMysticalGlowIntensity { get; set; } 109 | public static ConfigEntry StreetsMysticalGlowIntensity { get; set; } 110 | public static ConfigEntry CustomsMysticalGlowIntensity { get; set; } 111 | public static ConfigEntry LighthouseMysticalGlowIntensity { get; set; } 112 | public static ConfigEntry InterchangeMysticalGlowIntensity { get; set; } 113 | public static ConfigEntry WoodsMysticalGlowIntensity { get; set; } 114 | public static ConfigEntry ReserveMysticalGlowIntensity { get; set; } 115 | public static ConfigEntry ShorelineMysticalGlowIntensity { get; set; } 116 | 117 | public static ConfigEntry HealthEffectHit { get; set; } 118 | public static ConfigEntry HitCAIntensity { get; set; } 119 | public static ConfigEntry HitCASpeed { get; set; } 120 | public static ConfigEntry HitCAPower { get; set; } 121 | 122 | public static ConfigEntry HealthEffectPainkiller { get; set; } 123 | public static ConfigEntry PainkillerSaturation { get; set; } 124 | //public static ConfigEntry PainkillerCAIntensity { get; set; } 125 | public static ConfigEntry HealthEffectPain { get; set; } 126 | public static ConfigEntry SunMeshBrightness { get; set; } 127 | public static ConfigEntry SkyBrightness { get; set; } 128 | 129 | public static ConfigEntry Brightness { get; set; } 130 | public static ConfigEntry Tonemap { get; set; } 131 | public static ConfigEntry UseBSGLUT { get; set; } 132 | public static ConfigEntry BloomIntensity { get; set; } 133 | public static ConfigEntry UseBSGCC_Vintage { get; set; } 134 | public static ConfigEntry UseBSGCC_Sharpen { get; set; } 135 | public static ConfigEntry UseBSGGlobalFog { get; set; } 136 | public static ConfigEntry UseBSGColorCorrectionCurves { get; set; } 137 | public static ConfigEntry LightsUseLinearIntensity { get; set; } 138 | public static ConfigEntry SunColor { get; set; } 139 | public static ConfigEntry SkyColor { get; set; } 140 | public static ConfigEntry PresetName { get; set; } 141 | public static ConfigEntry SavePreset { get; set; } 142 | public static ConfigEntry LoadPreset { get; set; } 143 | 144 | public static ConfigEntry GroundZeroFogLevel { get; set; } 145 | public static ConfigEntry StreetsFogLevel { get; set; } 146 | public static ConfigEntry CustomsFogLevel { get; set; } 147 | public static ConfigEntry LighthouseFogLevel { get; set; } 148 | public static ConfigEntry InterchangeFogLevel { get; set; } 149 | public static ConfigEntry WoodsFogLevel { get; set; } 150 | public static ConfigEntry ReserveFogLevel { get; set; } 151 | public static ConfigEntry ShorelineFogLevel { get; set; } 152 | 153 | public static ConfigEntry GroundZeroTonemap { get; set; } 154 | public static ConfigEntry StreetsTonemap { get; set; } 155 | public static ConfigEntry LabsTonemap { get; set; } 156 | public static ConfigEntry CustomsTonemap { get; set; } 157 | public static ConfigEntry FactoryTonemap { get; set; } 158 | public static ConfigEntry FactoryNightTonemap { get; set; } 159 | public static ConfigEntry LighthouseTonemap { get; set; } 160 | public static ConfigEntry InterchangeTonemap { get; set; } 161 | public static ConfigEntry WoodsTonemap { get; set; } 162 | public static ConfigEntry ReserveTonemap { get; set; } 163 | public static ConfigEntry ShorelineTonemap { get; set; } 164 | public static ConfigEntry HideoutTonemap { get; set; } 165 | 166 | public static ConfigEntry GroundZeroACES { get; set; } 167 | public static ConfigEntry GroundZeroACESS { get; set; } 168 | public static ConfigEntry StreetsACES { get; set; } 169 | public static ConfigEntry StreetsACESS { get; set; } 170 | public static ConfigEntry LabsACES { get; set; } 171 | public static ConfigEntry LabsACESS { get; set; } 172 | public static ConfigEntry CustomsACES { get; set; } 173 | public static ConfigEntry CustomsACESS { get; set; } 174 | public static ConfigEntry FactoryACES { get; set; } 175 | public static ConfigEntry FactoryACESS { get; set; } 176 | public static ConfigEntry FactoryNightACES { get; set; } 177 | public static ConfigEntry FactoryNightACESS { get; set; } 178 | public static ConfigEntry LighthouseACES { get; set; } 179 | public static ConfigEntry LighthouseACESS { get; set; } 180 | public static ConfigEntry InterchangeACES { get; set; } 181 | public static ConfigEntry InterchangeACESS { get; set; } 182 | public static ConfigEntry WoodsACES { get; set; } 183 | public static ConfigEntry WoodsACESS { get; set; } 184 | public static ConfigEntry ReserveACES { get; set; } 185 | public static ConfigEntry ReserveACESS { get; set; } 186 | public static ConfigEntry ShorelineACES { get; set; } 187 | public static ConfigEntry ShorelineACESS { get; set; } 188 | public static ConfigEntry HideoutACES { get; set; } 189 | public static ConfigEntry HideoutACESS { get; set; } 190 | 191 | public static ConfigEntry GroundZeroFilmic { get; set; } 192 | public static ConfigEntry GroundZeroFilmicS { get; set; } 193 | public static ConfigEntry StreetsFilmic { get; set; } 194 | public static ConfigEntry StreetsFilmicS { get; set; } 195 | public static ConfigEntry LabsFilmic { get; set; } 196 | public static ConfigEntry LabsFilmicS { get; set; } 197 | public static ConfigEntry CustomsFilmic { get; set; } 198 | public static ConfigEntry CustomsFilmicS { get; set; } 199 | public static ConfigEntry FactoryFilmic { get; set; } 200 | public static ConfigEntry FactoryFilmicS { get; set; } 201 | public static ConfigEntry FactoryNightFilmic { get; set; } 202 | public static ConfigEntry FactoryNightFilmicS { get; set; } 203 | public static ConfigEntry LighthouseFilmic { get; set; } 204 | public static ConfigEntry LighthouseFilmicS { get; set; } 205 | public static ConfigEntry InterchangeFilmic { get; set; } 206 | public static ConfigEntry InterchangeFilmicS { get; set; } 207 | public static ConfigEntry WoodsFilmic { get; set; } 208 | public static ConfigEntry WoodsFilmicS { get; set; } 209 | public static ConfigEntry ReserveFilmic { get; set; } 210 | public static ConfigEntry ReserveFilmicS { get; set; } 211 | public static ConfigEntry ShorelineFilmic { get; set; } 212 | public static ConfigEntry ShorelineFilmicS { get; set; } 213 | public static ConfigEntry HideoutFilmic { get; set; } 214 | public static ConfigEntry HideoutFilmicS { get; set; } 215 | 216 | public static ConfigEntry HideoutSkyColor { get; set; } 217 | 218 | public static ConfigEntry LightColorIndex0 { get; set; } 219 | public static ConfigEntry LightColorIndex1 { get; set; } 220 | public static ConfigEntry LightColorIndex2 { get; set; } 221 | public static ConfigEntry LightColorIndex3 { get; set; } 222 | public static ConfigEntry LightColorIndex4 { get; set; } 223 | public static ConfigEntry LightColorIndex5 { get; set; } 224 | 225 | public static ConfigEntry Version { get; set; } 226 | private static bool RequestDefaultValues = false; 227 | 228 | private void Awake() 229 | { 230 | Debug.LogError("Graphics Awake()"); 231 | Hook = new GameObject("Graphics"); 232 | AmandsGraphicsClassComponent = Hook.AddComponent(); 233 | DontDestroyOnLoad(Hook); 234 | } 235 | private void Start() 236 | { 237 | Version = Config.Bind("Versioning", "Version", "0.0.0", new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 1, ReadOnly = true, IsAdvanced = true })); 238 | 239 | if (Version.Value == "0.0.0") 240 | { 241 | // Using New Config File 242 | Version.Value = Info.Metadata.Version.ToString(); 243 | RequestDefaultValues = true; 244 | } 245 | else if (Version.Value != Info.Metadata.Version.ToString()) 246 | { 247 | // Using Old Config File 248 | Version.Value = Info.Metadata.Version.ToString(); 249 | RequestDefaultValues = true; 250 | } 251 | else 252 | { 253 | // Valid Config File 254 | } 255 | 256 | string AmandsCinematic = "AmandsGraphics Cinematic"; 257 | string AmandsExperimental = "AmandsGraphics Experimental"; 258 | string AmandsFeatures = "AmandsGraphics Features"; 259 | 260 | GraphicsToggle = Config.Bind(AmandsFeatures, "GraphicsToggle", new KeyboardShortcut(KeyCode.Insert), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 610 })); 261 | DebugMode = Config.Bind(AmandsFeatures, "DebugMode", EDebugMode.HBAO, new ConfigDescription("Shift + Insert will toggle only the selected DebugMode feature", null, new ConfigurationManagerAttributes { Order = 600 })); 262 | 263 | MotionBlur = Config.Bind(AmandsCinematic, "MotionBlur", EEnabledFeature.Off, new ConfigDescription("Motion Blur needs anti-aliasing set to TAA to work as intended", null, new ConfigurationManagerAttributes { Order = 670 })); 264 | MotionBlurSampleCount = Config.Bind(AmandsCinematic, "MotionBlur SampleCount", 10, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 660, IsAdvanced = true })); 265 | MotionBlurShutterAngle = Config.Bind(AmandsCinematic, "MotionBlur ShutterAngle", 270f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 650, IsAdvanced = true })); 266 | 267 | HBAO = Config.Bind(AmandsCinematic, "HBAO", EEnabledFeature.Off, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 640 })); 268 | HBAOIntensity = Config.Bind(AmandsCinematic, "HBAO Intensity", 1.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 630, IsAdvanced = true })); 269 | HBAOSaturation = Config.Bind(AmandsCinematic, "HBAO Saturation", 1.5f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 620, IsAdvanced = true })); 270 | HBAOAlbedoMultiplier = Config.Bind(AmandsCinematic, "HBAO Albedo Multiplier", 2f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 610, IsAdvanced = true })); 271 | 272 | SurroundDepthOfField = Config.Bind(AmandsCinematic, "SurroundDepthOfField", EDepthOfField.Off, new ConfigDescription("High-Quality Color needs to be Enabled on Graphics Settings", null, new ConfigurationManagerAttributes { Order = 600 })); 273 | SurroundDOFOpticZoom = Config.Bind(AmandsCinematic, "SurroundDOF OpticZoom", 2f, new ConfigDescription("DepthOfField will be enabled if the zoom is greater than or equal to this value", new AcceptableValueRange(1f, 25f), new ConfigurationManagerAttributes { Order = 590, IsAdvanced = true })); 274 | SurroundDOFAperture = Config.Bind(AmandsCinematic, "SurroundDOF Aperture", 5.6f, new ConfigDescription("The smaller the value is, the shallower the depth of field is", new AcceptableValueRange(0.01f, 128f), new ConfigurationManagerAttributes { Order = 580, IsAdvanced = true })); 275 | SurroundDOFSpeed = Config.Bind(AmandsCinematic, "SurroundDOF Speed", 16f, new ConfigDescription("Animation speed", new AcceptableValueRange(0.1f, 32f), new ConfigurationManagerAttributes { Order = 570, IsAdvanced = true })); 276 | SurroundDOFFocalLength = Config.Bind(AmandsCinematic, "SurroundDOF FocalLength", 25f, new ConfigDescription("The larger the value is, the shallower the depth of field is", new AcceptableValueRange(0f, 100f), new ConfigurationManagerAttributes { Order = 560, IsAdvanced = true })); 277 | SurroundDOFFocalLengthOff = Config.Bind(AmandsCinematic, "SurroundDOF FocalLength Off", 4f, new ConfigDescription("The larger the value is, the shallower the depth of field is. Used by animation to determinate what's considered off", new AcceptableValueRange(0f, 100f), new ConfigurationManagerAttributes { Order = 550, IsAdvanced = true })); 278 | DOFKernelSize = Config.Bind(AmandsCinematic, "DOF KernelSize", KernelSize.Medium, new ConfigDescription("This setting determines the maximum radius of bokeh", null, new ConfigurationManagerAttributes { Order = 540, IsAdvanced = true })); 279 | 280 | UIDepthOfField = Config.Bind(AmandsCinematic, "UIDepthOfField", EUIDepthOfField.Off, new ConfigDescription("High-Quality Color needs to be Enabled on Graphics Settings\"", null, new ConfigurationManagerAttributes { Order = 390 })); 281 | UIDOFDistance = Config.Bind(AmandsCinematic, "UIDOF Distance", 0.2f, new ConfigDescription("Focus point distance", new AcceptableValueRange(0.01f, 1f), new ConfigurationManagerAttributes { Order = 380, IsAdvanced = true })); 282 | UIDOFAperture = Config.Bind(AmandsCinematic, "UIDOF Aperture", 5.6f, new ConfigDescription("The smaller the value is, the shallower the depth of field is", new AcceptableValueRange(0.01f, 128f), new ConfigurationManagerAttributes { Order = 370, IsAdvanced = true })); 283 | UIDOFSpeed = Config.Bind(AmandsCinematic, "UIDOF Speed", 4f, new ConfigDescription("Animation speed", new AcceptableValueRange(0.1f, 32f), new ConfigurationManagerAttributes { Order = 360, IsAdvanced = true })); 284 | UIDOFFocalLength = Config.Bind(AmandsCinematic, "UIDOF FocalLength", 25f, new ConfigDescription("The larger the value is, the shallower the depth of field is", new AcceptableValueRange(0f, 100f), new ConfigurationManagerAttributes { Order = 350, IsAdvanced = true })); 285 | 286 | WeaponDepthOfField = Config.Bind(AmandsCinematic, "WeaponDepthOfField", EWeaponDepthOfField.Off, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 340 })); 287 | WeaponDOFSpeed = Config.Bind(AmandsCinematic, "WeaponDOF Speed", 6.0f, new ConfigDescription("Animation speed", new AcceptableValueRange(0.1f, 32f), new ConfigurationManagerAttributes { Order = 330, IsAdvanced = true })); 288 | WeaponDOFWeaponMaxBlurSize = Config.Bind(AmandsCinematic, "WeaponDOF Weapon Blur", 2f, new ConfigDescription("Max Blur Size", new AcceptableValueRange(0.01f, 10f), new ConfigurationManagerAttributes { Order = 320, IsAdvanced = true })); 289 | WeaponDOFIronSightMaxBlurSize = Config.Bind(AmandsCinematic, "WeaponDOF IronSight Blur", 3f, new ConfigDescription("Max Blur Size when aiming with iron sights", new AcceptableValueRange(0.01f, 10f), new ConfigurationManagerAttributes { Order = 310, IsAdvanced = true })); 290 | WeaponDOFSightMaxBlurSize = Config.Bind(AmandsCinematic, "WeaponDOF Sight Blur", 4f, new ConfigDescription("Max Blur Size when aiming with sights", new AcceptableValueRange(0.01f, 10f), new ConfigurationManagerAttributes { Order = 300, IsAdvanced = true })); 291 | WeaponDOFNVGMaxBlurSize = Config.Bind(AmandsCinematic, "WeaponDOF NVG Blur", 4f, new ConfigDescription("Max Blur Size when aiming with sights", new AcceptableValueRange(0.01f, 10f), new ConfigurationManagerAttributes { Order = 298, IsAdvanced = true })); 292 | WeaponDOFWeaponFocalLength = Config.Bind(AmandsCinematic, "WeaponDOF Weapon FocalLength", 25f, new ConfigDescription("", new AcceptableValueRange(0.01f, 100f), new ConfigurationManagerAttributes { Order = 290, IsAdvanced = true })); 293 | WeaponDOFIronSightFocalLength = Config.Bind(AmandsCinematic, "WeaponDOF IronSight FocalLength", 30f, new ConfigDescription("", new AcceptableValueRange(0.01f, 100f), new ConfigurationManagerAttributes { Order = 280, IsAdvanced = true })); 294 | WeaponDOFSightFocalLength = Config.Bind(AmandsCinematic, "WeaponDOF Sight FocalLength", 90f, new ConfigDescription("", new AcceptableValueRange(0.01f, 100f), new ConfigurationManagerAttributes { Order = 270, IsAdvanced = true })); 295 | WeaponDOFNVGFocalLength = Config.Bind(AmandsCinematic, "WeaponDOF NVG FocalLength", 100f, new ConfigDescription("", new AcceptableValueRange(0.01f, 100f), new ConfigurationManagerAttributes { Order = 268, IsAdvanced = true })); 296 | WeaponDOFAperture = Config.Bind(AmandsCinematic, "WeaponDOF Aperture", 0.25f, new ConfigDescription("", new AcceptableValueRange(0.01f, 2f), new ConfigurationManagerAttributes { Order = 260, IsAdvanced = true })); 297 | WeaponDOFBlurSampleCount = Config.Bind(AmandsCinematic, "WeaponDOF BlurSampleCount", UnityStandardAssets.ImageEffects.DepthOfField.BlurSampleCount.High, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 250, IsAdvanced = true })); 298 | 299 | OpticDepthOfField = Config.Bind(AmandsCinematic, "OpticDepthOfField", EDepthOfField.Off, new ConfigDescription("High-Quality Color needs to be Enabled on Graphics Settings\"", null, new ConfigurationManagerAttributes { Order = 240 })); 300 | OpticDOFOpticZoom = Config.Bind(AmandsCinematic, "OpticDOF OpticZoom", 2f, new ConfigDescription("OpticDepthOfField will be enabled if the zoom is greater than or equal to this value", new AcceptableValueRange(1f, 25f), new ConfigurationManagerAttributes { Order = 230, IsAdvanced = true })); 301 | OpticDOFAperture1x = Config.Bind(AmandsCinematic, "OpticDOF Aperture 1x", 64f, new ConfigDescription("The smaller the value is, the shallower the depth of field is at 1x zoom", new AcceptableValueRange(0.01f, 128f), new ConfigurationManagerAttributes { Order = 220, IsAdvanced = true })); 302 | OpticDOFAperture2x = Config.Bind(AmandsCinematic, "OpticDOF Aperture 2x", 32f, new ConfigDescription("The smaller the value is, the shallower the depth of field is at 2x zoom", new AcceptableValueRange(0.01f, 128f), new ConfigurationManagerAttributes { Order = 210, IsAdvanced = true })); 303 | OpticDOFAperture4x = Config.Bind(AmandsCinematic, "OpticDOF Aperture 4x", 8f, new ConfigDescription("The smaller the value is, the shallower the depth of field is at 4x zoom", new AcceptableValueRange(0.01f, 128f), new ConfigurationManagerAttributes { Order = 200, IsAdvanced = true })); 304 | OpticDOFAperture6x = Config.Bind(AmandsCinematic, "OpticDOF Aperture 6x", 5.6f, new ConfigDescription("The smaller the value is, the shallower the depth of field is at 6x zoom and above", new AcceptableValueRange(0.01f, 128f), new ConfigurationManagerAttributes { Order = 190, IsAdvanced = true })); 305 | OpticDOFSpeed = Config.Bind(AmandsCinematic, "OpticDOF Speed", 4f, new ConfigDescription("Animation speed", new AcceptableValueRange(0.1f, 32f), new ConfigurationManagerAttributes { Order = 180, IsAdvanced = true })); 306 | OpticDOFFocalLengthMode = Config.Bind(AmandsCinematic, "OpticDOF FocalLength Mode", EOpticDOFFocalLengthMode.Math, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 170, IsAdvanced = true })); 307 | OpticDOFFocalLength = Config.Bind(AmandsCinematic, "OpticDOF FocalLength", 100f, new ConfigDescription("", new AcceptableValueRange(1f, 500f), new ConfigurationManagerAttributes { Order = 160, IsAdvanced = true })); 308 | OpticDOFKernelSize = Config.Bind(AmandsCinematic, "OpticDOF KernelSize", KernelSize.Medium, new ConfigDescription("This setting determines the maximum radius of bokeh", null, new ConfigurationManagerAttributes { Order = 150, IsAdvanced = true })); 309 | OpticDOFRaycastQuality = Config.Bind(AmandsCinematic, "OpticDOF Raycast Quality", ERaycastQuality.High, new ConfigDescription("Low: Simple LowPoly Raycast\n High: HighPoly Raycast and Target Detection\n Foliage: 2 Raycasts Targets have priority behind foliage", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 310 | OpticDOFDistanceSpeed = Config.Bind(AmandsCinematic, "OpticDOF Distance Speed", 15f, new ConfigDescription("Distance animation speed", new AcceptableValueRange(0.1f, 25f), new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 311 | OpticDOFRaycastDistance = Config.Bind(AmandsCinematic, "OpticDOF Raycast Distance", 1000f, new ConfigDescription("The max distance the ray should check for collisions", new AcceptableValueRange(10f, 10000f), new ConfigurationManagerAttributes { Order = 120, IsAdvanced = true })); 312 | OpticDOFTargetDistance = Config.Bind(AmandsCinematic, "OpticDOF Target Distance", 50.0f, new ConfigDescription("Aiming distance window on spotted target in cm", new AcceptableValueRange(0.0f, 200f), new ConfigurationManagerAttributes { Order = 110, IsAdvanced = true })); 313 | 314 | Flashlight = Config.Bind(AmandsExperimental, "Flashlight", EEnabledFeature.On, new ConfigDescription("EXPERIMENTAL", null, new ConfigurationManagerAttributes { Order = 170 })); 315 | FlashlightRange = Config.Bind(AmandsExperimental, "Flashlight Range", 2f, new ConfigDescription("Flashlights range multiplier", new AcceptableValueRange(0.5f, 4f), new ConfigurationManagerAttributes { Order = 160 })); 316 | FlashlightExtinctionCoef = Config.Bind(AmandsExperimental, "Flashlight ExtinctionCoef", 0.2f, new ConfigDescription("Volumetric extinction coefficient", new AcceptableValueRange(0.001f, 1f), new ConfigurationManagerAttributes { Order = 150 })); 317 | 318 | NVG = Config.Bind(AmandsExperimental, "NVG", EEnabledFeature.On, new ConfigDescription("EXPERIMENTAL", null, new ConfigurationManagerAttributes { Order = 150 })); 319 | NVGTonemap = Config.Bind(AmandsExperimental, "NVG Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 142, IsAdvanced = true })); 320 | NVGAmbientContrast = Config.Bind(AmandsExperimental, "NVG AmbientContrast", 1f, new ConfigDescription("", new AcceptableValueRange(1f, 1.5f), new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 321 | NVGNoiseIntensity = Config.Bind(AmandsExperimental, "NVG Noise Intensity", 0.8f, new ConfigDescription("", new AcceptableValueRange(0f, 2f), new ConfigurationManagerAttributes { Order = 130 })); 322 | NVGOriginalColor = Config.Bind(AmandsExperimental, "NVG Original Color", false, new ConfigDescription("Enables back all default color filters", null, new ConfigurationManagerAttributes { Order = 120 })); 323 | NVGOriginalSkyColor = Config.Bind(AmandsExperimental, "NVG Original Sky Color", 0.1f, new ConfigDescription("Enables back the default sky color for NVG", new AcceptableValueRange(0.001f, 1f), new ConfigurationManagerAttributes { Order = 110 })); 324 | NVGMoonLightIntensity = Config.Bind(AmandsExperimental, "NVG Moon LightIntensity", 1f, new ConfigDescription("", new AcceptableValueRange(0.5f, 2f), new ConfigurationManagerAttributes { Order = 90 })); 325 | 326 | NightAmbientLight = Config.Bind(AmandsExperimental, "Night AmbientLight", EEnabledFeature.Off, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 80 })); 327 | NightAmbientContrast = Config.Bind(AmandsExperimental, "Night AmbientAmbientContrast", 1.1f, new ConfigDescription("", new AcceptableValueRange(1.1f, 1.15f), new ConfigurationManagerAttributes { Order = 70, IsAdvanced = true })); 328 | MysticalGlow = Config.Bind(AmandsExperimental, "MysticalGlow", EEnabledFeature.Off, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 60 })); 329 | MysticalGlowIntensity = Config.Bind(AmandsExperimental, "MysticalGlow Intensity", 0.05f, new ConfigDescription("", new AcceptableValueRange(0.0f, 0.1f), new ConfigurationManagerAttributes { Order = 50, IsAdvanced = true })); 330 | 331 | HealthEffectHit = Config.Bind(AmandsExperimental, "HealthEffect Hit", EEnabledFeature.Off, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 40 })); 332 | HitCAIntensity = Config.Bind(AmandsExperimental, "ChromaticAberration", 0.5f, new ConfigDescription("", new AcceptableValueRange(0.0f, 2.0f), new ConfigurationManagerAttributes { Order = 30 })); 333 | HitCASpeed = Config.Bind(AmandsExperimental, "ChromaticAberration Speed", 1.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 20, IsAdvanced = true })); 334 | HitCAPower = Config.Bind(AmandsExperimental, "ChromaticAberration Power", 100.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 10, IsAdvanced = true })); 335 | 336 | HealthEffectPainkiller = Config.Bind(AmandsExperimental, "HealthEffect Painkiller", EEnabledFeature.Off, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 8 })); 337 | PainkillerSaturation = Config.Bind(AmandsExperimental, "Painkiller Saturation", 0.5f, new ConfigDescription("", new AcceptableValueRange(0.0f, 2.0f), new ConfigurationManagerAttributes { Order = 6 })); 338 | //PainkillerCAIntensity = Config.Bind(AmandsExperimental, "Painkiller ChromaticAberration", 0.5f, new ConfigDescription("", new AcceptableValueRange(0.0f, 2.0f), new ConfigurationManagerAttributes { Order = 4 })); 339 | HealthEffectPain = Config.Bind(AmandsExperimental, "HealthEffect Pain", EEnabledFeature.Off, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 4 })); 340 | SunMeshBrightness = Config.Bind(AmandsExperimental, "SunMeshBrightness", 2.0f, new ConfigDescription("", new AcceptableValueRange(0.25f, 3.0f), new ConfigurationManagerAttributes { Order = 2 })); 341 | SkyBrightness = Config.Bind(AmandsExperimental, "SkyBrightness", 1.0f, new ConfigDescription("", new AcceptableValueRange(0.1f, 2.0f), new ConfigurationManagerAttributes { Order = 1 })); 342 | 343 | Brightness = Config.Bind(AmandsFeatures, "Brightness", 0.5f, new ConfigDescription("EXPERIMENTAL", new AcceptableValueRange(0f, 1f), new ConfigurationManagerAttributes { Order = 340 })); 344 | Tonemap = Config.Bind(AmandsFeatures, "Tonemap", EGlobalTonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 330 })); 345 | UseBSGLUT = Config.Bind(AmandsFeatures, "Use BSG LUT", false, new ConfigDescription("Enabling this will revert the mod changes", null, new ConfigurationManagerAttributes { Order = 320, IsAdvanced = true })); 346 | BloomIntensity = Config.Bind(AmandsFeatures, "Bloom Intensity", 0.5f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 310 })); 347 | UseBSGCC_Vintage = Config.Bind(AmandsFeatures, "Use BSG CC_Vintage", false, new ConfigDescription("Enabling this will revert the mod changes", null, new ConfigurationManagerAttributes { Order = 300, IsAdvanced = true })); 348 | UseBSGCC_Sharpen = Config.Bind(AmandsFeatures, "Use BSG CC_Sharpen", false, new ConfigDescription("Enabling this will revert the mod changes", null, new ConfigurationManagerAttributes { Order = 290, IsAdvanced = true })); 349 | UseBSGGlobalFog = Config.Bind(AmandsFeatures, "Use BSG GlobalFog", false, new ConfigDescription("Enabling this will revert the mod changes", null, new ConfigurationManagerAttributes { Order = 260, IsAdvanced = true })); 350 | UseBSGColorCorrectionCurves = Config.Bind(AmandsFeatures, "Use BSG ColorCorrection", false, new ConfigDescription("Enabling this will revert the mod changes", null, new ConfigurationManagerAttributes { Order = 250, IsAdvanced = true })); 351 | LightsUseLinearIntensity = Config.Bind(AmandsFeatures, "LightsUseLinearIntensity", false, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 240 })); 352 | SunColor = Config.Bind(AmandsFeatures, "SunColor", true, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 230 })); 353 | SkyColor = Config.Bind(AmandsFeatures, "SkyColor", true, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 220 })); 354 | 355 | GroundZeroFogLevel = Config.Bind("GroundZero", "Fog Level", -250.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 210 })); 356 | GroundZeroTonemap = Config.Bind("GroundZero", "Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 209 })); 357 | GroundZeroACES = Config.Bind("GroundZero", "ACES", new Vector3(25, 0.2f, 25), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 208, IsAdvanced = true })); 358 | GroundZeroACESS = Config.Bind("GroundZero", "ACESS", new Vector3(0, 1.1f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 200, IsAdvanced = true })); 359 | GroundZeroFilmic = Config.Bind("GroundZero", "Filmic", new Vector3(10f, 2f, 1.75f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 190, IsAdvanced = true })); 360 | GroundZeroFilmicS = Config.Bind("GroundZero", "FilmicS", new Vector3(0, 0.4f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 180, IsAdvanced = true })); 361 | GroundZeroMysticalGlowIntensity = Config.Bind("GroundZero", "MysticalGlow Intensity", 0.75f, new ConfigDescription("", new AcceptableValueRange(0.0f, 2.0f), new ConfigurationManagerAttributes { Order = 170, IsAdvanced = true })); 362 | 363 | StreetsFogLevel = Config.Bind("Streets", "Fog Level", -250.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 160 })); 364 | StreetsTonemap = Config.Bind("Streets", "Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 150 })); 365 | StreetsACES = Config.Bind("Streets", "ACES", new Vector3(25, 0.2f, 25), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 366 | StreetsACESS = Config.Bind("Streets", "ACESS", new Vector3(0, 1.1f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 367 | StreetsFilmic = Config.Bind("Streets", "Filmic", new Vector3(10f, 2f, 1.75f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 120, IsAdvanced = true })); 368 | StreetsFilmicS = Config.Bind("Streets", "FilmicS", new Vector3(0, 0.4f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 110, IsAdvanced = true })); 369 | StreetsMysticalGlowIntensity = Config.Bind("Streets", "MysticalGlow Intensity", 0.75f, new ConfigDescription("", new AcceptableValueRange(0.0f, 2.0f), new ConfigurationManagerAttributes { Order = 100, IsAdvanced = true })); 370 | 371 | LabsTonemap = Config.Bind("Labs", "Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 150 })); 372 | LabsACES = Config.Bind("Labs", "ACES", new Vector3(20, 0.4f, 20), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 373 | LabsACESS = Config.Bind("Labs", "ACESS", new Vector3(0, 1f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 374 | LabsFilmic = Config.Bind("Labs", "Filmic", new Vector3(8f, 2f, 1.75f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 120, IsAdvanced = true })); 375 | LabsFilmicS = Config.Bind("Labs", "FilmicS", new Vector3(0, 0.4f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 110, IsAdvanced = true })); 376 | LabsHBAOIntensity = Config.Bind("Labs", "HBAO Intensity", 0.5f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 100, IsAdvanced = true })); 377 | LabsHBAOSaturation = Config.Bind("Labs", "HBAO Saturation", 1.5f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 90, IsAdvanced = true })); 378 | LabsHBAOAlbedoMultiplier = Config.Bind("Labs", "HBAO Albedo Multiplier", 2f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 80, IsAdvanced = true })); 379 | 380 | CustomsFogLevel = Config.Bind("Customs", "Fog Level", -100.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 160 })); 381 | CustomsTonemap = Config.Bind("Customs", "Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 150 })); 382 | CustomsACES = Config.Bind("Customs", "ACES", new Vector3(20, 0.2f, 20), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 383 | CustomsACESS = Config.Bind("Customs", "ACESS", new Vector3(0, 1, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 384 | CustomsFilmic = Config.Bind("Customs", "Filmic", new Vector3(10f, 2f, 1.75f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 120, IsAdvanced = true })); 385 | CustomsFilmicS = Config.Bind("Customs", "FilmicS", new Vector3(0, 0.4f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 110, IsAdvanced = true })); 386 | CustomsMysticalGlowIntensity = Config.Bind("Customs", "MysticalGlow Intensity", 1.0f, new ConfigDescription("", new AcceptableValueRange(0.0f, 2.0f), new ConfigurationManagerAttributes { Order = 100, IsAdvanced = true })); 387 | 388 | FactoryTonemap = Config.Bind("Factory", "Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 170 })); 389 | FactoryACES = Config.Bind("Factory", "ACES", new Vector3(25f, 0.6f, 25f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 160, IsAdvanced = true })); 390 | FactoryACESS = Config.Bind("Factory", "ACESS", new Vector3(0, 1f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 150, IsAdvanced = true })); 391 | FactoryFilmic = Config.Bind("Factory", "Filmic", new Vector3(5f, 2f, 1.75f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 392 | FactoryFilmicS = Config.Bind("Factory", "FilmicS", new Vector3(0, 0.3f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 393 | 394 | FactoryNightTonemap = Config.Bind("FactoryNight", "Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 170 })); 395 | FactoryNightACES = Config.Bind("FactoryNight", "ACES", new Vector3(25f, 0.6f, 25f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 160, IsAdvanced = true })); 396 | FactoryNightACESS = Config.Bind("FactoryNight", "ACESS", new Vector3(0, 1f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 150, IsAdvanced = true })); 397 | FactoryNightFilmic = Config.Bind("FactoryNight", "Filmic", new Vector3(5f, 2f, 1.75f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 398 | FactoryNightFilmicS = Config.Bind("FactoryNight", "FilmicS", new Vector3(0, 0.26f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 399 | 400 | LighthouseFogLevel = Config.Bind("Lighthouse", "Fog Level", -100.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 160 })); 401 | LighthouseTonemap = Config.Bind("Lighthouse", "Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 150 })); 402 | LighthouseACES = Config.Bind("Lighthouse", "ACES", new Vector3(20, 0.2f, 20), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 403 | LighthouseACESS = Config.Bind("Lighthouse", "ACESS", new Vector3(0, 1, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 404 | LighthouseFilmic = Config.Bind("Lighthouse", "Filmic", new Vector3(10f, 2f, 1.75f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 120, IsAdvanced = true })); 405 | LighthouseFilmicS = Config.Bind("Lighthouse", "FilmicS", new Vector3(0, 0.4f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 110, IsAdvanced = true })); 406 | LighthouseMysticalGlowIntensity = Config.Bind("Lighthouse", "MysticalGlow Intensity", 0.75f, new ConfigDescription("", new AcceptableValueRange(0.0f, 2.0f), new ConfigurationManagerAttributes { Order = 100, IsAdvanced = true })); 407 | 408 | InterchangeNightAmbientContrast = Config.Bind("Interchange", "Night AmbientAmbientContrast", 1.14f, new ConfigDescription("", new AcceptableValueRange(1.1f, 1.15f), new ConfigurationManagerAttributes { Order = 170 })); 409 | InterchangeFogLevel = Config.Bind("Interchange", "Fog Level", -100.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 160 })); 410 | InterchangeNVGNoiseIntensity = Config.Bind("Interchange", "NVG Noise Intensity", 0.25f, new ConfigDescription("", new AcceptableValueRange(0f, 1f), new ConfigurationManagerAttributes { Order = 158 })); 411 | InterchangeNVGAmbientContrast = Config.Bind("Interchange", "NVG AmbientContrast", 1.1f, new ConfigDescription("", new AcceptableValueRange(1f, 1.5f), new ConfigurationManagerAttributes { Order = 156 })); 412 | InterchangeNVGOriginalSkyColor = Config.Bind("Interchange", "NVG Original Sky Color", 0.7f, new ConfigDescription("Enables back the default sky color for NVG", new AcceptableValueRange(0.001f, 1f), new ConfigurationManagerAttributes { Order = 154, IsAdvanced = true })); 413 | InterchangeTonemap = Config.Bind("Interchange", "Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 150 })); 414 | InterchangeACES = Config.Bind("Interchange", "ACES", new Vector3(20, 0.2f, 18), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 415 | InterchangeACESS = Config.Bind("Interchange", "ACESS", new Vector3(0, 1f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 416 | InterchangeFilmic = Config.Bind("Interchange", "Filmic", new Vector3(10f, 2f, 1.75f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 120, IsAdvanced = true })); 417 | InterchangeFilmicS = Config.Bind("Interchange", "FilmicS", new Vector3(0, 0.4f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 110, IsAdvanced = true })); 418 | InterchangeMysticalGlowIntensity = Config.Bind("Interchange", "MysticalGlow Intensity", 0.45f, new ConfigDescription("", new AcceptableValueRange(0.0f, 2.0f), new ConfigurationManagerAttributes { Order = 100, IsAdvanced = true })); 419 | 420 | WoodsFogLevel = Config.Bind("Woods", "Fog Level", -100.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 160 })); 421 | WoodsTonemap = Config.Bind("Woods", "Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 150 })); 422 | WoodsACES = Config.Bind("Woods", "ACES", new Vector3(20, 0.2f, 20), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 423 | WoodsACESS = Config.Bind("Woods", "ACESS", new Vector3(0, 1, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 424 | WoodsFilmic = Config.Bind("Woods", "Filmic", new Vector3(10f, 2f, 1.75f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 120, IsAdvanced = true })); 425 | WoodsFilmicS = Config.Bind("Woods", "FilmicS", new Vector3(0, 0.4f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 110, IsAdvanced = true })); 426 | WoodsMysticalGlowIntensity = Config.Bind("Woods", "MysticalGlow Intensity", 1.25f, new ConfigDescription("", new AcceptableValueRange(0.0f, 2.0f), new ConfigurationManagerAttributes { Order = 100, IsAdvanced = true })); 427 | 428 | ReserveFogLevel = Config.Bind("Reserve", "Fog Level", -100.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 160 })); 429 | ReserveTonemap = Config.Bind("Reserve", "Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 150 })); 430 | ReserveACES = Config.Bind("Reserve", "ACES", new Vector3(20, 0.2f, 20), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 431 | ReserveACESS = Config.Bind("Reserve", "ACESS", new Vector3(0, 0.85f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 432 | ReserveFilmic = Config.Bind("Reserve", "Filmic", new Vector3(10f, 2f, 1.75f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 120, IsAdvanced = true })); 433 | ReserveFilmicS = Config.Bind("Reserve", "FilmicS", new Vector3(0, 0.4f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 110, IsAdvanced = true })); 434 | ReserveMysticalGlowIntensity = Config.Bind("Reserve", "MysticalGlow Intensity", 0.75f, new ConfigDescription("", new AcceptableValueRange(0.0f, 2.0f), new ConfigurationManagerAttributes { Order = 100, IsAdvanced = true })); 435 | 436 | ShorelineFogLevel = Config.Bind("Shoreline", "Fog Level", -100.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 160 })); 437 | ShorelineTonemap = Config.Bind("Shoreline", "Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 150 })); 438 | ShorelineACES = Config.Bind("Shoreline", "ACES", new Vector3(20, 0.2f, 20), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 439 | ShorelineACESS = Config.Bind("Shoreline", "ACESS", new Vector3(0, 1, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 440 | ShorelineFilmic = Config.Bind("Shoreline", "Filmic", new Vector3(10f, 2f, 1.75f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 120, IsAdvanced = true })); 441 | ShorelineFilmicS = Config.Bind("Shoreline", "FilmicS", new Vector3(0, 0.4f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 110, IsAdvanced = true })); 442 | ShorelineMysticalGlowIntensity = Config.Bind("Shoreline", "MysticalGlow Intensity", 0.5f, new ConfigDescription("", new AcceptableValueRange(0.0f, 2.0f), new ConfigurationManagerAttributes { Order = 100, IsAdvanced = true })); 443 | 444 | HideoutTonemap = Config.Bind("Hideout", "Tonemap", ETonemap.ACES, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 160 })); 445 | HideoutACES = Config.Bind("Hideout", "ACES", new Vector3(8, -0.1f, 8), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 150, IsAdvanced = true })); 446 | HideoutACESS = Config.Bind("Hideout", "ACESS", new Vector3(0, 0.85f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 447 | HideoutFilmic = Config.Bind("Hideout", "Filmic", new Vector3(4f, 2.1f, 1.75f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 448 | HideoutFilmicS = Config.Bind("Hideout", "FilmicS", new Vector3(0, 0.65f, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 120, IsAdvanced = true })); 449 | HideoutSkyColor = Config.Bind("Hideout", "SkyColor", new Vector4(0.6f, 0.6f, 0.6f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 110, IsAdvanced = true })); 450 | 451 | LightColorIndex0 = Config.Bind("AmandsGraphics LightColor", "Index0", new Vector4(232.0f, 240.0f, 255.0f) / 255.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 160, IsAdvanced = true })); 452 | LightColorIndex1 = Config.Bind("AmandsGraphics LightColor", "Index1", new Vector4(0, 0, 0), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 150, IsAdvanced = true })); 453 | //LightColorIndex2 = Config.Bind("AmandsGraphics LightColor", "Index2", new Vector4(255.0f, 186.0f, 168.0f) / 255.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 454 | LightColorIndex2 = Config.Bind("AmandsGraphics LightColor", "Index2", new Vector4(1.0f, 0.457f, 0.322f, 1.0f), new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 140, IsAdvanced = true })); 455 | LightColorIndex3 = Config.Bind("AmandsGraphics LightColor", "Index3", new Vector4(219.0f, 191.0f, 160.0f) / 255.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 130, IsAdvanced = true })); 456 | LightColorIndex4 = Config.Bind("AmandsGraphics LightColor", "Index4", new Vector4(255.0f, 238.0f, 196.0f) / 255.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 120, IsAdvanced = true })); 457 | LightColorIndex5 = Config.Bind("AmandsGraphics LightColor", "Index5", new Vector4(150.0f, 143.0f, 122.0f) / 255.0f, new ConfigDescription("", null, new ConfigurationManagerAttributes { Order = 110, IsAdvanced = true })); 458 | 459 | if (RequestDefaultValues) DefaultValues(); 460 | 461 | new AmandsPlayerPatch().Enable(); 462 | new AmandsGraphicsNVGPatch().Enable(); 463 | new AmandsGraphicsApplyNVGPatch().Enable(); 464 | new AmandsGraphicsHBAOPatch().Enable(); 465 | new AmandsGraphicsPrismEffectsPatch().Enable(); 466 | new AmandsGraphicsOpticPatch().Enable(); 467 | new AmandsGraphicsOpticSightPatch().Enable(); 468 | new AmandsGraphicsCameraClassPatch().Enable(); 469 | new AmandsGraphicsmethod_25Patch().Enable(); 470 | new AmandsGraphicsTacticalComboVisualControllerPatch().Enable(); 471 | new AmandsGraphicsFastBlurPatch().Enable(); 472 | new AmandsGraphicsMethod_7Patch().Enable(); 473 | new AmandsGraphicsFastBlurHitPatch().Enable(); 474 | new AmandsBattleUIScreenPatch().Enable(); 475 | new AmandsEffectsControllerPatch().Enable(); 476 | } 477 | private void DefaultValues() 478 | { 479 | LabsACES.Value = (Vector3)LabsACES.DefaultValue; 480 | LabsACESS.Value = (Vector3)LabsACESS.DefaultValue; 481 | LabsFilmicS.Value = (Vector3)LabsFilmicS.DefaultValue; 482 | FactoryACES.Value = (Vector3)FactoryACES.DefaultValue; 483 | FactoryACESS.Value = (Vector3)FactoryACESS.DefaultValue; 484 | FactoryFilmic.Value = (Vector3)FactoryFilmic.DefaultValue; 485 | FactoryNightACES.Value = (Vector3)FactoryNightACES.DefaultValue; 486 | FactoryNightACESS.Value = (Vector3)FactoryNightACESS.DefaultValue; 487 | FactoryNightFilmic.Value = (Vector3)FactoryNightFilmic.DefaultValue; 488 | FactoryNightFilmicS.Value = (Vector3)FactoryNightFilmicS.DefaultValue; 489 | } 490 | } 491 | public class AmandsPlayerPatch : ModulePatch 492 | { 493 | protected override MethodBase GetTargetMethod() 494 | { 495 | return typeof(Player).GetMethod("Init", BindingFlags.Instance | BindingFlags.Public); 496 | } 497 | [PatchPostfix] 498 | private static void PatchPostFix(ref Player __instance) 499 | { 500 | if (__instance != null && __instance.IsYourPlayer) 501 | { 502 | AmandsGraphicsClass.Player = __instance; 503 | } 504 | } 505 | } 506 | public class AmandsGraphicsNVGPatch : ModulePatch 507 | { 508 | protected override MethodBase GetTargetMethod() 509 | { 510 | return typeof(BSG.CameraEffects.NightVision).GetMethods(BindingFlags.Instance | BindingFlags.Public).First(x => x.GetParameters().Count() == 1 && x.GetParameters()[0].Name == "on" && x.Name != "StartSwitch"); 511 | } 512 | [PatchPostfix] 513 | private static void PatchPostFix(ref BSG.CameraEffects.NightVision __instance, bool on) 514 | { 515 | if (AmandsGraphicsPlugin.AmandsGraphicsClassComponent.GraphicsMode && AmandsGraphicsClass.Player != null && AmandsGraphicsClass.NVG != on && AmandsGraphicsClass.FPSCameraNightVision != null) 516 | { 517 | AmandsGraphicsClass.NVG = on; 518 | AmandsGraphicsPlugin.AmandsGraphicsClassComponent.UpdateAmandsGraphics(); 519 | } 520 | AmandsGraphicsClass.NVG = on; 521 | } 522 | } 523 | public class AmandsGraphicsApplyNVGPatch : ModulePatch 524 | { 525 | protected override MethodBase GetTargetMethod() 526 | { 527 | return typeof(BSG.CameraEffects.NightVision).GetMethod("StartSwitch", BindingFlags.Instance | BindingFlags.Public); 528 | } 529 | [PatchPostfix] 530 | private static void PatchPostFix(ref BSG.CameraEffects.NightVision __instance) 531 | { 532 | if (AmandsGraphicsPlugin.AmandsGraphicsClassComponent.GraphicsMode && AmandsGraphicsClass.Player != null) 533 | { 534 | AmandsGraphicsClass.defaultNightVisionNoiseIntensity = __instance.NoiseIntensity; 535 | switch (AmandsGraphicsClass.scene) 536 | { 537 | case "Shopping_Mall_Terrain": 538 | __instance.NoiseIntensity = AmandsGraphicsClass.defaultNightVisionNoiseIntensity * AmandsGraphicsPlugin.InterchangeNVGNoiseIntensity.Value; 539 | break; 540 | default: 541 | __instance.NoiseIntensity = AmandsGraphicsClass.defaultNightVisionNoiseIntensity * AmandsGraphicsPlugin.NVGNoiseIntensity.Value; 542 | break; 543 | } 544 | __instance.ApplySettings(); 545 | } 546 | } 547 | } 548 | public class AmandsGraphicsHBAOPatch : ModulePatch 549 | { 550 | protected override MethodBase GetTargetMethod() 551 | { 552 | return typeof(HBAO_Core).GetMethod("ApplyPreset", BindingFlags.Instance | BindingFlags.Public); 553 | } 554 | [PatchPostfix] 555 | private static void PatchPostFix(ref HBAO_Core __instance, HBAO_Core.Preset preset) 556 | { 557 | AmandsGraphicsClass.defaultFPSCameraHBAOAOSettings = __instance.aoSettings; 558 | AmandsGraphicsClass.defaultFPSCameraHBAOColorBleedingSettings = __instance.colorBleedingSettings; 559 | AmandsGraphicsClass.FPSCameraHBAOAOSettings = __instance.aoSettings; 560 | AmandsGraphicsClass.FPSCameraHBAOColorBleedingSettings = __instance.colorBleedingSettings; 561 | } 562 | } 563 | public class AmandsGraphicsPrismEffectsPatch : ModulePatch 564 | { 565 | protected override MethodBase GetTargetMethod() 566 | { 567 | return typeof(PrismEffects).GetMethod("OnEnable", BindingFlags.Instance | BindingFlags.Public); 568 | } 569 | [PatchPostfix] 570 | private static void PatchPostFix(ref PrismEffects __instance) 571 | { 572 | if (__instance.gameObject.name == "FPS Camera") 573 | { 574 | AmandsGraphicsPlugin.AmandsGraphicsClassComponent.GraphicsMode = false; 575 | OnEnableASync(__instance); 576 | } 577 | } 578 | private async static void OnEnableASync(PrismEffects instance) 579 | { 580 | await Task.Delay(100); 581 | AmandsGraphicsPlugin.AmandsGraphicsClassComponent.ActivateAmandsGraphics(instance.gameObject, instance); 582 | } 583 | } 584 | public class AmandsGraphicsOpticPatch : ModulePatch 585 | { 586 | protected override MethodBase GetTargetMethod() 587 | { 588 | return typeof(OpticComponentUpdater).GetMethod("Awake", BindingFlags.Instance | BindingFlags.Public); 589 | } 590 | [PatchPostfix] 591 | private static void PatchPostFix(ref OpticComponentUpdater __instance) 592 | { 593 | if (__instance.gameObject.name == "BaseOpticCamera(Clone)") 594 | { 595 | AmandsGraphicsPlugin.AmandsGraphicsClassComponent.ActivateAmandsOpticDepthOfField(__instance.gameObject); 596 | AmandsGraphicsClass.OpticCameraCamera = __instance.GetComponent(); 597 | AmandsGraphicsClass.OpticCameraThermalVision = __instance.GetComponent(); 598 | } 599 | } 600 | } 601 | public class AmandsGraphicsOpticSightPatch : ModulePatch 602 | { 603 | protected override MethodBase GetTargetMethod() 604 | { 605 | return typeof(OpticSight).GetMethod("OnEnable", BindingFlags.Instance | BindingFlags.Public); 606 | } 607 | [PatchPostfix] 608 | private static void PatchPostFix(ref OpticSight __instance) 609 | { 610 | //AmandsGraphicsClass.opticSight = __instance; 611 | foreach (Transform transform in __instance.gameObject.transform.GetChildren()) 612 | { 613 | if (transform.name.Contains("backLens")) AmandsGraphicsClass.backLens = transform; 614 | } 615 | SightModVisualControllers sightModVisualControllers = __instance.gameObject.GetComponentInParent(); 616 | if (sightModVisualControllers != null) 617 | { 618 | AmandsGraphicsClass.sightComponent = sightModVisualControllers.SightMod; 619 | } 620 | } 621 | } 622 | public class AmandsGraphicsCameraClassPatch : ModulePatch 623 | { 624 | protected override MethodBase GetTargetMethod() 625 | { 626 | return typeof(CameraClass).GetMethod("Blur", BindingFlags.Instance | BindingFlags.Public); 627 | } 628 | [PatchPrefix] 629 | private static bool PatchPrefix(ref CameraClass __instance, bool isActive, float time) 630 | { 631 | AmandsGraphicsClass.CameraClassBlur = isActive; 632 | if (!isActive && __instance.IsActive) 633 | { 634 | return true; 635 | } 636 | return AmandsGraphicsPlugin.UIDepthOfField.Value == EUIDepthOfField.Off; 637 | } 638 | } 639 | public class AmandsGraphicsmethod_25Patch : ModulePatch 640 | { 641 | protected override MethodBase GetTargetMethod() 642 | { 643 | return typeof(EFT.Animations.ProceduralWeaponAnimation).GetMethods(BindingFlags.Instance | BindingFlags.Public).First(x => x.GetParameters().Count() == 1 && x.GetParameters()[0].Name == "currentScopeIndex"); 644 | } 645 | [PatchPostfix] 646 | private static void PatchPostFix(ref EFT.Animations.ProceduralWeaponAnimation __instance) 647 | { 648 | if (AmandsGraphicsClass.Player != null && AmandsGraphicsClass.Player.ProceduralWeaponAnimation == __instance) 649 | { 650 | object CurrentScope = Traverse.Create(AmandsGraphicsClass.Player.ProceduralWeaponAnimation).Property("CurrentScope").GetValue(); 651 | if (CurrentScope != null) 652 | { 653 | ScopePrefabCache scopePrefabCache = Traverse.Create(CurrentScope).Field("ScopePrefabCache").GetValue(); 654 | if (scopePrefabCache != null) 655 | { 656 | SightComponent Mod = Traverse.Create(CurrentScope).Field("Mod").GetValue(); 657 | if (Mod != null && Mod.SelectedScopeIndex == 0) 658 | { 659 | AmandsGraphicsClass.aimingMode = EAimingMode.Sight; 660 | } 661 | else 662 | { 663 | AmandsGraphicsClass.aimingMode = EAimingMode.IronSight; 664 | } 665 | } 666 | else 667 | { 668 | AmandsGraphicsClass.aimingMode = EAimingMode.IronSight; 669 | } 670 | } 671 | } 672 | } 673 | } 674 | public class AmandsGraphicsTacticalComboVisualControllerPatch : ModulePatch 675 | { 676 | protected override MethodBase GetTargetMethod() 677 | { 678 | return typeof(TacticalComboVisualController).GetMethod("UpdateBeams", BindingFlags.Instance | BindingFlags.Public); 679 | } 680 | [PatchPostfix] 681 | private static void PatchPostFix(ref TacticalComboVisualController __instance) 682 | { 683 | if (AmandsGraphicsPlugin.Flashlight.Value == EEnabledFeature.On && AmandsGraphicsClass.Player != null && Vector3.Distance(__instance.transform.position, AmandsGraphicsClass.Player.Position) < 5f && AmandsGraphicsClass.Player.HandsController != null && __instance.transform.IsChildOf(AmandsGraphicsClass.Player.HandsController.WeaponRoot)) 684 | { 685 | foreach (Light light in Traverse.Create(__instance).Field("light_0").GetValue()) 686 | { 687 | if (!AmandsGraphicsClass.registeredLights.ContainsKey(light)) 688 | { 689 | AmandsGraphicsClass.registeredLights.Add(light,light.range); 690 | } 691 | if (AmandsGraphicsPlugin.AmandsGraphicsClassComponent.GraphicsMode) light.range = AmandsGraphicsClass.registeredLights[light] * AmandsGraphicsPlugin.FlashlightRange.Value; 692 | VolumetricLight volumetricLight = light.GetComponent(); 693 | if (volumetricLight != null) 694 | { 695 | if (!AmandsGraphicsClass.registeredVolumetricLights.ContainsKey(volumetricLight)) 696 | { 697 | AmandsGraphicsClass.registeredVolumetricLights.Add(volumetricLight, volumetricLight.ExtinctionCoef); 698 | } 699 | if (AmandsGraphicsPlugin.AmandsGraphicsClassComponent.GraphicsMode) 700 | { 701 | volumetricLight.ExtinctionCoef = AmandsGraphicsPlugin.FlashlightExtinctionCoef.Value; 702 | if (volumetricLight.VolumetricMaterial != null) 703 | { 704 | volumetricLight.VolumetricMaterial.SetVector("_VolumetricLight", new Vector4(volumetricLight.ScatteringCoef, volumetricLight.ExtinctionCoef, AmandsGraphicsPlugin.FlashlightRange.Value, 1f - volumetricLight.SkyboxExtinctionCoef)); 705 | } 706 | } 707 | } 708 | } 709 | } 710 | } 711 | } 712 | public class AmandsGraphicsFastBlurPatch : ModulePatch 713 | { 714 | protected override MethodBase GetTargetMethod() 715 | { 716 | return typeof(FastBlur).GetMethod("Start", BindingFlags.Instance | BindingFlags.Public); 717 | } 718 | [PatchPostfix] 719 | private static void PatchPostFix(ref FastBlur __instance) 720 | { 721 | if (__instance.gameObject.name == "FPS Camera") 722 | { 723 | AmandsGraphicsClass.fastBlur = __instance; 724 | PostProcessLayer FPSCameraPostProcessLayer = __instance.gameObject.GetComponent(); 725 | if (FPSCameraPostProcessLayer != null) 726 | { 727 | AmandsGraphicsClass.FPSCameraChromaticAberration = Traverse.Create(FPSCameraPostProcessLayer).Field("m_Bundles").GetValue>()[typeof(UnityEngine.Rendering.PostProcessing.ChromaticAberration)].settings as UnityEngine.Rendering.PostProcessing.ChromaticAberration; 728 | AmandsGraphicsClass.FPSCameraChromaticAberration.enabled.value = false; 729 | } 730 | } 731 | } 732 | } 733 | public class AmandsGraphicsMethod_7Patch : ModulePatch 734 | { 735 | protected override MethodBase GetTargetMethod() 736 | { 737 | return typeof(EffectsController).GetMethod("method_7", BindingFlags.Instance | BindingFlags.Public); 738 | } 739 | [PatchPostfix] 740 | private static void PatchPostFix(ref EffectsController __instance) 741 | { 742 | if (AmandsGraphicsClass.fastBlur != null && AmandsGraphicsPlugin.HealthEffectHit.Value == EEnabledFeature.On) 743 | { 744 | AmandsGraphicsClass.fastBlur.enabled = false; 745 | } 746 | } 747 | } 748 | public class AmandsGraphicsFastBlurHitPatch : ModulePatch 749 | { 750 | protected override MethodBase GetTargetMethod() 751 | { 752 | return typeof(FastBlur).GetMethod("Hit", BindingFlags.Instance | BindingFlags.Public); 753 | } 754 | [PatchPostfix] 755 | private static void PatchPostFix(ref FastBlur __instance, float power) 756 | { 757 | if (AmandsGraphicsPlugin.HealthEffectHit.Value == EEnabledFeature.On) 758 | { 759 | AmandsGraphicsPlugin.AmandsGraphicsClassComponent.AmandsGraphicsHitEffect(power); 760 | } 761 | } 762 | } 763 | public class AmandsBattleUIScreenPatch : ModulePatch 764 | { 765 | protected override MethodBase GetTargetMethod() 766 | { 767 | return typeof(EFT.UI.EftBattleUIScreen).GetMethods(BindingFlags.Instance | BindingFlags.Public).First(x => x.Name == "Show" && x.GetParameters()[0].Name == "owner"); 768 | } 769 | [PatchPostfix] 770 | private static void PatchPostFix(ref EFT.UI.EftBattleUIScreen __instance) 771 | { 772 | if (AmandsGraphicsClass.ActiveUIScreen == __instance.gameObject) return; 773 | AmandsGraphicsClass.ActiveUIScreen = __instance.gameObject; 774 | AmandsGraphicsClass.DestroyGameObjects(); 775 | AmandsGraphicsClass.CreateGameObjects(__instance.transform); 776 | } 777 | } 778 | public class AmandsEffectsControllerPatch : ModulePatch 779 | { 780 | protected override MethodBase GetTargetMethod() 781 | { 782 | return typeof(EffectsController).GetMethod("Awake", BindingFlags.Instance | BindingFlags.Public); 783 | } 784 | [PatchPostfix] 785 | private static void PatchPostFix(ref EffectsController __instance) 786 | { 787 | if (AmandsGraphicsPlugin.PainKillerEffectType == null || AmandsGraphicsPlugin.PainEffectType == null) 788 | { 789 | object EffectsList = Traverse.Create(__instance).Field("list_0").GetValue(); 790 | object[] EffectsListItems = Traverse.Create(EffectsList).Field("_items").GetValue(); 791 | if (EffectsListItems != null) 792 | { 793 | foreach (object Effect in EffectsListItems) 794 | { 795 | if (AmandsGraphicsPlugin.PainKillerEffectType == null && Traverse.Create(Effect).Field("float_4").FieldExists()) 796 | { 797 | CC_Sharpen cc_Sharpen_0 = Traverse.Create(Effect).Field("cc_Sharpen_0").GetValue(); 798 | if (cc_Sharpen_0 != null) 799 | { 800 | AmandsGraphicsPlugin.PainKillerEffectType = Effect.GetType(); 801 | new AmandsPainkillerAddEffectPatch().Enable(); 802 | new AmandsPainkillerDeleteEffectPatch().Enable(); 803 | continue; 804 | } 805 | } 806 | if (AmandsGraphicsPlugin.PainEffectType == null && Traverse.Create(Effect).Field("cc_RadialBlur_0").FieldExists()) 807 | { 808 | AmandsGraphicsPlugin.PainEffectType = Effect.GetType(); 809 | new AmandsPainTogglePatch().Enable(); 810 | continue; 811 | } 812 | } 813 | } 814 | } 815 | } 816 | } 817 | public class AmandsPainkillerAddEffectPatch : ModulePatch 818 | { 819 | protected override MethodBase GetTargetMethod() 820 | { 821 | return AmandsGraphicsPlugin.PainKillerEffectType.GetMethod("AddEffect", BindingFlags.Instance | BindingFlags.Public); 822 | } 823 | [PatchPostfix] 824 | private static void PatchPostFix(ref object __instance) 825 | { 826 | if (AmandsGraphicsPlugin.HealthEffectPainkiller.Value == EEnabledFeature.On) 827 | { 828 | List ActiveEffects = Traverse.Create(__instance).Field("ActiveEffects").GetValue>(); 829 | if (ActiveEffects != null) 830 | { 831 | /*bool bool_1 = Traverse.Create(__instance).Field("bool_1").GetValue(); 832 | float float_2 = Traverse.Create(__instance).Field("float_2").GetValue();*/ 833 | 834 | float maxEffectValue; 835 | if (ActiveEffects.Count <= 0) 836 | { 837 | maxEffectValue = 0f; 838 | } 839 | else 840 | { 841 | maxEffectValue = Mathf.Min(1.0f * AmandsGraphicsPlugin.PainkillerSaturation.Value, 1f); 842 | } 843 | Traverse.Create(__instance).Field("MaxEffectValue").SetValue(maxEffectValue); 844 | /*if (bool_1) 845 | { 846 | Traverse.Create(__instance).Field("float_3").SetValue((ActiveEffects.Count > 0) ? 0.015f * AmandsGraphicsPlugin.PainkillerCAIntensity.Value : float_2); 847 | }*/ 848 | } 849 | } 850 | } 851 | } 852 | public class AmandsPainkillerDeleteEffectPatch : ModulePatch 853 | { 854 | protected override MethodBase GetTargetMethod() 855 | { 856 | return AmandsGraphicsPlugin.PainKillerEffectType.GetMethod("DeleteEffect", BindingFlags.Instance | BindingFlags.Public); 857 | } 858 | [PatchPostfix] 859 | private static void PatchPostFix(ref object __instance) 860 | { 861 | if (AmandsGraphicsPlugin.HealthEffectPainkiller.Value == EEnabledFeature.On) 862 | { 863 | List ActiveEffects = Traverse.Create(__instance).Field("ActiveEffects").GetValue>(); 864 | if (ActiveEffects != null) 865 | { 866 | /*bool bool_1 = Traverse.Create(__instance).Field("bool_1").GetValue(); 867 | float float_2 = Traverse.Create(__instance).Field("float_2").GetValue();*/ 868 | 869 | float maxEffectValue; 870 | if (ActiveEffects.Count <= 0) 871 | { 872 | maxEffectValue = 0f; 873 | } 874 | else 875 | { 876 | maxEffectValue = Mathf.Min(1.0f * AmandsGraphicsPlugin.PainkillerSaturation.Value, 1f); 877 | } 878 | Traverse.Create(__instance).Field("MaxEffectValue").SetValue(maxEffectValue); 879 | /*if (bool_1) 880 | { 881 | Traverse.Create(__instance).Field("float_3").SetValue((ActiveEffects.Count > 0) ? 0.015f * AmandsGraphicsPlugin.PainkillerCAIntensity.Value : float_2); 882 | }*/ 883 | } 884 | } 885 | } 886 | } 887 | public class AmandsPainTogglePatch : ModulePatch 888 | { 889 | protected override MethodBase GetTargetMethod() 890 | { 891 | return AmandsGraphicsPlugin.PainEffectType.GetMethod("Toggle", BindingFlags.Instance | BindingFlags.Public); 892 | } 893 | [PatchPrefix] 894 | private static bool PatchPreFix(ref object __instance, ref bool value) 895 | { 896 | if (AmandsGraphicsPlugin.HealthEffectPain.Value == EEnabledFeature.On) 897 | { 898 | value = false; 899 | } 900 | return true; 901 | } 902 | } 903 | } 904 | -------------------------------------------------------------------------------- /AmandsGraphics/AmandsGraphicsClass.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Rendering.PostProcessing; 3 | using UnityStandardAssets.ImageEffects; 4 | using UnityEngine.SceneManagement; 5 | using System; 6 | using EFT.Weather; 7 | using System.Collections.Generic; 8 | using BSG.CameraEffects; 9 | using HarmonyLib; 10 | using UnityEngine.Rendering; 11 | using EFT; 12 | using EFT.InventoryLogic; 13 | using System.Reflection; 14 | using EFT.UI; 15 | using Comfort.Common; 16 | using UnityEngine.UI; 17 | using TMPro; 18 | using System.ComponentModel; 19 | using EFT.Interactive; 20 | 21 | namespace AmandsGraphics 22 | { 23 | public class AmandsGraphicsClass : MonoBehaviour 24 | { 25 | public static Player Player; 26 | public static EAimingMode aimingMode; 27 | public static List tacticalComboVisualControllers = new List(); 28 | public static Dictionary registeredLights = new Dictionary(); 29 | public static Dictionary registeredVolumetricLights = new Dictionary(); 30 | private static GameObject FPSCamera; 31 | private static Camera FPSCameraCamera; 32 | private static PostProcessVolume FPSCameraPostProcessVolume; 33 | private static PostProcessLayer FPSCameraPostProcessLayer; 34 | private static UnityEngine.Rendering.PostProcessing.MotionBlur FPSCameraMotionBlur; 35 | private static UnityEngine.Rendering.PostProcessing.DepthOfField FPSCameraDepthOfField; 36 | private static UnityStandardAssets.ImageEffects.DepthOfField FPSCameraWeaponDepthOfField; 37 | public static SightComponent sightComponent; 38 | public static Transform backLens; 39 | 40 | public static GameObject ActiveUIScreen; 41 | private static GameObject AmandsToggleTextUIGameObject; 42 | private static RectTransform AmandsToggleTextUITransform; 43 | private static VerticalLayoutGroup AmandsToggleTextUIVerticalLayoutGroup; 44 | private static GameObject AmandsToggleTextGameObject; 45 | private static AmandsToggleText amandsToggleText; 46 | 47 | private static bool SurroundDepthOfField = false; 48 | private static bool UIDepthOfField = false; 49 | 50 | private static bool SurroundDepthOfFieldEnabled = false; 51 | private static float SurroundDepthOfFieldAnimation = 0f; 52 | private static float SurroundDepthOfFieldFocusDistance = 0f; 53 | private static bool IsLooking = false; 54 | private static bool isLookingEnabled = false; 55 | 56 | public static bool CameraClassBlur = false; 57 | private static float UIDepthOfFieldAnimation = 0f; 58 | 59 | private static EWeaponDepthOfFieldState weaponDepthOfFieldState; 60 | private static float WeaponDepthOfFieldFocalLength = 0f; 61 | private static float WeaponDepthOfFieldMaxBlurSize = 0f; 62 | 63 | private static GameObject OpticCamera; 64 | public static Camera OpticCameraCamera; 65 | private static PostProcessLayer OpticCameraPostProcessLayer; 66 | private static UnityEngine.Rendering.PostProcessing.DepthOfField OpticCameraDepthOfField; 67 | public static ThermalVision OpticCameraThermalVision; 68 | private static bool OpticDOFEnabled; 69 | private static float OpticDOFAnimation; 70 | private static float OpticDOFFocusDistance; 71 | private static float OpticDOFFocusDistanceAnimation; 72 | private static RaycastHit hit; 73 | private static RaycastHit foliageHit; 74 | private static LayerMask LowLayerMask; 75 | private static LayerMask HighLayerMask; 76 | private static LayerMask FoliageLayerMask; 77 | private static Transform TargetCollider; 78 | private static Vector3 TargetLocal; 79 | private static AnimationCurve ApertureAnimationCurve; 80 | public static bool HoldingBreath = false; 81 | 82 | public static AmandsHitEffectClass amandsHitEffectClass; 83 | public static FastBlur fastBlur; 84 | public static UnityEngine.Rendering.PostProcessing.ChromaticAberration FPSCameraChromaticAberration; 85 | public static float ChromaticAberrationAnimation = 0.0f; 86 | public static float ChromaticAberrationIntensity = 0.0f; 87 | 88 | private static WeatherController weatherController; 89 | private static ToDController toDController; 90 | private static TOD_Sky tOD_Sky; 91 | private static MBOIT_Scattering mBOIT_Scattering; 92 | private static CC_Sharpen FPSCameraCC_Sharpen; 93 | private static Dictionary FPSCameraBloomAndFlares = new Dictionary(); 94 | private static PrismEffects FPSCameraPrismEffects; 95 | private static CC_Vintage FPSCameraCC_Vintage; 96 | private static Behaviour FPSCameraGlobalFog; 97 | private static ColorCorrectionCurves FPSCameraColorCorrectionCurves; 98 | public static NightVision FPSCameraNightVision; 99 | public static float defaultNightVisionNoiseIntensity; 100 | private static HBAO FPSCameraHBAO; 101 | public static HBAO_Core.AOSettings FPSCameraHBAOAOSettings; 102 | public static HBAO_Core.ColorBleedingSettings FPSCameraHBAOColorBleedingSettings; 103 | public static string scene; 104 | private static LevelSettings levelSettings; 105 | private static Vector3 defaulttoneValues; 106 | private static Vector3 defaultsecondaryToneValues; 107 | private static bool defaultuseLut; 108 | private static float defaultrampOffsetR; 109 | private static float defaultrampOffsetG; 110 | private static float defaultrampOffsetB; 111 | private static float defaultZeroLevel; 112 | private static float defaultMBOITZeroLevel; 113 | private static bool defaultFPSCameraSharpen; 114 | private static bool defaultFPSCameraWeaponDepthOfField; 115 | private static float defaultFPSCameraWeaponDepthOfFieldAperture; 116 | private static float defaultFPSCameraWeaponDepthOfFieldFocalLength; 117 | private static float defaultFPSCameraWeaponDepthOfFieldFocalSize; 118 | private static float defaultFPSCameraWeaponDepthOfFieldMaxBlurSize; 119 | private static UnityStandardAssets.ImageEffects.DepthOfField.BlurSampleCount defaultFPSCameraWeaponDepthOfFieldBlurSampleCount; 120 | private static bool defaultFPSCameraCC_Vintage; 121 | private static bool defaultFPSCameraGlobalFog; 122 | private static bool defaultFPSCameraColorCorrectionCurves; 123 | private static Color defaultSkyColor; 124 | private static Color defaultEquatorColor; 125 | private static Color defaultGroundColor; 126 | private static Color defaultNightVisionSkyColor; 127 | private static Color defaultNightVisionEquatorColor; 128 | private static Color defaultNightVisionGroundColor; 129 | public static HBAO_Core.AOSettings defaultFPSCameraHBAOAOSettings; 130 | public static HBAO_Core.ColorBleedingSettings defaultFPSCameraHBAOColorBleedingSettings; 131 | private static GradientColorKey[] gradientColorKeys = { }; 132 | private static GradientColorKey[] defaultGradientColorKeys = { }; 133 | private static bool defaultLightsUseLinearIntensity; 134 | private static AnimationCurve defaultAmbientContrast; 135 | private static AnimationCurve NightAmbientContrast; 136 | private static AnimationCurve NVGAmbientContrast; 137 | private static AnimationCurve defaultAmbientBrightness; 138 | private static float defaultLightIntensity; 139 | private static float defaultSunMeshBrightness; 140 | private static float defaultScatteringBrightnessMultiplier; 141 | 142 | private static Dictionary sceneLevelSettings = new Dictionary(); 143 | 144 | public static bool NVG = false; 145 | 146 | public bool GraphicsMode = false; 147 | private void Awake() 148 | { 149 | LowLayerMask = LayerMask.GetMask("Terrain", "LowPolyCollider", "HitCollider"); 150 | HighLayerMask = LayerMask.GetMask("Terrain", "HighPolyCollider", "HitCollider"); 151 | FoliageLayerMask = LayerMask.GetMask("Terrain", "HighPolyCollider", "HitCollider", "Foliage"); 152 | } 153 | public void Start() 154 | { 155 | sceneLevelSettings.Add("Sandbox_Scripts", "---Sandbox_ levelsettings ---"); 156 | sceneLevelSettings.Add("City_Scripts", "---City_ levelsettings ---"); 157 | sceneLevelSettings.Add("Laboratory_Scripts", "---Laboratory_levelsettings---"); 158 | sceneLevelSettings.Add("custom_Scripts", "---Custom_levelsettings---"); 159 | sceneLevelSettings.Add("Factory_Rework_Day_Scripts", "---FactoryDay_levelsettings---"); 160 | sceneLevelSettings.Add("Factory_Rework_Night_Scripts", "---FactoryDay_levelsettings---"); 161 | sceneLevelSettings.Add("Lighthouse_Scripts", "---Lighthouse_levelsettings---"); 162 | sceneLevelSettings.Add("Shopping_Mall_Scripts", "---Interchange_levelsettings---"); 163 | sceneLevelSettings.Add("woods_Scripts", "---Woods_levelsettings---"); 164 | sceneLevelSettings.Add("Reserve_Base_Scripts", "---Reserve_levelsettings---"); 165 | sceneLevelSettings.Add("shoreline_scripts", "---ShoreLine_levelsettings---"); 166 | sceneLevelSettings.Add("default", "!settings"); 167 | 168 | AmandsGraphicsPlugin.MotionBlur.SettingChanged += SettingsUpdated; 169 | AmandsGraphicsPlugin.MotionBlurSampleCount.SettingChanged += SettingsUpdated; 170 | AmandsGraphicsPlugin.MotionBlurShutterAngle.SettingChanged += SettingsUpdated; 171 | AmandsGraphicsPlugin.HBAO.SettingChanged += SettingsUpdated; 172 | AmandsGraphicsPlugin.HBAOIntensity.SettingChanged += SettingsUpdated; 173 | AmandsGraphicsPlugin.HBAOSaturation.SettingChanged += SettingsUpdated; 174 | AmandsGraphicsPlugin.HBAOAlbedoMultiplier.SettingChanged += SettingsUpdated; 175 | AmandsGraphicsPlugin.LabsHBAOIntensity.SettingChanged += SettingsUpdated; 176 | AmandsGraphicsPlugin.LabsHBAOSaturation.SettingChanged += SettingsUpdated; 177 | AmandsGraphicsPlugin.LabsHBAOAlbedoMultiplier.SettingChanged += SettingsUpdated; 178 | AmandsGraphicsPlugin.SurroundDepthOfField.SettingChanged += SettingsUpdated; 179 | AmandsGraphicsPlugin.DOFKernelSize.SettingChanged += SettingsUpdated; 180 | AmandsGraphicsPlugin.UIDepthOfField.SettingChanged += SettingsUpdated; 181 | AmandsGraphicsPlugin.WeaponDepthOfField.SettingChanged += SettingsUpdated; 182 | AmandsGraphicsPlugin.WeaponDOFAperture.SettingChanged += SettingsUpdated; 183 | AmandsGraphicsPlugin.WeaponDOFBlurSampleCount.SettingChanged += SettingsUpdated; 184 | AmandsGraphicsPlugin.OpticDepthOfField.SettingChanged += SettingsUpdated; 185 | AmandsGraphicsPlugin.OpticDOFAperture1x.SettingChanged += SettingsUpdated; 186 | AmandsGraphicsPlugin.OpticDOFAperture2x.SettingChanged += SettingsUpdated; 187 | AmandsGraphicsPlugin.OpticDOFAperture4x.SettingChanged += SettingsUpdated; 188 | AmandsGraphicsPlugin.OpticDOFAperture6x.SettingChanged += SettingsUpdated; 189 | AmandsGraphicsPlugin.OpticDOFKernelSize.SettingChanged += SettingsUpdated; 190 | 191 | AmandsGraphicsPlugin.Flashlight.SettingChanged += SettingsUpdated; 192 | 193 | AmandsGraphicsPlugin.NVG.SettingChanged += SettingsUpdated; 194 | AmandsGraphicsPlugin.NVGTonemap.SettingChanged += SettingsUpdated; 195 | AmandsGraphicsPlugin.NVGAmbientContrast.SettingChanged += SettingsUpdated; 196 | AmandsGraphicsPlugin.InterchangeNVGAmbientContrast.SettingChanged += SettingsUpdated; 197 | AmandsGraphicsPlugin.NVGNoiseIntensity.SettingChanged += SettingsUpdated; 198 | AmandsGraphicsPlugin.InterchangeNVGNoiseIntensity.SettingChanged += SettingsUpdated; 199 | AmandsGraphicsPlugin.NVGOriginalSkyColor.SettingChanged += SettingsUpdated; 200 | AmandsGraphicsPlugin.InterchangeNVGOriginalSkyColor.SettingChanged += SettingsUpdated; 201 | AmandsGraphicsPlugin.NVGOriginalColor.SettingChanged += SettingsUpdated; 202 | AmandsGraphicsPlugin.NVGMoonLightIntensity.SettingChanged += SettingsUpdated; 203 | 204 | AmandsGraphicsPlugin.NightAmbientLight.SettingChanged += SettingsUpdated; 205 | AmandsGraphicsPlugin.NightAmbientContrast.SettingChanged += SettingsUpdated; 206 | AmandsGraphicsPlugin.InterchangeNightAmbientContrast.SettingChanged += SettingsUpdated; 207 | 208 | AmandsGraphicsPlugin.MysticalGlow.SettingChanged += SettingsUpdated; 209 | AmandsGraphicsPlugin.MysticalGlowIntensity.SettingChanged += SettingsUpdated; 210 | AmandsGraphicsPlugin.GroundZeroMysticalGlowIntensity.SettingChanged += SettingsUpdated; 211 | AmandsGraphicsPlugin.StreetsMysticalGlowIntensity.SettingChanged += SettingsUpdated; 212 | AmandsGraphicsPlugin.CustomsMysticalGlowIntensity.SettingChanged += SettingsUpdated; 213 | AmandsGraphicsPlugin.LighthouseMysticalGlowIntensity.SettingChanged += SettingsUpdated; 214 | AmandsGraphicsPlugin.InterchangeMysticalGlowIntensity.SettingChanged += SettingsUpdated; 215 | AmandsGraphicsPlugin.WoodsMysticalGlowIntensity.SettingChanged += SettingsUpdated; 216 | AmandsGraphicsPlugin.ReserveMysticalGlowIntensity.SettingChanged += SettingsUpdated; 217 | AmandsGraphicsPlugin.ShorelineMysticalGlowIntensity.SettingChanged += SettingsUpdated; 218 | 219 | AmandsGraphicsPlugin.HealthEffectHit.SettingChanged += SettingsUpdated; 220 | 221 | AmandsGraphicsPlugin.SunMeshBrightness.SettingChanged += SettingsUpdated; 222 | AmandsGraphicsPlugin.SkyBrightness.SettingChanged += SettingsUpdated; 223 | 224 | AmandsGraphicsPlugin.Brightness.SettingChanged += SettingsUpdated; 225 | AmandsGraphicsPlugin.Tonemap.SettingChanged += SettingsUpdated; 226 | AmandsGraphicsPlugin.UseBSGLUT.SettingChanged += SettingsUpdated; 227 | AmandsGraphicsPlugin.BloomIntensity.SettingChanged += SettingsUpdated; 228 | AmandsGraphicsPlugin.UseBSGCC_Vintage.SettingChanged += SettingsUpdated; 229 | AmandsGraphicsPlugin.UseBSGCC_Sharpen.SettingChanged += SettingsUpdated; 230 | AmandsGraphicsPlugin.UseBSGGlobalFog.SettingChanged += SettingsUpdated; 231 | AmandsGraphicsPlugin.UseBSGColorCorrectionCurves.SettingChanged += SettingsUpdated; 232 | AmandsGraphicsPlugin.LightsUseLinearIntensity.SettingChanged += SettingsUpdated; 233 | AmandsGraphicsPlugin.SunColor.SettingChanged += SettingsUpdated; 234 | AmandsGraphicsPlugin.SkyColor.SettingChanged += SettingsUpdated; 235 | 236 | AmandsGraphicsPlugin.GroundZeroFogLevel.SettingChanged += SettingsUpdated; 237 | AmandsGraphicsPlugin.StreetsFogLevel.SettingChanged += SettingsUpdated; 238 | AmandsGraphicsPlugin.CustomsFogLevel.SettingChanged += SettingsUpdated; 239 | AmandsGraphicsPlugin.LighthouseFogLevel.SettingChanged += SettingsUpdated; 240 | AmandsGraphicsPlugin.InterchangeFogLevel.SettingChanged += SettingsUpdated; 241 | AmandsGraphicsPlugin.WoodsFogLevel.SettingChanged += SettingsUpdated; 242 | AmandsGraphicsPlugin.ReserveFogLevel.SettingChanged += SettingsUpdated; 243 | AmandsGraphicsPlugin.ShorelineFogLevel.SettingChanged += SettingsUpdated; 244 | 245 | AmandsGraphicsPlugin.GroundZeroTonemap.SettingChanged += SettingsUpdated; 246 | AmandsGraphicsPlugin.StreetsTonemap.SettingChanged += SettingsUpdated; 247 | AmandsGraphicsPlugin.LabsTonemap.SettingChanged += SettingsUpdated; 248 | AmandsGraphicsPlugin.CustomsTonemap.SettingChanged += SettingsUpdated; 249 | AmandsGraphicsPlugin.FactoryTonemap.SettingChanged += SettingsUpdated; 250 | AmandsGraphicsPlugin.FactoryNightTonemap.SettingChanged += SettingsUpdated; 251 | AmandsGraphicsPlugin.LighthouseTonemap.SettingChanged += SettingsUpdated; 252 | AmandsGraphicsPlugin.InterchangeTonemap.SettingChanged += SettingsUpdated; 253 | AmandsGraphicsPlugin.WoodsTonemap.SettingChanged += SettingsUpdated; 254 | AmandsGraphicsPlugin.ReserveTonemap.SettingChanged += SettingsUpdated; 255 | AmandsGraphicsPlugin.ShorelineTonemap.SettingChanged += SettingsUpdated; 256 | AmandsGraphicsPlugin.HideoutTonemap.SettingChanged += SettingsUpdated; 257 | 258 | AmandsGraphicsPlugin.GroundZeroACES.SettingChanged += SettingsUpdated; 259 | AmandsGraphicsPlugin.GroundZeroACESS.SettingChanged += SettingsUpdated; 260 | AmandsGraphicsPlugin.StreetsACES.SettingChanged += SettingsUpdated; 261 | AmandsGraphicsPlugin.StreetsACESS.SettingChanged += SettingsUpdated; 262 | AmandsGraphicsPlugin.LabsACES.SettingChanged += SettingsUpdated; 263 | AmandsGraphicsPlugin.LabsACESS.SettingChanged += SettingsUpdated; 264 | AmandsGraphicsPlugin.CustomsACES.SettingChanged += SettingsUpdated; 265 | AmandsGraphicsPlugin.CustomsACESS.SettingChanged += SettingsUpdated; 266 | AmandsGraphicsPlugin.FactoryACES.SettingChanged += SettingsUpdated; 267 | AmandsGraphicsPlugin.FactoryACESS.SettingChanged += SettingsUpdated; 268 | AmandsGraphicsPlugin.FactoryNightACES.SettingChanged += SettingsUpdated; 269 | AmandsGraphicsPlugin.FactoryNightACESS.SettingChanged += SettingsUpdated; 270 | AmandsGraphicsPlugin.LighthouseACES.SettingChanged += SettingsUpdated; 271 | AmandsGraphicsPlugin.LighthouseACESS.SettingChanged += SettingsUpdated; 272 | AmandsGraphicsPlugin.InterchangeACES.SettingChanged += SettingsUpdated; 273 | AmandsGraphicsPlugin.InterchangeACESS.SettingChanged += SettingsUpdated; 274 | AmandsGraphicsPlugin.WoodsACES.SettingChanged += SettingsUpdated; 275 | AmandsGraphicsPlugin.WoodsACESS.SettingChanged += SettingsUpdated; 276 | AmandsGraphicsPlugin.ReserveACES.SettingChanged += SettingsUpdated; 277 | AmandsGraphicsPlugin.ReserveACESS.SettingChanged += SettingsUpdated; 278 | AmandsGraphicsPlugin.ShorelineACES.SettingChanged += SettingsUpdated; 279 | AmandsGraphicsPlugin.ShorelineACESS.SettingChanged += SettingsUpdated; 280 | AmandsGraphicsPlugin.HideoutACES.SettingChanged += SettingsUpdated; 281 | AmandsGraphicsPlugin.HideoutACESS.SettingChanged += SettingsUpdated; 282 | 283 | AmandsGraphicsPlugin.GroundZeroFilmic.SettingChanged += SettingsUpdated; 284 | AmandsGraphicsPlugin.GroundZeroFilmicS.SettingChanged += SettingsUpdated; 285 | AmandsGraphicsPlugin.StreetsFilmic.SettingChanged += SettingsUpdated; 286 | AmandsGraphicsPlugin.StreetsFilmicS.SettingChanged += SettingsUpdated; 287 | AmandsGraphicsPlugin.LabsFilmic.SettingChanged += SettingsUpdated; 288 | AmandsGraphicsPlugin.LabsFilmicS.SettingChanged += SettingsUpdated; 289 | AmandsGraphicsPlugin.CustomsFilmic.SettingChanged += SettingsUpdated; 290 | AmandsGraphicsPlugin.CustomsFilmicS.SettingChanged += SettingsUpdated; 291 | AmandsGraphicsPlugin.FactoryFilmic.SettingChanged += SettingsUpdated; 292 | AmandsGraphicsPlugin.FactoryFilmicS.SettingChanged += SettingsUpdated; 293 | AmandsGraphicsPlugin.FactoryNightFilmic.SettingChanged += SettingsUpdated; 294 | AmandsGraphicsPlugin.FactoryNightFilmicS.SettingChanged += SettingsUpdated; 295 | AmandsGraphicsPlugin.LighthouseFilmic.SettingChanged += SettingsUpdated; 296 | AmandsGraphicsPlugin.LighthouseFilmicS.SettingChanged += SettingsUpdated; 297 | AmandsGraphicsPlugin.InterchangeFilmic.SettingChanged += SettingsUpdated; 298 | AmandsGraphicsPlugin.InterchangeFilmicS.SettingChanged += SettingsUpdated; 299 | AmandsGraphicsPlugin.WoodsFilmic.SettingChanged += SettingsUpdated; 300 | AmandsGraphicsPlugin.WoodsFilmicS.SettingChanged += SettingsUpdated; 301 | AmandsGraphicsPlugin.ReserveFilmic.SettingChanged += SettingsUpdated; 302 | AmandsGraphicsPlugin.ReserveFilmicS.SettingChanged += SettingsUpdated; 303 | AmandsGraphicsPlugin.ShorelineFilmic.SettingChanged += SettingsUpdated; 304 | AmandsGraphicsPlugin.ShorelineFilmicS.SettingChanged += SettingsUpdated; 305 | AmandsGraphicsPlugin.HideoutFilmic.SettingChanged += SettingsUpdated; 306 | AmandsGraphicsPlugin.HideoutFilmicS.SettingChanged += SettingsUpdated; 307 | 308 | AmandsGraphicsPlugin.HideoutSkyColor.SettingChanged += SettingsUpdated; 309 | 310 | AmandsGraphicsPlugin.LightColorIndex0.SettingChanged += SettingsUpdated; 311 | AmandsGraphicsPlugin.LightColorIndex1.SettingChanged += SettingsUpdated; 312 | AmandsGraphicsPlugin.LightColorIndex2.SettingChanged += SettingsUpdated; 313 | AmandsGraphicsPlugin.LightColorIndex3.SettingChanged += SettingsUpdated; 314 | AmandsGraphicsPlugin.LightColorIndex4.SettingChanged += SettingsUpdated; 315 | AmandsGraphicsPlugin.LightColorIndex5.SettingChanged += SettingsUpdated; 316 | 317 | Camera.onPostRender += AmandsOnPostRender; 318 | 319 | ApertureAnimationCurve = new AnimationCurve( 320 | new Keyframe(1f, AmandsGraphicsPlugin.OpticDOFAperture1x.Value), 321 | new Keyframe(2f, AmandsGraphicsPlugin.OpticDOFAperture2x.Value), 322 | new Keyframe(4f, AmandsGraphicsPlugin.OpticDOFAperture4x.Value), 323 | new Keyframe(6f, AmandsGraphicsPlugin.OpticDOFAperture6x.Value)); 324 | 325 | NightAmbientContrast = new AnimationCurve(new Keyframe(-0.2522f, AmandsGraphicsPlugin.NightAmbientContrast.Value), new Keyframe(-0.1261f, 1.15f)); 326 | NVGAmbientContrast = new AnimationCurve(new Keyframe(0f, AmandsGraphicsPlugin.NVGAmbientContrast.Value)); 327 | isLookingEnabled = Traverse.CreateWithType("Player").Property("IsLooking").PropertyExists(); 328 | } 329 | public void Update() 330 | { 331 | if (Input.GetKeyDown(AmandsGraphicsPlugin.GraphicsToggle.Value.MainKey) && (!Input.GetKey(KeyCode.LeftShift)) && FPSCamera != null) 332 | { 333 | if (GraphicsMode) 334 | { 335 | GraphicsMode = false; 336 | ResetGraphics(); 337 | } 338 | else 339 | { 340 | GraphicsMode = true; 341 | UpdateAmandsGraphics(); 342 | } 343 | AmandsToggleText(GraphicsMode); 344 | } 345 | if (Input.GetKeyDown(AmandsGraphicsPlugin.GraphicsToggle.Value.MainKey) && Input.GetKey(KeyCode.LeftShift) && FPSCamera != null && GraphicsMode) 346 | { 347 | switch (AmandsGraphicsPlugin.DebugMode.Value) 348 | { 349 | case EDebugMode.Flashlight: 350 | AmandsGraphicsPlugin.Flashlight.Value = AmandsGraphicsPlugin.Flashlight.Value == EEnabledFeature.On ? EEnabledFeature.Off : EEnabledFeature.On; 351 | break; 352 | case EDebugMode.NVG: 353 | AmandsGraphicsPlugin.NVG.Value = AmandsGraphicsPlugin.NVG.Value == EEnabledFeature.On ? EEnabledFeature.Off : EEnabledFeature.On; 354 | break; 355 | case EDebugMode.NVGOriginalColor: 356 | AmandsGraphicsPlugin.NVGOriginalColor.Value = !AmandsGraphicsPlugin.NVGOriginalColor.Value; 357 | break; 358 | case EDebugMode.NightAmbientLight: 359 | AmandsGraphicsPlugin.NightAmbientLight.Value = AmandsGraphicsPlugin.NightAmbientLight.Value == EEnabledFeature.On ? EEnabledFeature.Off : EEnabledFeature.On; 360 | break; 361 | case EDebugMode.HBAO: 362 | AmandsGraphicsPlugin.HBAO.Value = AmandsGraphicsPlugin.HBAO.Value == EEnabledFeature.On ? EEnabledFeature.Off : EEnabledFeature.On; 363 | break; 364 | case EDebugMode.MysticalGlow: 365 | AmandsGraphicsPlugin.MysticalGlow.Value = AmandsGraphicsPlugin.MysticalGlow.Value == EEnabledFeature.On ? EEnabledFeature.Off : EEnabledFeature.On; 366 | break; 367 | case EDebugMode.DefaultToACES: 368 | switch (AmandsGraphicsPlugin.Tonemap.Value) 369 | { 370 | case EGlobalTonemap.Default: 371 | AmandsGraphicsPlugin.Tonemap.Value = EGlobalTonemap.ACES; 372 | break; 373 | case EGlobalTonemap.ACES: 374 | AmandsGraphicsPlugin.Tonemap.Value = EGlobalTonemap.Default; 375 | break; 376 | } 377 | UpdateAmandsGraphics(); 378 | break; 379 | case EDebugMode.DefaultToFilmic: 380 | switch (AmandsGraphicsPlugin.Tonemap.Value) 381 | { 382 | case EGlobalTonemap.Default: 383 | AmandsGraphicsPlugin.Tonemap.Value = EGlobalTonemap.Filmic; 384 | break; 385 | case EGlobalTonemap.Filmic: 386 | AmandsGraphicsPlugin.Tonemap.Value = EGlobalTonemap.Default; 387 | break; 388 | } 389 | UpdateAmandsGraphics(); 390 | break; 391 | case EDebugMode.ACESToFilmic: 392 | switch (AmandsGraphicsPlugin.Tonemap.Value) 393 | { 394 | case EGlobalTonemap.ACES: 395 | AmandsGraphicsPlugin.Tonemap.Value = EGlobalTonemap.Filmic; 396 | break; 397 | case EGlobalTonemap.Filmic: 398 | AmandsGraphicsPlugin.Tonemap.Value = EGlobalTonemap.ACES; 399 | break; 400 | } 401 | UpdateAmandsGraphics(); 402 | break; 403 | case EDebugMode.useLut: 404 | AmandsGraphicsPlugin.UseBSGLUT.Value = !AmandsGraphicsPlugin.UseBSGLUT.Value; 405 | break; 406 | case EDebugMode.CC_Vintage: 407 | AmandsGraphicsPlugin.UseBSGCC_Vintage.Value = !AmandsGraphicsPlugin.UseBSGCC_Vintage.Value; 408 | break; 409 | case EDebugMode.CC_Sharpen: 410 | AmandsGraphicsPlugin.UseBSGCC_Sharpen.Value = !AmandsGraphicsPlugin.UseBSGCC_Sharpen.Value; 411 | break; 412 | case EDebugMode.GlobalFog: 413 | AmandsGraphicsPlugin.UseBSGGlobalFog.Value = !AmandsGraphicsPlugin.UseBSGGlobalFog.Value; 414 | break; 415 | case EDebugMode.ColorCorrectionCurves: 416 | AmandsGraphicsPlugin.UseBSGColorCorrectionCurves.Value = !AmandsGraphicsPlugin.UseBSGColorCorrectionCurves.Value; 417 | break; 418 | case EDebugMode.LightsUseLinearIntensity: 419 | AmandsGraphicsPlugin.LightsUseLinearIntensity.Value = !AmandsGraphicsPlugin.LightsUseLinearIntensity.Value; 420 | break; 421 | case EDebugMode.SunColor: 422 | AmandsGraphicsPlugin.SunColor.Value = !AmandsGraphicsPlugin.SunColor.Value; 423 | break; 424 | case EDebugMode.SkyColor: 425 | AmandsGraphicsPlugin.SkyColor.Value = !AmandsGraphicsPlugin.SkyColor.Value; 426 | break; 427 | } 428 | //UpdateAmandsGraphics(); 429 | } 430 | if ((AmandsGraphicsPlugin.SurroundDepthOfField.Value == EDepthOfField.HoldingBreathOnly || AmandsGraphicsPlugin.OpticDepthOfField.Value == EDepthOfField.HoldingBreathOnly) && Player != null) 431 | { 432 | HoldingBreath = Traverse.Create(Traverse.Create(Player).Field("Physical").GetValue()).Property("HoldingBreath").GetValue(); 433 | } 434 | if ((SurroundDepthOfField || UIDepthOfField) && FPSCameraDepthOfField != null) 435 | { 436 | SurroundDepthOfFieldEnabled = SurroundDepthOfField && (Player != null && Player.ProceduralWeaponAnimation != null && Player.ProceduralWeaponAnimation.IsAiming && OpticCamera != null && OpticCamera.activeSelf && Player.ProceduralWeaponAnimation.CurrentAimingMod != null && 437 | Player.ProceduralWeaponAnimation.CurrentAimingMod.GetCurrentOpticZoom() > (AmandsGraphicsPlugin.SurroundDOFOpticZoom.Value - 0.1f) && sightComponent != null && 438 | sightComponent == Player.ProceduralWeaponAnimation.CurrentAimingMod && Player.ProceduralWeaponAnimation.CurrentAimingMod.SelectedScopeIndex == 0 && (AmandsGraphicsPlugin.SurroundDepthOfField.Value == EDepthOfField.HoldingBreathOnly ? HoldingBreath : true)); 439 | IsLooking = isLookingEnabled && Traverse.Create(Player).Property("IsLooking").GetValue(); 440 | if (IsLooking) 441 | { 442 | SurroundDepthOfFieldEnabled = false; 443 | } 444 | UIDepthOfFieldAnimation += (((UIDepthOfField && CameraClassBlur) ? 1f : 0f) - UIDepthOfFieldAnimation) * Time.deltaTime * AmandsGraphicsPlugin.UIDOFSpeed.Value; 445 | SurroundDepthOfFieldAnimation += ((SurroundDepthOfFieldEnabled ? 1f : 0f) - SurroundDepthOfFieldAnimation) * Time.deltaTime * AmandsGraphicsPlugin.SurroundDOFSpeed.Value; 446 | 447 | FPSCameraDepthOfField.aperture.value = Mathf.Lerp(Mathf.Lerp(AmandsGraphicsPlugin.SurroundDOFAperture.Value, AmandsGraphicsPlugin.UIDOFAperture.Value, UIDepthOfFieldAnimation), AmandsGraphicsPlugin.SurroundDOFAperture.Value, SurroundDepthOfFieldAnimation); 448 | FPSCameraDepthOfField.focusDistance.value = Mathf.Lerp(Mathf.Lerp(SurroundDepthOfFieldFocusDistance, AmandsGraphicsPlugin.UIDOFDistance.Value, UIDepthOfFieldAnimation), SurroundDepthOfFieldFocusDistance, SurroundDepthOfFieldAnimation); 449 | FPSCameraDepthOfField.focalLength.value = Mathf.Lerp(Mathf.Lerp(AmandsGraphicsPlugin.SurroundDOFFocalLengthOff.Value, AmandsGraphicsPlugin.UIDOFFocalLength.Value, UIDepthOfFieldAnimation), AmandsGraphicsPlugin.SurroundDOFFocalLength.Value, SurroundDepthOfFieldAnimation); 450 | FPSCameraDepthOfField.enabled.value = SurroundDepthOfFieldAnimation > 0.01f || UIDepthOfFieldAnimation > 0.01f; 451 | } 452 | if (AmandsGraphicsPlugin.OpticDepthOfField.Value != EDepthOfField.Off && OpticCameraDepthOfField != null) 453 | { 454 | switch (AmandsGraphicsPlugin.OpticDepthOfField.Value) 455 | { 456 | case EDepthOfField.On: 457 | OpticDOFEnabled = (Player != null && Player.ProceduralWeaponAnimation != null && Player.ProceduralWeaponAnimation.CurrentAimingMod != null && 458 | Player.ProceduralWeaponAnimation.CurrentAimingMod.GetCurrentOpticZoom() > (AmandsGraphicsPlugin.OpticDOFOpticZoom.Value - 0.1f) && (OpticCameraThermalVision != null ? !OpticCameraThermalVision.enabled : true) && OpticCamera != null); 459 | break; 460 | case EDepthOfField.HoldingBreathOnly: 461 | OpticDOFEnabled = (Player != null && Player.ProceduralWeaponAnimation != null && Player.ProceduralWeaponAnimation.CurrentAimingMod != null && 462 | Player.ProceduralWeaponAnimation.CurrentAimingMod.GetCurrentOpticZoom() > (AmandsGraphicsPlugin.OpticDOFOpticZoom.Value - 0.1f) && (OpticCameraThermalVision != null ? !OpticCameraThermalVision.enabled : true) && OpticCamera != null && HoldingBreath); 463 | break; 464 | } 465 | 466 | if (OpticDOFEnabled) 467 | { 468 | switch (AmandsGraphicsPlugin.OpticDOFRaycastQuality.Value) 469 | { 470 | case ERaycastQuality.Low: 471 | if (Physics.Raycast(OpticCamera.transform.position, OpticCamera.transform.forward, out hit, AmandsGraphicsPlugin.OpticDOFRaycastDistance.Value, LowLayerMask, QueryTriggerInteraction.Ignore)) 472 | { 473 | OpticDOFFocusDistance = hit.distance; 474 | } 475 | break; 476 | case ERaycastQuality.High: 477 | if (Physics.Raycast(OpticCamera.transform.position, OpticCamera.transform.forward, out hit, AmandsGraphicsPlugin.OpticDOFRaycastDistance.Value, HighLayerMask, QueryTriggerInteraction.Ignore)) 478 | { 479 | OpticDOFFocusDistance = hit.distance; 480 | if (hit.distance > 2f && hit.collider.gameObject.layer == LayerMask.NameToLayer("HitCollider")) 481 | { 482 | TargetCollider = hit.collider.transform; 483 | TargetLocal = TargetCollider.InverseTransformPoint(hit.point); 484 | } 485 | } 486 | if (TargetCollider != null) 487 | { 488 | OpticDOFFocusDistance = Vector3.Distance(TargetCollider.TransformPoint(TargetLocal), OpticCamera.transform.position); 489 | if ((Mathf.Abs(Mathf.Tan(Vector3.Angle(TargetCollider.TransformPoint(TargetLocal) - OpticCamera.transform.position, OpticCamera.transform.forward) * Mathf.Deg2Rad) * Vector3.Distance(TargetCollider.TransformPoint(TargetLocal), OpticCamera.transform.position)) > AmandsGraphicsPlugin.OpticDOFTargetDistance.Value / 100f) || Vector3.Distance(TargetCollider.TransformPoint(TargetLocal), OpticCamera.transform.position) < 1f) TargetCollider = null; 490 | } 491 | break; 492 | case ERaycastQuality.Foliage: 493 | if (Physics.Raycast(OpticCamera.transform.position, OpticCamera.transform.forward, out hit, AmandsGraphicsPlugin.OpticDOFRaycastDistance.Value, FoliageLayerMask, QueryTriggerInteraction.Collide)) 494 | { 495 | OpticDOFFocusDistance = hit.distance; 496 | if (hit.distance > 2f) 497 | { 498 | switch (LayerMask.LayerToName(hit.collider.gameObject.layer)) 499 | { 500 | case "HitCollider": 501 | TargetCollider = hit.collider.transform; 502 | TargetLocal = TargetCollider.InverseTransformPoint(hit.point); 503 | break; 504 | case "Foliage": 505 | if (Physics.Raycast(hit.point, OpticCamera.transform.forward, out foliageHit, AmandsGraphicsPlugin.OpticDOFRaycastDistance.Value - hit.distance, HighLayerMask, QueryTriggerInteraction.Ignore)) 506 | { 507 | if (foliageHit.collider.gameObject.layer == LayerMask.NameToLayer("HitCollider")) 508 | { 509 | TargetCollider = foliageHit.collider.transform; 510 | TargetLocal = TargetCollider.InverseTransformPoint(foliageHit.point); 511 | } 512 | } 513 | break; 514 | } 515 | } 516 | } 517 | if (TargetCollider != null) 518 | { 519 | OpticDOFFocusDistance = Vector3.Distance(TargetCollider.TransformPoint(TargetLocal), OpticCamera.transform.position); 520 | if ((Mathf.Abs(Mathf.Tan(Vector3.Angle(TargetCollider.TransformPoint(TargetLocal) - OpticCamera.transform.position, OpticCamera.transform.forward) * Mathf.Deg2Rad) * Vector3.Distance(TargetCollider.TransformPoint(TargetLocal), OpticCamera.transform.position)) > AmandsGraphicsPlugin.OpticDOFTargetDistance.Value / 100f) || Vector3.Distance(TargetCollider.TransformPoint(TargetLocal), OpticCamera.transform.position) < 1f) TargetCollider = null; 521 | } 522 | break; 523 | } 524 | OpticCameraDepthOfField.aperture.value = ApertureAnimationCurve.Evaluate(Player.ProceduralWeaponAnimation.CurrentAimingMod.GetCurrentOpticZoom()); 525 | } 526 | 527 | OpticDOFAnimation += ((OpticDOFEnabled ? 1f : 0f) - OpticDOFAnimation) * Time.deltaTime * AmandsGraphicsPlugin.OpticDOFSpeed.Value; 528 | OpticDOFFocusDistanceAnimation += (OpticDOFFocusDistance - OpticDOFFocusDistanceAnimation) * Time.deltaTime * AmandsGraphicsPlugin.OpticDOFDistanceSpeed.Value; 529 | 530 | OpticCameraDepthOfField.focusDistance.value = OpticDOFFocusDistanceAnimation; //Mathf.Max(OpticCameraDepthOfField.focusDistance.value + ((OpticDepthOfFieldFocusDistance - OpticCameraDepthOfField.focusDistance.value) * Time.deltaTime * AmandsGraphicsPlugin.OpticDepthOfFieldSpeed.Value), 0.01f); 531 | switch (AmandsGraphicsPlugin.OpticDOFFocalLengthMode.Value) 532 | { 533 | case EOpticDOFFocalLengthMode.Math: 534 | OpticCameraDepthOfField.focalLength.value = Mathf.Lerp(0f, Mathf.Sqrt(OpticDOFFocusDistance + 10f) * AmandsGraphicsPlugin.OpticDOFFocalLength.Value, OpticDOFAnimation); 535 | break; 536 | case EOpticDOFFocalLengthMode.FixedValue: 537 | OpticCameraDepthOfField.focalLength.value = AmandsGraphicsPlugin.OpticDOFFocalLength.Value; 538 | break; 539 | } 540 | OpticCameraDepthOfField.enabled.value = OpticDOFAnimation > 0.01f; 541 | } 542 | if (AmandsGraphicsPlugin.WeaponDepthOfField.Value != EWeaponDepthOfField.Off && FPSCameraWeaponDepthOfField != null && GraphicsMode) 543 | { 544 | if (NVG) 545 | { 546 | if (SurroundDepthOfFieldEnabled || (UIDepthOfField && CameraClassBlur)) 547 | { 548 | weaponDepthOfFieldState = EWeaponDepthOfFieldState.Off; 549 | } 550 | else 551 | { 552 | weaponDepthOfFieldState = EWeaponDepthOfFieldState.NVG; 553 | } 554 | } 555 | else 556 | { 557 | weaponDepthOfFieldState = EWeaponDepthOfFieldState.Weapon; 558 | if (Player != null && Player.ProceduralWeaponAnimation != null && Player.ProceduralWeaponAnimation.IsAiming && !(SurroundDepthOfFieldEnabled || (UIDepthOfField && CameraClassBlur))) 559 | { 560 | if (aimingMode == EAimingMode.IronSight) 561 | { 562 | weaponDepthOfFieldState = EWeaponDepthOfFieldState.IronSight; 563 | } 564 | else 565 | { 566 | weaponDepthOfFieldState = EWeaponDepthOfFieldState.Sight; 567 | } 568 | } 569 | else if (SurroundDepthOfFieldEnabled || (UIDepthOfField && CameraClassBlur)) 570 | { 571 | weaponDepthOfFieldState = EWeaponDepthOfFieldState.Off; 572 | } 573 | } 574 | switch (weaponDepthOfFieldState) 575 | { 576 | case EWeaponDepthOfFieldState.Off: 577 | WeaponDepthOfFieldFocalLength += (0.0001f - WeaponDepthOfFieldFocalLength) * Time.deltaTime * AmandsGraphicsPlugin.WeaponDOFSpeed.Value * 2f; 578 | WeaponDepthOfFieldMaxBlurSize += (0.001f - WeaponDepthOfFieldMaxBlurSize) * Time.deltaTime * AmandsGraphicsPlugin.WeaponDOFSpeed.Value * 2f; 579 | break; 580 | case EWeaponDepthOfFieldState.Weapon: 581 | WeaponDepthOfFieldFocalLength += ((AmandsGraphicsPlugin.WeaponDOFWeaponFocalLength.Value / 100f) - WeaponDepthOfFieldFocalLength) * Time.deltaTime * AmandsGraphicsPlugin.WeaponDOFSpeed.Value; 582 | WeaponDepthOfFieldMaxBlurSize += ((AmandsGraphicsPlugin.WeaponDOFWeaponMaxBlurSize.Value / 10f) - WeaponDepthOfFieldMaxBlurSize) * Time.deltaTime * AmandsGraphicsPlugin.WeaponDOFSpeed.Value; 583 | break; 584 | case EWeaponDepthOfFieldState.IronSight: 585 | WeaponDepthOfFieldFocalLength += ((AmandsGraphicsPlugin.WeaponDOFIronSightFocalLength.Value / 100f) - WeaponDepthOfFieldFocalLength) * Time.deltaTime * AmandsGraphicsPlugin.WeaponDOFSpeed.Value; 586 | WeaponDepthOfFieldMaxBlurSize += ((AmandsGraphicsPlugin.WeaponDOFIronSightMaxBlurSize.Value / 10f) - WeaponDepthOfFieldMaxBlurSize) * Time.deltaTime * AmandsGraphicsPlugin.WeaponDOFSpeed.Value; 587 | break; 588 | case EWeaponDepthOfFieldState.Sight: 589 | WeaponDepthOfFieldFocalLength += ((AmandsGraphicsPlugin.WeaponDOFSightFocalLength.Value / 100f) - WeaponDepthOfFieldFocalLength) * Time.deltaTime * AmandsGraphicsPlugin.WeaponDOFSpeed.Value; 590 | WeaponDepthOfFieldMaxBlurSize += ((AmandsGraphicsPlugin.WeaponDOFSightMaxBlurSize.Value / 10f) - WeaponDepthOfFieldMaxBlurSize) * Time.deltaTime * AmandsGraphicsPlugin.WeaponDOFSpeed.Value; 591 | break; 592 | case EWeaponDepthOfFieldState.NVG: 593 | WeaponDepthOfFieldFocalLength += ((AmandsGraphicsPlugin.WeaponDOFNVGFocalLength.Value / 100f) - WeaponDepthOfFieldFocalLength) * Time.deltaTime * AmandsGraphicsPlugin.WeaponDOFSpeed.Value; 594 | WeaponDepthOfFieldMaxBlurSize += ((AmandsGraphicsPlugin.WeaponDOFNVGMaxBlurSize.Value / 10f) - WeaponDepthOfFieldMaxBlurSize) * Time.deltaTime * AmandsGraphicsPlugin.WeaponDOFSpeed.Value; 595 | break; 596 | } 597 | FPSCameraWeaponDepthOfField.focalLength = WeaponDepthOfFieldFocalLength * 100f; 598 | FPSCameraWeaponDepthOfField.maxBlurSize = WeaponDepthOfFieldMaxBlurSize * 10f; 599 | } 600 | } 601 | public void AmandsOnPostRender(Camera cam) 602 | { 603 | if (SurroundDepthOfField && backLens != null) 604 | { 605 | SurroundDepthOfFieldFocusDistance = Mathf.Clamp(Vector3.Distance(Camera.current.transform.position, backLens.position),0.001f,1f); 606 | } 607 | else 608 | { 609 | SurroundDepthOfFieldFocusDistance = 0.1f; 610 | } 611 | } 612 | public void ActivateAmandsGraphics(GameObject fpscamera, PrismEffects prismeffects) 613 | { 614 | if (FPSCamera == null) 615 | { 616 | FPSCamera = fpscamera; 617 | if (FPSCamera != null) 618 | { 619 | registeredLights.Clear(); 620 | registeredVolumetricLights.Clear(); 621 | defaultLightsUseLinearIntensity = GraphicsSettings.lightsUseLinearIntensity; 622 | if (FPSCameraCamera == null) 623 | { 624 | FPSCameraCamera = FPSCamera.GetComponent(); 625 | } 626 | FPSCameraPostProcessVolume = FPSCamera.GetComponent(); 627 | if (FPSCameraPostProcessVolume != null) 628 | { 629 | FPSCameraPostProcessVolume.profile.TryGetSettings(out FPSCameraMotionBlur); 630 | if (FPSCameraMotionBlur == null) 631 | { 632 | FPSCameraPostProcessVolume.profile.AddSettings(); 633 | FPSCameraPostProcessVolume.profile.TryGetSettings(out FPSCameraMotionBlur); 634 | } 635 | } 636 | FPSCameraPostProcessLayer = FPSCamera.GetComponent(); 637 | if (FPSCameraPostProcessLayer != null) 638 | { 639 | FPSCameraDepthOfField = Traverse.Create(FPSCameraPostProcessLayer).Field("m_Bundles").GetValue>()[typeof(UnityEngine.Rendering.PostProcessing.DepthOfField)].settings as UnityEngine.Rendering.PostProcessing.DepthOfField; 640 | FPSCameraDepthOfField.enabled.value = false; 641 | } 642 | FPSCameraWeaponDepthOfField = FPSCamera.GetComponent(); 643 | if (FPSCameraWeaponDepthOfField != null) 644 | { 645 | defaultFPSCameraWeaponDepthOfField = FPSCameraWeaponDepthOfField.enabled; 646 | defaultFPSCameraWeaponDepthOfFieldAperture = FPSCameraWeaponDepthOfField.aperture; 647 | defaultFPSCameraWeaponDepthOfFieldFocalLength = FPSCameraWeaponDepthOfField.focalLength; 648 | defaultFPSCameraWeaponDepthOfFieldFocalSize = FPSCameraWeaponDepthOfField.focalSize; 649 | defaultFPSCameraWeaponDepthOfFieldMaxBlurSize = FPSCameraWeaponDepthOfField.maxBlurSize; 650 | defaultFPSCameraWeaponDepthOfFieldBlurSampleCount = FPSCameraWeaponDepthOfField.blurSampleCount; 651 | } 652 | FPSCameraCC_Sharpen = FPSCamera.GetComponent(); 653 | if (FPSCameraCC_Sharpen != null) 654 | { 655 | defaultFPSCameraSharpen = FPSCameraCC_Sharpen.enabled; 656 | defaultrampOffsetR = FPSCameraCC_Sharpen.rampOffsetR; 657 | defaultrampOffsetG = FPSCameraCC_Sharpen.rampOffsetG; 658 | defaultrampOffsetB = FPSCameraCC_Sharpen.rampOffsetB; 659 | } 660 | if (prismeffects != null) 661 | { 662 | FPSCameraPrismEffects = prismeffects; 663 | } 664 | if (FPSCameraPrismEffects != null) 665 | { 666 | defaulttoneValues = FPSCameraPrismEffects.toneValues; 667 | defaultsecondaryToneValues = FPSCameraPrismEffects.secondaryToneValues; 668 | defaultuseLut = FPSCameraPrismEffects.useLut; 669 | } 670 | FPSCameraBloomAndFlares.Clear(); 671 | foreach (BloomAndFlares bloomAndFlares in FPSCamera.GetComponents()) 672 | { 673 | FPSCameraBloomAndFlares.Add(bloomAndFlares, bloomAndFlares.bloomIntensity); 674 | } 675 | scene = SceneManager.GetActiveScene().name; 676 | if (!sceneLevelSettings.ContainsKey(scene)) scene = "default"; 677 | levelSettings = GameObject.Find(sceneLevelSettings[scene]).GetComponent(); 678 | if (levelSettings != null) 679 | { 680 | defaultZeroLevel = levelSettings.ZeroLevel; 681 | defaultSkyColor = levelSettings.SkyColor; 682 | defaultEquatorColor = levelSettings.EquatorColor; 683 | defaultGroundColor = levelSettings.GroundColor; 684 | defaultNightVisionSkyColor = levelSettings.NightVisionSkyColor; 685 | defaultNightVisionEquatorColor = levelSettings.NightVisionEquatorColor; 686 | defaultNightVisionGroundColor = levelSettings.NightVisionGroundColor; 687 | } 688 | FPSCameraCC_Vintage = FPSCamera.GetComponent(); 689 | if (FPSCameraCC_Vintage != null) 690 | { 691 | defaultFPSCameraCC_Vintage = FPSCameraCC_Vintage.enabled; 692 | } 693 | /*foreach (Component component in FPSCamera.GetComponents()) 694 | { 695 | if (component.ToString() == "FPS Camera (UnityStandardAssets.ImageEffects.GlobalFog)") 696 | { 697 | FPSCameraGlobalFog = component as Behaviour; 698 | defaultFPSCameraGlobalFog = FPSCameraGlobalFog.enabled; 699 | break; 700 | } 701 | if (component.ToString() == "FPS Camera (MBOIT_Scattering)") 702 | { 703 | mBOIT_Scattering = component; 704 | if (mBOIT_Scattering != null) 705 | { 706 | defaultMBOITZeroLevel = Traverse.Create(mBOIT_Scattering).Field("ZeroLevel").GetValue(); 707 | } 708 | } 709 | }*/ 710 | mBOIT_Scattering = FPSCamera.GetComponent(); 711 | if (mBOIT_Scattering != null) 712 | { 713 | defaultMBOITZeroLevel = mBOIT_Scattering.ZeroLevel; 714 | } 715 | FPSCameraColorCorrectionCurves = FPSCamera.GetComponent(); 716 | if (FPSCameraColorCorrectionCurves != null) 717 | { 718 | defaultFPSCameraColorCorrectionCurves = FPSCameraColorCorrectionCurves.enabled; 719 | } 720 | weatherController = WeatherController.Instance; 721 | if (weatherController != null) 722 | { 723 | if (weatherController.TimeOfDayController != null) defaultGradientColorKeys = weatherController.TimeOfDayController.LightColor.colorKeys; 724 | toDController = weatherController.TimeOfDayController; 725 | if (toDController != null) 726 | { 727 | defaultAmbientBrightness = toDController.AmbientBrightness; 728 | defaultAmbientContrast = toDController.AmbientContrast; 729 | defaultScatteringBrightnessMultiplier = toDController.ScatteringBrightnessMultiplier; 730 | } 731 | tOD_Sky = TOD_Sky.Instance; 732 | if (tOD_Sky != null) 733 | { 734 | defaultSunMeshBrightness = tOD_Sky.Sun.MeshBrightness; 735 | defaultLightIntensity = tOD_Sky.Night.LightIntensity; 736 | } 737 | } 738 | FPSCameraNightVision = FPSCamera.GetComponent(); 739 | if (FPSCameraNightVision != null) 740 | { 741 | NVG = FPSCameraNightVision.On; 742 | } 743 | FPSCameraHBAO = FPSCamera.GetComponent(); 744 | if (FPSCameraHBAO != null) 745 | { 746 | defaultFPSCameraHBAOAOSettings = FPSCameraHBAO.aoSettings; 747 | defaultFPSCameraHBAOColorBleedingSettings = FPSCameraHBAO.colorBleedingSettings; 748 | FPSCameraHBAOAOSettings = FPSCameraHBAO.aoSettings; 749 | FPSCameraHBAOColorBleedingSettings = FPSCameraHBAO.colorBleedingSettings; 750 | } 751 | GraphicsMode = true; 752 | UpdateAmandsGraphics(); 753 | if ((AmandsGraphicsPlugin.SurroundDepthOfField.Value != EDepthOfField.Off || AmandsGraphicsPlugin.UIDepthOfField.Value != EUIDepthOfField.Off || AmandsGraphicsPlugin.OpticDepthOfField.Value != EDepthOfField.Off) && Graphics.activeTier == GraphicsTier.Tier2) 754 | { 755 | PreloaderUI.Instance.CloseErrorScreen(); 756 | PreloaderUI.Instance.ShowErrorScreen("High-Quality Color is Off", "Enable High-Quality Color on Graphics Settings for SurroundDOF, UIDOF and OpticDOF to work as intended"); 757 | } 758 | // Needs bug detection 759 | /*if (false) 760 | { 761 | NotificationManagerClass.DisplayMessageNotification("Motion Blur needs anti-aliasing set to TAA", EFT.Communications.ENotificationDurationType.Long, EFT.Communications.ENotificationIconType.Alert, Color.red); 762 | }*/ 763 | } 764 | } 765 | } 766 | public void ActivateAmandsOpticDepthOfField(GameObject baseopticcamera) 767 | { 768 | if (OpticCamera == null) 769 | { 770 | OpticCamera = baseopticcamera; 771 | if (OpticCamera != null) 772 | { 773 | OpticCameraPostProcessLayer = OpticCamera.GetComponent(); 774 | if (OpticCameraPostProcessLayer != null) 775 | { 776 | OpticCameraDepthOfField = Traverse.Create(OpticCameraPostProcessLayer).Field("m_Bundles").GetValue>()[typeof(UnityEngine.Rendering.PostProcessing.DepthOfField)].settings as UnityEngine.Rendering.PostProcessing.DepthOfField; 777 | if (OpticCameraDepthOfField != null) 778 | { 779 | OpticCameraDepthOfField.enabled.value = AmandsGraphicsPlugin.OpticDepthOfField.Value != EDepthOfField.Off; 780 | OpticCameraDepthOfField.kernelSize.value = AmandsGraphicsPlugin.OpticDOFKernelSize.Value; 781 | } 782 | } 783 | } 784 | } 785 | } 786 | public void AmandsGraphicsHitEffect(float power) 787 | { 788 | if (FPSCameraChromaticAberration != null) 789 | { 790 | ChromaticAberrationAnimation = 1f; 791 | ChromaticAberrationIntensity = (power / AmandsGraphicsPlugin.HitCAPower.Value) * AmandsGraphicsPlugin.HitCAIntensity.Value; 792 | FPSCameraChromaticAberration.intensity.value = ChromaticAberrationIntensity; 793 | FPSCameraChromaticAberration.enabled.value = true; 794 | } 795 | } 796 | public void UpdateAmandsGraphics() 797 | { 798 | if (AmandsGraphicsPlugin.HealthEffectHit.Value == EEnabledFeature.On) 799 | { 800 | if (amandsHitEffectClass == null) 801 | { 802 | amandsHitEffectClass = AmandsGraphicsPlugin.Hook.AddComponent(); 803 | } 804 | } 805 | else 806 | { 807 | if (amandsHitEffectClass != null) 808 | { 809 | Destroy(amandsHitEffectClass); 810 | ChromaticAberrationAnimation = 0f; 811 | if (FPSCameraChromaticAberration != null) 812 | { 813 | FPSCameraChromaticAberration.intensity.value = 0f; 814 | FPSCameraChromaticAberration.enabled.value = false; 815 | } 816 | } 817 | } 818 | if (mBOIT_Scattering != null) 819 | { 820 | switch (scene) 821 | { 822 | case "Sandbox_Scripts": 823 | Traverse.Create(mBOIT_Scattering).Field("ZeroLevel").SetValue(defaultMBOITZeroLevel + AmandsGraphicsPlugin.GroundZeroFogLevel.Value); 824 | break; 825 | case "City_Scripts": 826 | Traverse.Create(mBOIT_Scattering).Field("ZeroLevel").SetValue(defaultMBOITZeroLevel + AmandsGraphicsPlugin.StreetsFogLevel.Value); 827 | break; 828 | case "Laboratory_Scripts": 829 | break; 830 | case "custom_Scripts": 831 | Traverse.Create(mBOIT_Scattering).Field("ZeroLevel").SetValue(defaultMBOITZeroLevel + AmandsGraphicsPlugin.CustomsFogLevel.Value); 832 | break; 833 | case "Lighthouse_Scripts": 834 | Traverse.Create(mBOIT_Scattering).Field("ZeroLevel").SetValue(defaultMBOITZeroLevel + AmandsGraphicsPlugin.LighthouseFogLevel.Value); 835 | break; 836 | case "Shopping_Mall_Scripts": 837 | Traverse.Create(mBOIT_Scattering).Field("ZeroLevel").SetValue(defaultMBOITZeroLevel + AmandsGraphicsPlugin.InterchangeFogLevel.Value); 838 | break; 839 | case "woods_Scripts": 840 | Traverse.Create(mBOIT_Scattering).Field("ZeroLevel").SetValue(defaultMBOITZeroLevel + AmandsGraphicsPlugin.WoodsFogLevel.Value); 841 | break; 842 | case "Reserve_Base_Scripts": 843 | Traverse.Create(mBOIT_Scattering).Field("ZeroLevel").SetValue(defaultMBOITZeroLevel + AmandsGraphicsPlugin.ReserveFogLevel.Value); 844 | break; 845 | case "shoreline_scripts": 846 | Traverse.Create(mBOIT_Scattering).Field("ZeroLevel").SetValue(defaultMBOITZeroLevel + AmandsGraphicsPlugin.ShorelineFogLevel.Value); 847 | break; 848 | } 849 | } 850 | if (AmandsGraphicsPlugin.Flashlight.Value == EEnabledFeature.On) 851 | { 852 | foreach (KeyValuePair registeredLight in registeredLights) 853 | { 854 | registeredLight.Key.range = registeredLight.Value * AmandsGraphicsPlugin.FlashlightRange.Value; 855 | } 856 | foreach (KeyValuePair registeredVolumetricLight in registeredVolumetricLights) 857 | { 858 | registeredVolumetricLight.Key.ExtinctionCoef = AmandsGraphicsPlugin.FlashlightExtinctionCoef.Value; 859 | if (registeredVolumetricLight.Key.VolumetricMaterial != null) 860 | { 861 | registeredVolumetricLight.Key.VolumetricMaterial.SetVector("_VolumetricLight", new Vector4(registeredVolumetricLight.Key.ScatteringCoef, registeredVolumetricLight.Key.ExtinctionCoef, AmandsGraphicsPlugin.FlashlightRange.Value, 1f - registeredVolumetricLight.Key.SkyboxExtinctionCoef)); 862 | } 863 | } 864 | } 865 | else 866 | { 867 | foreach (KeyValuePair changedLight in registeredLights) 868 | { 869 | changedLight.Key.range = changedLight.Value; 870 | } 871 | foreach (KeyValuePair changedVolumetricLight in registeredVolumetricLights) 872 | { 873 | changedVolumetricLight.Key.ExtinctionCoef = changedVolumetricLight.Value; 874 | if (changedVolumetricLight.Key.VolumetricMaterial != null) 875 | { 876 | changedVolumetricLight.Key.VolumetricMaterial.SetVector("_VolumetricLight", new Vector4(changedVolumetricLight.Key.ScatteringCoef, changedVolumetricLight.Key.ExtinctionCoef, AmandsGraphicsPlugin.FlashlightRange.Value, 1f - changedVolumetricLight.Key.SkyboxExtinctionCoef)); 877 | } 878 | } 879 | } 880 | GraphicsSettings.lightsUseLinearIntensity = AmandsGraphicsPlugin.LightsUseLinearIntensity.Value; 881 | if (FPSCameraMotionBlur != null) 882 | { 883 | FPSCameraMotionBlur.enabled.Override(AmandsGraphicsPlugin.MotionBlur.Value == EEnabledFeature.On); 884 | FPSCameraMotionBlur.sampleCount.Override(AmandsGraphicsPlugin.MotionBlurSampleCount.Value); 885 | FPSCameraMotionBlur.shutterAngle.Override(AmandsGraphicsPlugin.MotionBlurShutterAngle.Value); 886 | } 887 | HoldingBreath = false; 888 | if (FPSCameraDepthOfField != null) 889 | { 890 | SurroundDepthOfField = AmandsGraphicsPlugin.SurroundDepthOfField.Value != EDepthOfField.Off; 891 | UIDepthOfField = AmandsGraphicsPlugin.UIDepthOfField.Value != EUIDepthOfField.Off; 892 | FPSCameraDepthOfField.enabled.value = false; 893 | FPSCameraDepthOfField.kernelSize.value = AmandsGraphicsPlugin.DOFKernelSize.Value; 894 | } 895 | if (FPSCameraWeaponDepthOfField != null) 896 | { 897 | FPSCameraWeaponDepthOfField.enabled = AmandsGraphicsPlugin.WeaponDepthOfField.Value != EWeaponDepthOfField.Off; 898 | FPSCameraWeaponDepthOfField.aperture = AmandsGraphicsPlugin.WeaponDOFAperture.Value; 899 | FPSCameraWeaponDepthOfField.focalSize = 100f; 900 | FPSCameraWeaponDepthOfField.blurSampleCount = AmandsGraphicsPlugin.WeaponDOFBlurSampleCount.Value; 901 | } 902 | ApertureAnimationCurve = new AnimationCurve( 903 | new Keyframe(1f, AmandsGraphicsPlugin.OpticDOFAperture1x.Value), 904 | new Keyframe(2f, AmandsGraphicsPlugin.OpticDOFAperture2x.Value), 905 | new Keyframe(4f, AmandsGraphicsPlugin.OpticDOFAperture4x.Value), 906 | new Keyframe(6f, AmandsGraphicsPlugin.OpticDOFAperture6x.Value)); 907 | if (OpticCameraDepthOfField != null) 908 | { 909 | OpticCameraDepthOfField.enabled.value = AmandsGraphicsPlugin.OpticDepthOfField.Value != EDepthOfField.Off; 910 | OpticCameraDepthOfField.kernelSize.value = AmandsGraphicsPlugin.OpticDOFKernelSize.Value; 911 | } 912 | if (AmandsGraphicsPlugin.NightAmbientLight.Value == EEnabledFeature.On) 913 | { 914 | if (toDController != null) 915 | { 916 | if (scene == "Shopping_Mall_Scripts") 917 | { 918 | NightAmbientContrast = new AnimationCurve(new Keyframe(-0.2522f, AmandsGraphicsPlugin.InterchangeNightAmbientContrast.Value), new Keyframe(-0.1261f, 1.15f)); 919 | } 920 | else 921 | { 922 | NightAmbientContrast = new AnimationCurve(new Keyframe(-0.2522f, AmandsGraphicsPlugin.NightAmbientContrast.Value), new Keyframe(-0.1261f, 1.15f)); 923 | } 924 | toDController.AmbientContrast = NightAmbientContrast; 925 | toDController.ScatteringBrightnessMultiplier = defaultScatteringBrightnessMultiplier * AmandsGraphicsPlugin.SkyBrightness.Value; 926 | } 927 | } 928 | else 929 | { 930 | if (toDController != null) 931 | { 932 | toDController.AmbientContrast = defaultAmbientContrast; 933 | toDController.ScatteringBrightnessMultiplier = defaultScatteringBrightnessMultiplier * AmandsGraphicsPlugin.SkyBrightness.Value; 934 | } 935 | } 936 | if (tOD_Sky != null) 937 | { 938 | tOD_Sky.Sun.MeshBrightness = AmandsGraphicsPlugin.SunMeshBrightness.Value; 939 | tOD_Sky.Moon.MeshBrightness = 3f; 940 | tOD_Sky.Moon.MeshContrast = 0.5f; 941 | tOD_Sky.Night.LightIntensity = defaultLightIntensity; 942 | } 943 | if (AmandsGraphicsPlugin.NVG.Value == EEnabledFeature.On && NVG) 944 | { 945 | if (toDController != null) 946 | { 947 | if (scene != "Laboratory_Scripts") NVGAmbientContrast.RemoveKey(0); 948 | switch (scene) 949 | { 950 | case "Shopping_Mall_Scripts": 951 | NVGAmbientContrast.AddKey(0f, AmandsGraphicsPlugin.InterchangeNVGAmbientContrast.Value); 952 | break; 953 | case "Laboratory_Scripts": 954 | toDController.AmbientContrast = defaultAmbientContrast; 955 | break; 956 | default: 957 | NVGAmbientContrast.AddKey(0f, AmandsGraphicsPlugin.NVGAmbientContrast.Value); 958 | break; 959 | } 960 | if (scene != "Laboratory_Scripts") toDController.AmbientContrast = NVGAmbientContrast; 961 | } 962 | if (levelSettings != null) 963 | { 964 | switch (scene) 965 | { 966 | case "Shopping_Mall_Scripts": 967 | levelSettings.NightVisionSkyColor = Color.Lerp(Color.black, defaultNightVisionSkyColor, AmandsGraphicsPlugin.InterchangeNVGOriginalSkyColor.Value); 968 | levelSettings.NightVisionEquatorColor = Color.Lerp(Color.black, defaultNightVisionEquatorColor, AmandsGraphicsPlugin.InterchangeNVGOriginalSkyColor.Value); 969 | levelSettings.NightVisionGroundColor = Color.Lerp(Color.black, defaultNightVisionGroundColor, AmandsGraphicsPlugin.InterchangeNVGOriginalSkyColor.Value); 970 | break; 971 | default: 972 | levelSettings.NightVisionSkyColor = Color.Lerp(Color.black, defaultNightVisionSkyColor, AmandsGraphicsPlugin.NVGOriginalSkyColor.Value); 973 | levelSettings.NightVisionEquatorColor = Color.Lerp(Color.black, defaultNightVisionEquatorColor, AmandsGraphicsPlugin.NVGOriginalSkyColor.Value); 974 | levelSettings.NightVisionGroundColor = Color.Lerp(Color.black, defaultNightVisionGroundColor, AmandsGraphicsPlugin.NVGOriginalSkyColor.Value); 975 | break; 976 | } 977 | } 978 | if (tOD_Sky != null && tOD_Sky.Night != null) 979 | { 980 | tOD_Sky.Night.LightIntensity = defaultLightIntensity * AmandsGraphicsPlugin.NVGMoonLightIntensity.Value; 981 | } 982 | if (FPSCameraNightVision != null) 983 | { 984 | switch (scene) 985 | { 986 | case "Shopping_Mall_Scripts": 987 | FPSCameraNightVision.NoiseIntensity = defaultNightVisionNoiseIntensity * AmandsGraphicsPlugin.InterchangeNVGNoiseIntensity.Value; 988 | break; 989 | default: 990 | FPSCameraNightVision.NoiseIntensity = defaultNightVisionNoiseIntensity * AmandsGraphicsPlugin.NVGNoiseIntensity.Value; 991 | break; 992 | } 993 | FPSCameraNightVision.ApplySettings(); 994 | } 995 | } 996 | else if (NVG) 997 | { 998 | ResetGraphics(); 999 | if (FPSCameraWeaponDepthOfField != null) 1000 | { 1001 | FPSCameraWeaponDepthOfField.enabled = AmandsGraphicsPlugin.WeaponDepthOfField.Value != EWeaponDepthOfField.Off; 1002 | FPSCameraWeaponDepthOfField.aperture = AmandsGraphicsPlugin.WeaponDOFAperture.Value; 1003 | FPSCameraWeaponDepthOfField.focalSize = 100f; 1004 | FPSCameraWeaponDepthOfField.blurSampleCount = AmandsGraphicsPlugin.WeaponDOFBlurSampleCount.Value; 1005 | } 1006 | return; 1007 | } 1008 | 1009 | if (FPSCameraHBAO != null) 1010 | { 1011 | if (AmandsGraphicsPlugin.HBAO.Value == EEnabledFeature.On) 1012 | { 1013 | switch (scene) 1014 | { 1015 | case "Laboratory_Scripts": 1016 | FPSCameraHBAOAOSettings.intensity = AmandsGraphicsPlugin.LabsHBAOIntensity.Value; 1017 | FPSCameraHBAOColorBleedingSettings.saturation = AmandsGraphicsPlugin.LabsHBAOSaturation.Value; 1018 | FPSCameraHBAOColorBleedingSettings.albedoMultiplier = AmandsGraphicsPlugin.LabsHBAOAlbedoMultiplier.Value; 1019 | break; 1020 | default: 1021 | FPSCameraHBAOAOSettings.intensity = AmandsGraphicsPlugin.HBAOIntensity.Value; 1022 | FPSCameraHBAOColorBleedingSettings.saturation = AmandsGraphicsPlugin.HBAOSaturation.Value; 1023 | FPSCameraHBAOColorBleedingSettings.albedoMultiplier = AmandsGraphicsPlugin.HBAOAlbedoMultiplier.Value; 1024 | break; 1025 | } 1026 | FPSCameraHBAO.aoSettings = FPSCameraHBAOAOSettings; 1027 | FPSCameraHBAO.colorBleedingSettings = FPSCameraHBAOColorBleedingSettings; 1028 | } 1029 | else 1030 | { 1031 | FPSCameraHBAO.aoSettings = defaultFPSCameraHBAOAOSettings; 1032 | FPSCameraHBAO.colorBleedingSettings = defaultFPSCameraHBAOColorBleedingSettings; 1033 | } 1034 | } 1035 | if (FPSCameraPrismEffects != null) 1036 | { 1037 | if (NVG) 1038 | { 1039 | switch (AmandsGraphicsPlugin.NVGTonemap.Value) 1040 | { 1041 | case ETonemap.Default: 1042 | DefaultTonemap(); 1043 | break; 1044 | case ETonemap.ACES: 1045 | ACESTonemap(); 1046 | break; 1047 | case ETonemap.Filmic: 1048 | FilmicTonemap(); 1049 | break; 1050 | } 1051 | } 1052 | else 1053 | { 1054 | switch (AmandsGraphicsPlugin.Tonemap.Value) 1055 | { 1056 | case EGlobalTonemap.Default: 1057 | DefaultTonemap(); 1058 | break; 1059 | case EGlobalTonemap.ACES: 1060 | ACESTonemap(); 1061 | break; 1062 | case EGlobalTonemap.Filmic: 1063 | FilmicTonemap(); 1064 | break; 1065 | case EGlobalTonemap.PerMap: 1066 | PerMapTonemap(); 1067 | break; 1068 | } 1069 | } 1070 | FPSCameraPrismEffects.useLut = AmandsGraphicsPlugin.UseBSGLUT.Value ? defaultuseLut : false; 1071 | } 1072 | foreach (var BloomAndFlares in FPSCameraBloomAndFlares) 1073 | { 1074 | BloomAndFlares.Key.bloomIntensity = BloomAndFlares.Value * AmandsGraphicsPlugin.BloomIntensity.Value; 1075 | } 1076 | if (weatherController != null && weatherController.TimeOfDayController != null) 1077 | { 1078 | if (AmandsGraphicsPlugin.SunColor.Value) 1079 | { 1080 | gradientColorKeys = weatherController.TimeOfDayController.LightColor.colorKeys; 1081 | gradientColorKeys[0] = new GradientColorKey(AmandsGraphicsPlugin.LightColorIndex0.Value, 0.0f); 1082 | gradientColorKeys[1] = new GradientColorKey(AmandsGraphicsPlugin.LightColorIndex1.Value, 0.5115129f); 1083 | gradientColorKeys[2] = new GradientColorKey(AmandsGraphicsPlugin.LightColorIndex2.Value, 0.5266652f); 1084 | gradientColorKeys[3] = new GradientColorKey(AmandsGraphicsPlugin.LightColorIndex3.Value, 0.5535668f); 1085 | gradientColorKeys[4] = new GradientColorKey(AmandsGraphicsPlugin.LightColorIndex4.Value, 0.6971694f); 1086 | gradientColorKeys[5] = new GradientColorKey(AmandsGraphicsPlugin.LightColorIndex5.Value, 0.9992523f); 1087 | weatherController.TimeOfDayController.LightColor.colorKeys = gradientColorKeys; 1088 | } 1089 | else 1090 | { 1091 | weatherController.TimeOfDayController.LightColor.colorKeys = defaultGradientColorKeys; 1092 | } 1093 | } 1094 | if (levelSettings != null) 1095 | { 1096 | if (AmandsGraphicsPlugin.SkyColor.Value) 1097 | { 1098 | switch (scene) 1099 | { 1100 | case "Sandbox_Scripts": 1101 | if (AmandsGraphicsPlugin.MysticalGlow.Value == EEnabledFeature.On) 1102 | { 1103 | levelSettings.SkyColor = Color.white * AmandsGraphicsPlugin.MysticalGlowIntensity.Value * AmandsGraphicsPlugin.GroundZeroMysticalGlowIntensity.Value; 1104 | } 1105 | else 1106 | { 1107 | levelSettings.SkyColor = defaultSkyColor; 1108 | } 1109 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.GroundZeroFogLevel.Value; 1110 | break; 1111 | case "City_Scripts": 1112 | if (AmandsGraphicsPlugin.MysticalGlow.Value == EEnabledFeature.On) 1113 | { 1114 | levelSettings.SkyColor = Color.white * AmandsGraphicsPlugin.MysticalGlowIntensity.Value * AmandsGraphicsPlugin.StreetsMysticalGlowIntensity.Value; 1115 | } 1116 | else 1117 | { 1118 | levelSettings.SkyColor = defaultSkyColor; 1119 | } 1120 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.StreetsFogLevel.Value; 1121 | break; 1122 | case "Laboratory_Scripts": 1123 | break; 1124 | case "custom_Scripts": 1125 | if (AmandsGraphicsPlugin.MysticalGlow.Value == EEnabledFeature.On) 1126 | { 1127 | levelSettings.SkyColor = Color.white * AmandsGraphicsPlugin.MysticalGlowIntensity.Value * AmandsGraphicsPlugin.CustomsMysticalGlowIntensity.Value; 1128 | } 1129 | else 1130 | { 1131 | levelSettings.SkyColor = defaultSkyColor; 1132 | } 1133 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.CustomsFogLevel.Value; 1134 | break; 1135 | case "Lighthouse_Scripts": 1136 | if (AmandsGraphicsPlugin.MysticalGlow.Value == EEnabledFeature.On) 1137 | { 1138 | levelSettings.SkyColor = Color.white * AmandsGraphicsPlugin.MysticalGlowIntensity.Value * AmandsGraphicsPlugin.LighthouseMysticalGlowIntensity.Value; 1139 | } 1140 | else 1141 | { 1142 | levelSettings.SkyColor = defaultSkyColor; 1143 | } 1144 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.LighthouseFogLevel.Value; 1145 | break; 1146 | case "Shopping_Mall_Scripts": 1147 | if (AmandsGraphicsPlugin.MysticalGlow.Value == EEnabledFeature.On) 1148 | { 1149 | levelSettings.SkyColor = Color.white * AmandsGraphicsPlugin.MysticalGlowIntensity.Value * AmandsGraphicsPlugin.InterchangeMysticalGlowIntensity.Value; 1150 | } 1151 | else 1152 | { 1153 | levelSettings.SkyColor = defaultSkyColor; 1154 | } 1155 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.InterchangeFogLevel.Value; 1156 | break; 1157 | case "woods_Scripts": 1158 | if (AmandsGraphicsPlugin.MysticalGlow.Value == EEnabledFeature.On) 1159 | { 1160 | levelSettings.SkyColor = Color.white * AmandsGraphicsPlugin.MysticalGlowIntensity.Value * AmandsGraphicsPlugin.WoodsMysticalGlowIntensity.Value; 1161 | } 1162 | else 1163 | { 1164 | levelSettings.SkyColor = defaultSkyColor; 1165 | } 1166 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.WoodsFogLevel.Value; 1167 | break; 1168 | case "Reserve_Base_Scripts": 1169 | if (AmandsGraphicsPlugin.MysticalGlow.Value == EEnabledFeature.On) 1170 | { 1171 | levelSettings.SkyColor = Color.white * AmandsGraphicsPlugin.MysticalGlowIntensity.Value * AmandsGraphicsPlugin.ReserveMysticalGlowIntensity.Value; 1172 | } 1173 | else 1174 | { 1175 | levelSettings.SkyColor = defaultSkyColor; 1176 | } 1177 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.ReserveFogLevel.Value; 1178 | break; 1179 | case "shoreline_scripts": 1180 | if (AmandsGraphicsPlugin.MysticalGlow.Value == EEnabledFeature.On) 1181 | { 1182 | levelSettings.SkyColor = Color.white * AmandsGraphicsPlugin.MysticalGlowIntensity.Value * AmandsGraphicsPlugin.ShorelineMysticalGlowIntensity.Value; 1183 | } 1184 | else 1185 | { 1186 | levelSettings.SkyColor = defaultSkyColor; 1187 | } 1188 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.ShorelineFogLevel.Value; 1189 | break; 1190 | case "Factory_Rework_Day_Scripts": 1191 | if (AmandsGraphicsPlugin.MysticalGlow.Value == EEnabledFeature.On) 1192 | { 1193 | levelSettings.SkyColor = Color.white * AmandsGraphicsPlugin.MysticalGlowIntensity.Value * AmandsGraphicsPlugin.ShorelineMysticalGlowIntensity.Value; 1194 | } 1195 | else 1196 | { 1197 | levelSettings.SkyColor = defaultSkyColor; 1198 | } 1199 | break; 1200 | case "Factory_Rework_Night_Scripts": 1201 | if (AmandsGraphicsPlugin.MysticalGlow.Value == EEnabledFeature.On) 1202 | { 1203 | levelSettings.SkyColor = Color.white * AmandsGraphicsPlugin.MysticalGlowIntensity.Value * AmandsGraphicsPlugin.ShorelineMysticalGlowIntensity.Value; 1204 | } 1205 | else 1206 | { 1207 | levelSettings.SkyColor = defaultSkyColor; 1208 | } 1209 | break; 1210 | default: 1211 | levelSettings.SkyColor = AmandsGraphicsPlugin.HideoutSkyColor.Value / 10; 1212 | levelSettings.EquatorColor = AmandsGraphicsPlugin.HideoutSkyColor.Value / 10; 1213 | levelSettings.GroundColor = AmandsGraphicsPlugin.HideoutSkyColor.Value / 10; 1214 | levelSettings.NightVisionSkyColor = AmandsGraphicsPlugin.HideoutSkyColor.Value / 10; 1215 | levelSettings.NightVisionEquatorColor = AmandsGraphicsPlugin.HideoutSkyColor.Value / 10; 1216 | levelSettings.NightVisionGroundColor = AmandsGraphicsPlugin.HideoutSkyColor.Value / 10; 1217 | break; 1218 | } 1219 | } 1220 | else 1221 | { 1222 | switch (scene) 1223 | { 1224 | case "Sandbox_Scripts": 1225 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.GroundZeroFogLevel.Value; 1226 | break; 1227 | case "City_Scripts": 1228 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.StreetsFogLevel.Value; 1229 | break; 1230 | case "Laboratory_Scripts": 1231 | break; 1232 | case "custom_Scripts": 1233 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.CustomsFogLevel.Value; 1234 | break; 1235 | case "Lighthouse_Scripts": 1236 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.LighthouseFogLevel.Value; 1237 | break; 1238 | case "Shopping_Mall_Scripts": 1239 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.InterchangeFogLevel.Value; 1240 | break; 1241 | case "woods_Scripts": 1242 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.WoodsFogLevel.Value; 1243 | break; 1244 | case "Reserve_Base_Scripts": 1245 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.ReserveFogLevel.Value; 1246 | break; 1247 | case "shoreline_scripts": 1248 | levelSettings.ZeroLevel = defaultZeroLevel + AmandsGraphicsPlugin.ShorelineFogLevel.Value; 1249 | break; 1250 | } 1251 | levelSettings.SkyColor = defaultSkyColor; 1252 | levelSettings.EquatorColor = defaultEquatorColor; 1253 | levelSettings.GroundColor = defaultGroundColor; 1254 | levelSettings.NightVisionSkyColor = defaultNightVisionSkyColor; 1255 | levelSettings.NightVisionEquatorColor = defaultNightVisionEquatorColor; 1256 | levelSettings.NightVisionGroundColor = defaultNightVisionGroundColor; 1257 | } 1258 | } 1259 | if (FPSCameraCC_Vintage != null) 1260 | { 1261 | FPSCameraCC_Vintage.enabled = AmandsGraphicsPlugin.UseBSGCC_Vintage.Value; 1262 | } 1263 | if (FPSCameraCC_Sharpen != null) 1264 | { 1265 | if (AmandsGraphicsPlugin.UseBSGCC_Sharpen.Value) 1266 | { 1267 | FPSCameraCC_Sharpen.enabled = defaultFPSCameraSharpen; 1268 | FPSCameraCC_Sharpen.rampOffsetR = defaultrampOffsetR; 1269 | FPSCameraCC_Sharpen.rampOffsetG = defaultrampOffsetG; 1270 | FPSCameraCC_Sharpen.rampOffsetB = defaultrampOffsetB; 1271 | } 1272 | else 1273 | { 1274 | FPSCameraCC_Sharpen.enabled = true; 1275 | FPSCameraCC_Sharpen.rampOffsetR = 0f; 1276 | FPSCameraCC_Sharpen.rampOffsetG = 0f; 1277 | FPSCameraCC_Sharpen.rampOffsetB = 0f; 1278 | } 1279 | } 1280 | if (FPSCameraGlobalFog != null) 1281 | { 1282 | FPSCameraGlobalFog.enabled = AmandsGraphicsPlugin.UseBSGGlobalFog.Value; 1283 | } 1284 | if (FPSCameraColorCorrectionCurves != null) 1285 | { 1286 | FPSCameraColorCorrectionCurves.enabled = AmandsGraphicsPlugin.UseBSGColorCorrectionCurves.Value; 1287 | } 1288 | // NVG FIX 1289 | if (NVG && AmandsGraphicsPlugin.NVGOriginalColor.Value) 1290 | { 1291 | if (FPSCameraPrismEffects != null) 1292 | { 1293 | FPSCameraPrismEffects.useLut = defaultuseLut; 1294 | } 1295 | if (levelSettings != null) 1296 | { 1297 | //levelSettings.ZeroLevel = defaultZeroLevel; 1298 | } 1299 | if (FPSCameraCC_Vintage != null) 1300 | { 1301 | FPSCameraCC_Vintage.enabled = defaultFPSCameraCC_Vintage; 1302 | } 1303 | if (FPSCameraCC_Sharpen != null) 1304 | { 1305 | FPSCameraCC_Sharpen.enabled = defaultFPSCameraSharpen; 1306 | FPSCameraCC_Sharpen.rampOffsetR = defaultrampOffsetR; 1307 | FPSCameraCC_Sharpen.rampOffsetG = defaultrampOffsetG; 1308 | FPSCameraCC_Sharpen.rampOffsetB = defaultrampOffsetB; 1309 | } 1310 | if (FPSCameraColorCorrectionCurves != null) 1311 | { 1312 | FPSCameraColorCorrectionCurves.enabled = defaultFPSCameraColorCorrectionCurves; 1313 | } 1314 | } 1315 | } 1316 | private void ResetGraphics() 1317 | { 1318 | if (mBOIT_Scattering != null) 1319 | { 1320 | Traverse.Create(mBOIT_Scattering).Field("ZeroLevel").SetValue(defaultMBOITZeroLevel); 1321 | } 1322 | foreach (KeyValuePair changedLight in registeredLights) 1323 | { 1324 | changedLight.Key.range = changedLight.Value; 1325 | } 1326 | foreach (KeyValuePair changedVolumetricLight in registeredVolumetricLights) 1327 | { 1328 | changedVolumetricLight.Key.ExtinctionCoef = changedVolumetricLight.Value; 1329 | if (changedVolumetricLight.Key.VolumetricMaterial != null) 1330 | { 1331 | changedVolumetricLight.Key.VolumetricMaterial.SetVector("_VolumetricLight", new Vector4(changedVolumetricLight.Key.ScatteringCoef, changedVolumetricLight.Key.ExtinctionCoef, AmandsGraphicsPlugin.FlashlightRange.Value, 1f - changedVolumetricLight.Key.SkyboxExtinctionCoef)); 1332 | } 1333 | } 1334 | GraphicsSettings.lightsUseLinearIntensity = defaultLightsUseLinearIntensity; 1335 | if (FPSCameraHBAO != null) 1336 | { 1337 | FPSCameraHBAO.aoSettings = defaultFPSCameraHBAOAOSettings; 1338 | FPSCameraHBAO.colorBleedingSettings = defaultFPSCameraHBAOColorBleedingSettings; 1339 | } 1340 | if (FPSCameraWeaponDepthOfField != null) 1341 | { 1342 | FPSCameraWeaponDepthOfField.enabled = defaultFPSCameraWeaponDepthOfField; 1343 | FPSCameraWeaponDepthOfField.aperture = defaultFPSCameraWeaponDepthOfFieldAperture; 1344 | FPSCameraWeaponDepthOfField.focalLength = defaultFPSCameraWeaponDepthOfFieldFocalLength; 1345 | FPSCameraWeaponDepthOfField.focalSize = defaultFPSCameraWeaponDepthOfFieldFocalSize; 1346 | FPSCameraWeaponDepthOfField.maxBlurSize = defaultFPSCameraWeaponDepthOfFieldMaxBlurSize; 1347 | FPSCameraWeaponDepthOfField.blurSampleCount = defaultFPSCameraWeaponDepthOfFieldBlurSampleCount; 1348 | } 1349 | if (FPSCameraPrismEffects != null) 1350 | { 1351 | FPSCameraPrismEffects.tonemapType = Prism.Utils.TonemapType.Filmic; 1352 | FPSCameraPrismEffects.toneValues = defaulttoneValues; 1353 | FPSCameraPrismEffects.secondaryToneValues = defaultsecondaryToneValues; 1354 | FPSCameraPrismEffects.useLut = defaultuseLut; 1355 | } 1356 | if (levelSettings != null) 1357 | { 1358 | levelSettings.ZeroLevel = defaultZeroLevel; 1359 | levelSettings.SkyColor = defaultSkyColor; 1360 | levelSettings.EquatorColor = defaultEquatorColor; 1361 | levelSettings.GroundColor = defaultGroundColor; 1362 | levelSettings.NightVisionSkyColor = defaultNightVisionSkyColor; 1363 | levelSettings.NightVisionEquatorColor = defaultNightVisionEquatorColor; 1364 | levelSettings.NightVisionGroundColor = defaultNightVisionGroundColor; 1365 | } 1366 | foreach (var BloomAndFlares in FPSCameraBloomAndFlares) 1367 | { 1368 | BloomAndFlares.Key.bloomIntensity = BloomAndFlares.Value; 1369 | } 1370 | if (weatherController != null && weatherController.TimeOfDayController != null) 1371 | { 1372 | weatherController.TimeOfDayController.LightColor.colorKeys = defaultGradientColorKeys; 1373 | } 1374 | if (toDController != null) 1375 | { 1376 | toDController.AmbientContrast = defaultAmbientContrast; 1377 | toDController.ScatteringBrightnessMultiplier = defaultScatteringBrightnessMultiplier; 1378 | } 1379 | if (tOD_Sky != null) 1380 | { 1381 | tOD_Sky.Sun.MeshBrightness = defaultSunMeshBrightness; 1382 | tOD_Sky.Moon.MeshBrightness = 0.8f; 1383 | tOD_Sky.Moon.MeshContrast = 1f; 1384 | tOD_Sky.Night.LightIntensity = defaultLightIntensity; 1385 | } 1386 | if (FPSCameraNightVision) 1387 | { 1388 | FPSCameraNightVision.NoiseIntensity = defaultNightVisionNoiseIntensity; 1389 | FPSCameraNightVision.ApplySettings(); 1390 | } 1391 | if (FPSCameraCC_Vintage != null) 1392 | { 1393 | FPSCameraCC_Vintage.enabled = defaultFPSCameraCC_Vintage; 1394 | } 1395 | if (FPSCameraCC_Sharpen != null) 1396 | { 1397 | FPSCameraCC_Sharpen.enabled = defaultFPSCameraSharpen; 1398 | FPSCameraCC_Sharpen.rampOffsetR = defaultrampOffsetR; 1399 | FPSCameraCC_Sharpen.rampOffsetG = defaultrampOffsetG; 1400 | FPSCameraCC_Sharpen.rampOffsetB = defaultrampOffsetB; 1401 | } 1402 | if (FPSCameraGlobalFog != null) 1403 | { 1404 | FPSCameraGlobalFog.enabled = defaultFPSCameraGlobalFog; 1405 | } 1406 | if (FPSCameraColorCorrectionCurves != null) 1407 | { 1408 | FPSCameraColorCorrectionCurves.enabled = defaultFPSCameraColorCorrectionCurves; 1409 | } 1410 | } 1411 | private void DefaultTonemap() 1412 | { 1413 | if (FPSCameraPrismEffects != null) 1414 | { 1415 | FPSCameraPrismEffects.tonemapType = Prism.Utils.TonemapType.Filmic; 1416 | FPSCameraPrismEffects.toneValues = defaulttoneValues; 1417 | FPSCameraPrismEffects.secondaryToneValues = defaultsecondaryToneValues; 1418 | FPSCameraPrismEffects.toneValues += new Vector3(0f, (AmandsGraphicsPlugin.Brightness.Value - 0.5f), 0f); 1419 | } 1420 | } 1421 | private void ACESTonemap() 1422 | { 1423 | if (FPSCameraPrismEffects != null) 1424 | { 1425 | FPSCameraPrismEffects.tonemapType = Prism.Utils.TonemapType.ACES; 1426 | switch (scene) 1427 | { 1428 | case "Sandbox_Scripts": 1429 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.GroundZeroACES.Value; 1430 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.GroundZeroACESS.Value; 1431 | break; 1432 | case "City_Scripts": 1433 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.StreetsACES.Value; 1434 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.StreetsACESS.Value; 1435 | break; 1436 | case "Laboratory_Scripts": 1437 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.LabsACES.Value; 1438 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.LabsACESS.Value; 1439 | break; 1440 | case "custom_Scripts": 1441 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.CustomsACES.Value; 1442 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.CustomsACESS.Value; 1443 | break; 1444 | case "Factory_Rework_Day_Scripts": 1445 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.FactoryACES.Value; 1446 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.FactoryACESS.Value; 1447 | break; 1448 | case "Factory_Rework_Night_Scripts": 1449 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.FactoryNightACES.Value; 1450 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.FactoryNightACESS.Value; 1451 | break; 1452 | case "Lighthouse_Scripts": 1453 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.LighthouseACES.Value; 1454 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.LighthouseACESS.Value; 1455 | break; 1456 | case "Shopping_Mall_Scripts": 1457 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.InterchangeACES.Value; 1458 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.InterchangeACESS.Value; 1459 | break; 1460 | case "woods_Scripts": 1461 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.WoodsACES.Value; 1462 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.WoodsACESS.Value; 1463 | break; 1464 | case "Reserve_Base_Scripts": 1465 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.ReserveACES.Value; 1466 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.ReserveACESS.Value; 1467 | break; 1468 | case "shoreline_scripts": 1469 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.ShorelineACES.Value; 1470 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.ShorelineACESS.Value; 1471 | break; 1472 | default: 1473 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.HideoutACES.Value; 1474 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.HideoutACESS.Value; 1475 | break; 1476 | } 1477 | FPSCameraPrismEffects.toneValues += new Vector3(0f, (AmandsGraphicsPlugin.Brightness.Value - 0.5f) * 4f, 0f); 1478 | } 1479 | } 1480 | private void FilmicTonemap() 1481 | { 1482 | if (FPSCameraPrismEffects != null) 1483 | { 1484 | FPSCameraPrismEffects.tonemapType = Prism.Utils.TonemapType.Filmic; 1485 | switch (scene) 1486 | { 1487 | case "Sandbox_Scripts": 1488 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.GroundZeroFilmic.Value; 1489 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.GroundZeroFilmicS.Value; 1490 | break; 1491 | case "City_Scripts": 1492 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.StreetsFilmic.Value; 1493 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.StreetsFilmicS.Value; 1494 | break; 1495 | case "Laboratory_Scripts": 1496 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.LabsFilmic.Value; 1497 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.LabsFilmicS.Value; 1498 | break; 1499 | case "custom_Scripts": 1500 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.CustomsFilmic.Value; 1501 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.CustomsFilmicS.Value; 1502 | break; 1503 | case "Factory_Rework_Day_Scripts": 1504 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.FactoryFilmic.Value; 1505 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.FactoryFilmicS.Value; 1506 | break; 1507 | case "Factory_Rework_Night_Scripts": 1508 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.FactoryNightFilmic.Value; 1509 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.FactoryNightFilmicS.Value; 1510 | break; 1511 | case "Lighthouse_Scripts": 1512 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.LighthouseFilmic.Value; 1513 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.LighthouseFilmicS.Value; 1514 | break; 1515 | case "Shopping_Mall_Scripts": 1516 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.InterchangeFilmic.Value; 1517 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.InterchangeFilmicS.Value; 1518 | break; 1519 | case "woods_Scripts": 1520 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.WoodsFilmic.Value; 1521 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.WoodsFilmicS.Value; 1522 | break; 1523 | case "Reserve_Base_Scripts": 1524 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.ReserveFilmic.Value; 1525 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.ReserveFilmicS.Value; 1526 | break; 1527 | case "shoreline_scripts": 1528 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.ShorelineFilmic.Value; 1529 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.ShorelineFilmicS.Value; 1530 | break; 1531 | default: 1532 | FPSCameraPrismEffects.toneValues = AmandsGraphicsPlugin.HideoutFilmic.Value; 1533 | FPSCameraPrismEffects.secondaryToneValues = AmandsGraphicsPlugin.HideoutFilmicS.Value; 1534 | break; 1535 | } 1536 | FPSCameraPrismEffects.toneValues += new Vector3(0f, (AmandsGraphicsPlugin.Brightness.Value - 0.5f), 0f); 1537 | } 1538 | } 1539 | private void PerMapTonemap() 1540 | { 1541 | if (FPSCameraPrismEffects != null) 1542 | { 1543 | ETonemap tonemap = ETonemap.ACES; 1544 | switch (scene) 1545 | { 1546 | case "Sandbox_Scripts": 1547 | tonemap = AmandsGraphicsPlugin.GroundZeroTonemap.Value; 1548 | break; 1549 | case "City_Scripts": 1550 | tonemap = AmandsGraphicsPlugin.StreetsTonemap.Value; 1551 | break; 1552 | case "Laboratory_Scripts": 1553 | tonemap = AmandsGraphicsPlugin.LabsTonemap.Value; 1554 | break; 1555 | case "custom_Scripts": 1556 | tonemap = AmandsGraphicsPlugin.CustomsTonemap.Value; 1557 | break; 1558 | case "Factory_Rework_Day_Scripts": 1559 | tonemap = AmandsGraphicsPlugin.FactoryTonemap.Value; 1560 | break; 1561 | case "Factory_Rework_Night_Scripts": 1562 | tonemap = AmandsGraphicsPlugin.FactoryNightTonemap.Value; 1563 | break; 1564 | case "Lighthouse_Scripts": 1565 | tonemap = AmandsGraphicsPlugin.LighthouseTonemap.Value; 1566 | break; 1567 | case "Shopping_Mall_Scripts": 1568 | tonemap = AmandsGraphicsPlugin.InterchangeTonemap.Value; 1569 | break; 1570 | case "woods_Scripts": 1571 | tonemap = AmandsGraphicsPlugin.WoodsTonemap.Value; 1572 | break; 1573 | case "Reserve_Base_Scripts": 1574 | tonemap = AmandsGraphicsPlugin.ReserveTonemap.Value; 1575 | break; 1576 | case "shoreline_scripts": 1577 | tonemap = AmandsGraphicsPlugin.ShorelineTonemap.Value; 1578 | break; 1579 | default: 1580 | tonemap = AmandsGraphicsPlugin.HideoutTonemap.Value; 1581 | break; 1582 | } 1583 | switch (tonemap) 1584 | { 1585 | case ETonemap.Default: 1586 | DefaultTonemap(); 1587 | break; 1588 | case ETonemap.ACES: 1589 | ACESTonemap(); 1590 | break; 1591 | case ETonemap.Filmic: 1592 | FilmicTonemap(); 1593 | break; 1594 | } 1595 | } 1596 | } 1597 | private void SettingsUpdated(object sender, EventArgs e) 1598 | { 1599 | if ((AmandsGraphicsPlugin.SurroundDepthOfField.Value != EDepthOfField.Off || AmandsGraphicsPlugin.UIDepthOfField.Value != EUIDepthOfField.Off || AmandsGraphicsPlugin.OpticDepthOfField.Value != EDepthOfField.Off) && Graphics.activeTier == GraphicsTier.Tier2) 1600 | { 1601 | PreloaderUI.Instance.CloseErrorScreen(); 1602 | PreloaderUI.Instance.ShowErrorScreen("High-Quality Color is Off", "Enable High-Quality Color on Graphics Settings for SurroundDOF, UIDOF and OpticDOF to work as intended"); 1603 | } 1604 | if (GraphicsMode) 1605 | { 1606 | UpdateAmandsGraphics(); 1607 | } 1608 | } 1609 | public void AmandsToggleText(bool Enabled) 1610 | { 1611 | if (AmandsToggleTextUIGameObject == null) return; 1612 | if (amandsToggleText == null) 1613 | { 1614 | AmandsToggleTextGameObject = new GameObject("AmandsToggleTextGameObject"); 1615 | AmandsToggleTextGameObject.transform.SetParent(AmandsToggleTextUIGameObject.transform); 1616 | amandsToggleText = AmandsToggleTextGameObject.AddComponent(); 1617 | amandsToggleText.text = "AMANDS " + (Enabled ? "ON" : "OFF"); 1618 | } 1619 | else 1620 | { 1621 | amandsToggleText.UpdateText("AMANDS " + (Enabled ? "ON" : "OFF")); 1622 | } 1623 | } 1624 | public static void CreateGameObjects(Transform parent) 1625 | { 1626 | AmandsToggleTextUIGameObject = new GameObject("AmandsToggleText"); 1627 | AmandsToggleTextUITransform = AmandsToggleTextUIGameObject.AddComponent(); 1628 | AmandsToggleTextUIGameObject.transform.SetParent(parent); 1629 | AmandsToggleTextUITransform.anchorMin = Vector2.zero; 1630 | AmandsToggleTextUITransform.anchorMax = Vector2.zero; 1631 | AmandsToggleTextUITransform.sizeDelta = new Vector2(0f, 0f); 1632 | AmandsToggleTextUIVerticalLayoutGroup = AmandsToggleTextUIGameObject.AddComponent(); 1633 | AmandsToggleTextUIVerticalLayoutGroup.childControlHeight = false; 1634 | ContentSizeFitter contentSizeFitter = AmandsToggleTextUIGameObject.AddComponent(); 1635 | contentSizeFitter.horizontalFit = ContentSizeFitter.FitMode.PreferredSize; 1636 | contentSizeFitter.verticalFit = ContentSizeFitter.FitMode.PreferredSize; 1637 | AmandsToggleTextUITransform.localPosition = new Vector2((Screen.width / 2) - 100, -420.0f); 1638 | AmandsToggleTextUITransform.pivot = new Vector2(1f, 0f); 1639 | } 1640 | public static void DestroyGameObjects() 1641 | { 1642 | if (AmandsToggleTextUIGameObject != null) Destroy(AmandsToggleTextUIGameObject); 1643 | } 1644 | } 1645 | public enum EEnabledFeature 1646 | { 1647 | Off, 1648 | On 1649 | } 1650 | public enum EDepthOfField 1651 | { 1652 | Off, 1653 | On, 1654 | HoldingBreathOnly 1655 | } 1656 | public enum EMedsDepthOfField 1657 | { 1658 | Off, 1659 | On, 1660 | SurgicalKitOnly 1661 | } 1662 | public enum EUIDepthOfField 1663 | { 1664 | Off, 1665 | On 1666 | } 1667 | public enum EWeaponDepthOfField 1668 | { 1669 | Off, 1670 | On 1671 | } 1672 | public enum EAimingMode 1673 | { 1674 | IronSight, 1675 | Sight 1676 | } 1677 | public enum EWeaponDepthOfFieldState 1678 | { 1679 | Off, 1680 | Weapon, 1681 | IronSight, 1682 | Sight, 1683 | NVG 1684 | } 1685 | public enum EOpticDOFFocalLengthMode 1686 | { 1687 | Math, 1688 | FixedValue 1689 | } 1690 | public enum ERaycastQuality 1691 | { 1692 | Low, 1693 | High, 1694 | Foliage 1695 | } 1696 | public enum ETonemap 1697 | { 1698 | Default, 1699 | ACES, 1700 | Filmic 1701 | } 1702 | public enum EGlobalTonemap 1703 | { 1704 | Default, 1705 | ACES, 1706 | Filmic, 1707 | PerMap 1708 | } 1709 | public enum EDebugMode 1710 | { 1711 | Flashlight, 1712 | NVG, 1713 | NVGOriginalColor, 1714 | NightAmbientLight, 1715 | HBAO, 1716 | MysticalGlow, 1717 | DefaultToACES, 1718 | DefaultToFilmic, 1719 | ACESToFilmic, 1720 | useLut, 1721 | CC_Vintage, 1722 | CC_Sharpen, 1723 | GlobalFog, 1724 | ColorCorrectionCurves, 1725 | LightsUseLinearIntensity, 1726 | SunColor, 1727 | SkyColor 1728 | } 1729 | public class AmandsHitEffectClass : MonoBehaviour 1730 | { 1731 | public void Start() 1732 | { 1733 | } 1734 | public void Update() 1735 | { 1736 | if (AmandsGraphicsClass.ChromaticAberrationAnimation > 0) 1737 | { 1738 | AmandsGraphicsClass.ChromaticAberrationAnimation -= Time.deltaTime / AmandsGraphicsPlugin.HitCASpeed.Value; 1739 | if (AmandsGraphicsClass.FPSCameraChromaticAberration != null) 1740 | { 1741 | AmandsGraphicsClass.FPSCameraChromaticAberration.intensity.value = Mathf.Lerp(0f, AmandsGraphicsClass.ChromaticAberrationIntensity, AmandsGraphicsClass.ChromaticAberrationAnimation); 1742 | AmandsGraphicsClass.FPSCameraChromaticAberration.enabled.value = AmandsGraphicsClass.ChromaticAberrationAnimation > 0.0f; 1743 | } 1744 | } 1745 | } 1746 | } 1747 | public class AmandsToggleText : MonoBehaviour 1748 | { 1749 | public TMP_Text tMP_Text; 1750 | public string text = ""; 1751 | public Color color = new Color(0.84f, 0.88f, 0.95f, 0.69f); 1752 | public int fontSize = 26; 1753 | public float outlineWidth = 0.01f; 1754 | public FontStyles fontStyles = FontStyles.SmallCaps; 1755 | public TextAlignmentOptions textAlignmentOptions = TextAlignmentOptions.Right; 1756 | public float time = 2f; 1757 | public float lifeTime = 0f; 1758 | public float OpacitySpeed = 0.08f; 1759 | private float Opacity = 1f; 1760 | private float StartOpacity = 0f; 1761 | private bool UpdateOpacity = false; 1762 | private bool UpdateStartOpacity = false; 1763 | 1764 | public void Start() 1765 | { 1766 | tMP_Text = gameObject.AddComponent(); 1767 | if (tMP_Text != null) 1768 | { 1769 | tMP_Text.text = text; 1770 | tMP_Text.color = color; 1771 | tMP_Text.fontSize = fontSize; 1772 | tMP_Text.outlineWidth = outlineWidth; 1773 | tMP_Text.fontStyle = fontStyles; 1774 | tMP_Text.alignment = textAlignmentOptions; 1775 | tMP_Text.alpha = 0f; 1776 | UpdateStartOpacity = true; 1777 | } 1778 | else 1779 | { 1780 | Destroy(gameObject); 1781 | } 1782 | } 1783 | public void UpdateText(string Text) 1784 | { 1785 | text = Text; 1786 | if (tMP_Text != null) 1787 | { 1788 | tMP_Text.text = Text; 1789 | } 1790 | lifeTime = 0f; 1791 | if (UpdateOpacity && tMP_Text != null) 1792 | { 1793 | Opacity = 1f; 1794 | tMP_Text.alpha = Opacity; 1795 | UpdateOpacity = false; 1796 | } 1797 | } 1798 | public void Update() 1799 | { 1800 | lifeTime += Time.deltaTime; 1801 | if (lifeTime > time) 1802 | { 1803 | UpdateOpacity = true; 1804 | } 1805 | if (UpdateOpacity && tMP_Text != null) 1806 | { 1807 | Opacity -= Math.Max(0.01f, OpacitySpeed); 1808 | tMP_Text.alpha = Opacity; 1809 | if (Opacity < 0) 1810 | { 1811 | UpdateOpacity = false; 1812 | UpdateStartOpacity = false; 1813 | Destroy(gameObject); 1814 | } 1815 | } 1816 | else if (UpdateStartOpacity && StartOpacity < 1f && tMP_Text != null) 1817 | { 1818 | StartOpacity += OpacitySpeed * 2f; 1819 | tMP_Text.alpha = StartOpacity; 1820 | } 1821 | } 1822 | } 1823 | } 1824 | 1825 | --------------------------------------------------------------------------------