Decompiled source of Cinematic Outward v1.24.0
OutwardCinecamDefed.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("OutwardCinecamDefed")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OutwardCinecamDefed")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("d03bed27-5bb6-44c2-8b95-96283249d9ea")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OutwardCinecam; internal sealed class ConfigurationManagerAttributes { public bool? IsAdvanced; public int? Order; public Action<ConfigEntryBase> CustomDrawer; } internal sealed class ConfigRename { public readonly ConfigDefinition From; public readonly ConfigDefinition To; public readonly Func<string, string> Convert; public ConfigRename(string fromSection, string fromKey, string toSection, string toKey, Func<string, string> convert = null) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown From = new ConfigDefinition(fromSection, fromKey); To = new ConfigDefinition(toSection, toKey); Convert = convert; } } [BepInPlugin("com.poweredbypodcube.cinecam", "Cinematic Outward", "1.24.0")] public class CinemaCamera : BaseUnityPlugin { public enum VideoCamState { NORMAL, FOLLOW_ROT, FOLLOW_POS, FOLLOW_POSROT } public enum DirectorShotType { LockedStatic, TripodPan, Chase, Slider, ActionCam } [Serializable] public class PresetData { public int presetVersion; public bool globalBypass; public bool dofNormEnabled; public float dofNormAp; public float dofNormFocal; public float dofNormOffset; public bool cgEnabled; public float cgTemp; public float cgTint; public float cgExposure; public float cgSat; public float cgContrast; public bool bloomEnabled; public float bloomInt; public float bloomThresh; public bool vigEnabled; public float vigInt; public float vigSmooth; public bool chromEnabled; public float chromInt; public bool grainEnabled; public float grainInt; public float grainSize; public bool aoEnabled; public float aoInt; public bool ssrEnabled; public int ssrQual; public int aaMode; public float dirSwitchTime; public float occlCutTime; public bool dirDynFOV; public float gimbalSmooth; public float trackSpeed; public bool hideHudCine; public bool syncHead; public float headingIndSize; public float dirMinH; public float dirMaxH; public float dirMinDistP; public float dirMaxDistP; public float dirMinF; public float dirMaxF; public float dirZoomAgg; public int wStatic; public int wTripod; public int wChase; public int wSlider; public bool dofDirEnabled; public float dofDirAp; public float dofDirFocal; public bool dirLetterbox; public bool dirActionCam; public bool dirShake; public float shakeInt; public float shakeSpd; public bool hideHudFree; public float fcRange; public float fcPullTime; public float fcFarPullTime; public float fcLostDelay; public float fcFarDist; public float fcFarAp; public bool fcPreferChars; public float fcSharpZone; } public static CinemaCamera Instance; private static readonly bool IgnoreAdditiveSceneLoads = false; private static readonly RaycastHit[] s_hitBuffer = (RaycastHit[])(object)new RaycastHit[128]; private ConfigEntry<string> presetDropdown; private ConfigEntry<string> presetSaveName; private ConfigEntry<bool> savePresetBtn; private ConfigEntry<string> presetStatus; private ConfigEntry<bool> globalPPBypass; private ConfigEntry<bool> enableDofNormalPlay; private ConfigEntry<float> dofNormalAperture; private ConfigEntry<float> dofNormalFocalLength; private ConfigEntry<float> dofNormalOffset; private ConfigEntry<bool> enableColorGrading; private ConfigEntry<float> cgTemperature; private ConfigEntry<float> cgTint; private ConfigEntry<float> cgPostExposure; private ConfigEntry<float> cgSaturation; private ConfigEntry<float> cgContrast; private ConfigEntry<bool> enableBloom; private ConfigEntry<float> bloomIntensity; private ConfigEntry<float> bloomThreshold; private ConfigEntry<bool> enableVignette; private ConfigEntry<float> vignetteIntensity; private ConfigEntry<float> vignetteSmoothness; private ConfigEntry<bool> enableChromatic; private ConfigEntry<float> chromaticIntensity; private ConfigEntry<bool> enableGrain; private ConfigEntry<float> grainIntensity; private ConfigEntry<float> grainSize; private ConfigEntry<bool> enableAO; private ConfigEntry<float> aoIntensity; private ConfigEntry<bool> enableSSR; private ConfigEntry<ScreenSpaceReflectionPreset> ssrQuality; private ConfigEntry<Antialiasing> aaMode; private ConfigEntry<KeyboardShortcut> toggleCamKey; private ConfigEntry<KeyboardShortcut> autoCinematicKey; private ConfigEntry<KeyboardShortcut> forceCutKey; private ConfigEntry<KeyboardShortcut> toggleHudKey; private ConfigEntry<KeyboardShortcut> aimTeleportKey; private ConfigEntry<KeyboardShortcut> freezeCamKey; private ConfigEntry<bool> hideHudInFreecam; private ConfigEntry<KeyboardShortcut> spectateNextKey; private ConfigEntry<KeyboardShortcut> spectatePrevKey; private ConfigEntry<float> freecamAutofocusRange; private ConfigEntry<bool> freecamPreferCharacters; private ConfigEntry<float> freecamSharpZone; private ConfigEntry<float> freecamFocusPullTime; private ConfigEntry<float> freecamFarPullTime; private ConfigEntry<float> freecamLostSubjectDelay; private ConfigEntry<float> freecamFarFocusDistance; private ConfigEntry<float> freecamFarFocusAperture; private ConfigEntry<float> directorSwitchTime; private ConfigEntry<float> occlusionCutTime; private ConfigEntry<bool> directorDynamicFOV; private ConfigEntry<float> gimbalSmoothing; private ConfigEntry<float> trackingSpeed; private ConfigEntry<bool> hideHudInCinematic; private ConfigEntry<bool> syncCharacterHeading; private ConfigEntry<float> headingIndicatorSize; private ConfigEntry<float> dirMinHeight; private ConfigEntry<float> dirMaxHeight; private ConfigEntry<float> dirMinDistPlace; private ConfigEntry<float> dirMaxDistPlace; private ConfigEntry<float> dirMinFov; private ConfigEntry<float> dirMaxFov; private ConfigEntry<float> dirZoomAggression; private ConfigEntry<int> weightStatic; private ConfigEntry<int> weightTripod; private ConfigEntry<int> weightChase; private ConfigEntry<int> weightSlider; private ConfigEntry<bool> enableDofDirector; private ConfigEntry<float> dofCineAperture; private ConfigEntry<float> dofCineFocalLength; private ConfigEntry<bool> enableLetterboxing; private ConfigEntry<bool> enableCombatActionCam; private ConfigEntry<bool> enableCameraShake; private ConfigEntry<float> shakeIntensity; private ConfigEntry<float> shakeSpeed; private ConfigEntry<bool> logLoadTiming; private float m_speed = 10f; private float m_mouseSens = 50f; private float m_rotationZ = 1f; public Transform CinemaCameraTrans; private Camera m_camera; private Camera m_sourceCamera; private PostProcessLayer m_ppLayer; private bool m_active; private Transform m_targetTrans; private Vector3 m_targetLastPos; private Vector3 m_currentMovement; private Vector2 m_rotInput; private VideoCamState m_state; private Vector3 m_lookAtOffset = new Vector3(0f, 1.5f, 0f); private int m_previousMouseOwner = -1; private bool m_keyboardDisabled; private Character m_localPlayer; private Character m_cameraTarget; private List<Character> m_activePlayers = new List<Character>(); private bool m_wasDead; private bool m_isFrozen; private float m_originalFov = 50f; private Quaternion m_lastShake = Quaternion.identity; private bool m_cameraReady; private bool m_initPending; private float m_nextInitAttempt; private PostProcessLayer m_mainPpLayer; private Antialiasing m_mainOriginalAA; private bool isCasting; private GameObject m_indicatorObj; private GameObject m_headingIndicator; private bool m_isDirectorActive; private float m_directorTimer; private float m_occlusionTimer; private float m_actionCamExitTimer; private const float ActionCamExitCooldown = 2f; private float m_currentCutZoomFactor = 1f; private Vector3 m_lastPlayerPos; private bool m_needsHeadingSync; private bool m_cursorWasLockedLastFrame = true; private float m_escPauseCheckTimer; private const float EscPauseCheckWindow = 0.5f; private GameObject m_letterboxCanvas; private bool m_pendingDirectorRestore; private DirectorShotType m_currentShotType; private Vector3 m_chaseWorldOffset; private Vector3 m_chaseCurrentVel; private Vector3 m_sliderDirection; private float m_sliderSpeed; private Vector3 m_sliderCurrentVel; private bool m_hudManuallyHidden; private bool m_isUiGloballyHidden; private Canvas[] m_hiddenCanvases; private GameObject m_dofVolumeObj; private PostProcessProfile m_profile; private DepthOfField m_dof; private Bloom m_bloom; private ColorGrading m_colorGrading; private Vignette m_vignette; private ChromaticAberration m_chromatic; private Grain m_grain; private AmbientOcclusion m_ao; private ScreenSpaceReflections m_ssr; private float m_currentFocusDistance = 5f; private float m_currentAperture = 2f; private const float AfSubjectRadius = 0.28f; private const float AfSubjectScanInterval = 0.1f; private const float AfSubjectStickiness = 0.08f; private const float AfSphereRadius = 0.25f; private const float AfRingSpan = 0.08f; private const float AfSameSurface = 0.15f; private const float AfRetargetDelay = 0.12f; private const float AfCircleOfConfusion = 0.03f; private bool m_afSeeded; private float m_afLogFocus; private float m_afLogFocusVel; private float m_afLogAperture; private float m_afLogApertureVel; private float m_afNoSubjectTimer; private Character m_afSubject; private float m_afScanTimer; private bool m_afHasTarget; private float m_afTarget = 5f; private float m_afJumpDepth; private float m_afJumpTimer; private const string S_Presets = "01. Presets & Quick Toggles"; private const string S_Keys = "02. Hotkeys"; private const string S_Free = "03. Free Camera"; private const string S_Dir = "04. Director Mode"; private const string S_DirTune = "05. Director Mode: Fine Tuning"; private const string S_Dof = "06. Visuals: Depth of Field"; private const string S_Color = "07. Visuals: Color Grading"; private const string S_Lens = "08. Visuals: Lens Effects"; private const string S_Quality = "09. Visuals: Quality"; private const string S_Debug = "10. Debug"; private const string O_Preset = "00. Preset Manager"; private const string O_PPMaster = "01. Post-Processing: Master"; private const string O_DofN = "01. Post-Processing: Normal Play DoF"; private const string O_CG = "02. Post-Processing: Color Grading"; private const string O_Bloom = "03. Post-Processing: Bloom"; private const string O_Vig = "04. Post-Processing: Vignette"; private const string O_Chrom = "05. Post-Processing: Chromatic Aberration"; private const string O_Grain = "06. Post-Processing: Film Grain"; private const string O_AO = "07. Post-Processing: AO, Reflections & AA"; private const string O_Keys = "08. Hotkeys"; private const string O_Rules = "09. Cinematic Mode: Rules & Behavior"; private const string O_Frame = "10. Cinematic Mode: Framing & Zoom"; private const string O_Weights = "11. Cinematic Mode: Shot Weights"; private const string O_DofC = "12. Cinematic Mode: Depth of Field"; private const string O_Extras = "13. Cinematic Mode: Extras"; private const string O_Debug = "14. Debug"; private static readonly ConfigRename[] ConfigRenames = new ConfigRename[67] { new ConfigRename("00. Preset Manager", "1. Load Preset", "01. Presets & Quick Toggles", "Load Preset"), new ConfigRename("00. Preset Manager", "2. Save Preset As:", "01. Presets & Quick Toggles", "Save Preset As"), new ConfigRename("01. Post-Processing: Master", "1. Global Bypass", "01. Presets & Quick Toggles", "Disable All Visual Overrides"), new ConfigRename("08. Hotkeys", "1. Toggle Free Camera", "02. Hotkeys", "Toggle Free Camera"), new ConfigRename("08. Hotkeys", "2. Toggle Director Mode", "02. Hotkeys", "Toggle Director Mode"), new ConfigRename("08. Hotkeys", "3. Force Director Cut", "02. Hotkeys", "Force Director Cut"), new ConfigRename("08. Hotkeys", "4. Toggle HUD UI", "02. Hotkeys", "Toggle HUD"), new ConfigRename("08. Hotkeys", "6. Aim Teleport (Unbound)", "02. Hotkeys", "Aim Teleport"), new ConfigRename("08. Hotkeys", "7. Freeze Camera (Unbound)", "02. Hotkeys", "Freeze Camera"), new ConfigRename("08. Hotkeys", "8. Spectate Next Player", "02. Hotkeys", "Spectate Next Player"), new ConfigRename("08. Hotkeys", "9. Spectate Prev Player", "02. Hotkeys", "Spectate Previous Player"), new ConfigRename("08. Hotkeys", "5. Auto-Hide HUD in Freecam", "03. Free Camera", "Auto-Hide HUD"), new ConfigRename("13. Cinematic Mode: Extras", "2. Enable Combat Action Cam", "04. Director Mode", "Combat Action Cam"), new ConfigRename("09. Cinematic Mode: Rules & Behavior", "1. Auto-Switch Time", "04. Director Mode", "Auto-Switch Time"), new ConfigRename("09. Cinematic Mode: Rules & Behavior", "3. Dynamic FOV", "04. Director Mode", "Dynamic FOV"), new ConfigRename("13. Cinematic Mode: Extras", "1. Enable 2.35:1 Letterboxing", "04. Director Mode", "Letterboxing (2.35:1)"), new ConfigRename("13. Cinematic Mode: Extras", "3. Enable Handheld Shake", "04. Director Mode", "Handheld Shake"), new ConfigRename("09. Cinematic Mode: Rules & Behavior", "6. Hide HUD in Director", "04. Director Mode", "Hide HUD"), new ConfigRename("09. Cinematic Mode: Rules & Behavior", "7. Sync Movement to Screen", "04. Director Mode", "Sync Movement to Screen"), new ConfigRename("09. Cinematic Mode: Rules & Behavior", "8. Heading Indicator Size", "04. Director Mode", "Heading Indicator Size"), new ConfigRename("09. Cinematic Mode: Rules & Behavior", "2. Occlusion Cut Timer", "05. Director Mode: Fine Tuning", "Occlusion Cut Timer"), new ConfigRename("09. Cinematic Mode: Rules & Behavior", "4. Gimbal Rotation Smoothing", "05. Director Mode: Fine Tuning", "Gimbal Rotation Smoothing"), new ConfigRename("09. Cinematic Mode: Rules & Behavior", "5. Chase Tracking Speed", "05. Director Mode: Fine Tuning", "Chase Tracking Speed"), new ConfigRename("13. Cinematic Mode: Extras", "4. Shake Intensity", "05. Director Mode: Fine Tuning", "Shake Intensity"), new ConfigRename("13. Cinematic Mode: Extras", "5. Shake Speed", "05. Director Mode: Fine Tuning", "Shake Speed"), new ConfigRename("10. Cinematic Mode: Framing & Zoom", "1. Min Spawn Height", "05. Director Mode: Fine Tuning", "Min Spawn Height"), new ConfigRename("10. Cinematic Mode: Framing & Zoom", "2. Max Spawn Height", "05. Director Mode: Fine Tuning", "Max Spawn Height"), new ConfigRename("10. Cinematic Mode: Framing & Zoom", "3. Min Spawn Radius", "05. Director Mode: Fine Tuning", "Min Spawn Radius"), new ConfigRename("10. Cinematic Mode: Framing & Zoom", "4. Max Spawn Radius", "05. Director Mode: Fine Tuning", "Max Spawn Radius"), new ConfigRename("10. Cinematic Mode: Framing & Zoom", "5. Min FOV (Tightest Zoom)", "05. Director Mode: Fine Tuning", "Min FOV (Tightest Zoom)"), new ConfigRename("10. Cinematic Mode: Framing & Zoom", "5. Min FOV (Tighest Zoom)", "05. Director Mode: Fine Tuning", "Min FOV (Tightest Zoom)"), new ConfigRename("10. Cinematic Mode: Framing & Zoom", "6. Max FOV (Widest Zoom)", "05. Director Mode: Fine Tuning", "Max FOV (Widest Zoom)"), new ConfigRename("10. Cinematic Mode: Framing & Zoom", "7. Zoom Aggression", "05. Director Mode: Fine Tuning", "Zoom Aggression"), new ConfigRename("11. Cinematic Mode: Shot Weights", "1. Locked Static Weight", "05. Director Mode: Fine Tuning", "Shot Weight: Locked Static"), new ConfigRename("11. Cinematic Mode: Shot Weights", "2. Tripod Pan Weight", "05. Director Mode: Fine Tuning", "Shot Weight: Tripod Pan"), new ConfigRename("11. Cinematic Mode: Shot Weights", "3. Chase Cam Weight", "05. Director Mode: Fine Tuning", "Shot Weight: Chase Cam"), new ConfigRename("11. Cinematic Mode: Shot Weights", "4. Slider Track Weight", "05. Director Mode: Fine Tuning", "Shot Weight: Slider Track"), new ConfigRename("01. Post-Processing: Normal Play DoF", "1. Enable Normal DoF", "06. Visuals: Depth of Field", "Enable DoF in Normal Play"), new ConfigRename("01. Post-Processing: Normal Play DoF", "2. Normal Aperture", "06. Visuals: Depth of Field", "Normal Play Aperture"), new ConfigRename("01. Post-Processing: Normal Play DoF", "3. Normal Focal Length", "06. Visuals: Depth of Field", "Normal Play Focal Length"), new ConfigRename("01. Post-Processing: Normal Play DoF", "4. Focus Plane Offset", "06. Visuals: Depth of Field", "Normal Play Focus Offset"), new ConfigRename("12. Cinematic Mode: Depth of Field", "1. Enable Cinematic DoF", "06. Visuals: Depth of Field", "Enable DoF in Free/Director Cam"), new ConfigRename("12. Cinematic Mode: Depth of Field", "2. Cinematic Aperture", "06. Visuals: Depth of Field", "Free/Director Cam Aperture"), new ConfigRename("12. Cinematic Mode: Depth of Field", "3. Cinematic Focal Length", "06. Visuals: Depth of Field", "Free/Director Cam Focal Length"), new ConfigRename("02. Post-Processing: Color Grading", "1. Enable Color Grading", "07. Visuals: Color Grading", "Enable Color Grading"), new ConfigRename("02. Post-Processing: Color Grading", "2. Temperature", "07. Visuals: Color Grading", "Temperature"), new ConfigRename("02. Post-Processing: Color Grading", "3. Tint", "07. Visuals: Color Grading", "Tint"), new ConfigRename("02. Post-Processing: Color Grading", "4. Post Exposure", "07. Visuals: Color Grading", "Post Exposure"), new ConfigRename("02. Post-Processing: Color Grading", "5. Saturation", "07. Visuals: Color Grading", "Saturation"), new ConfigRename("02. Post-Processing: Color Grading", "6. Contrast", "07. Visuals: Color Grading", "Contrast"), new ConfigRename("03. Post-Processing: Bloom", "1. Enable Bloom", "08. Visuals: Lens Effects", "Enable Bloom"), new ConfigRename("03. Post-Processing: Bloom", "2. Bloom Intensity", "08. Visuals: Lens Effects", "Bloom Intensity"), new ConfigRename("03. Post-Processing: Bloom", "3. Bloom Threshold", "08. Visuals: Lens Effects", "Bloom Threshold"), new ConfigRename("04. Post-Processing: Vignette", "1. Enable Vignette", "08. Visuals: Lens Effects", "Enable Vignette"), new ConfigRename("04. Post-Processing: Vignette", "2. Vignette Intensity", "08. Visuals: Lens Effects", "Vignette Intensity"), new ConfigRename("04. Post-Processing: Vignette", "3. Vignette Smoothness", "08. Visuals: Lens Effects", "Vignette Smoothness"), new ConfigRename("05. Post-Processing: Chromatic Aberration", "1. Enable Chromatic Aberration", "08. Visuals: Lens Effects", "Enable Chromatic Aberration"), new ConfigRename("05. Post-Processing: Chromatic Aberration", "2. Chromatic Intensity", "08. Visuals: Lens Effects", "Chromatic Intensity"), new ConfigRename("06. Post-Processing: Film Grain", "1. Enable Film Grain", "08. Visuals: Lens Effects", "Enable Film Grain"), new ConfigRename("06. Post-Processing: Film Grain", "2. Grain Intensity", "08. Visuals: Lens Effects", "Grain Intensity"), new ConfigRename("06. Post-Processing: Film Grain", "3. Grain Size", "08. Visuals: Lens Effects", "Grain Size"), new ConfigRename("07. Post-Processing: AO, Reflections & AA", "1. Enable Ambient Occlusion", "09. Visuals: Quality", "Enable Ambient Occlusion"), new ConfigRename("07. Post-Processing: AO, Reflections & AA", "2. AO Intensity", "09. Visuals: Quality", "AO Intensity"), new ConfigRename("07. Post-Processing: AO, Reflections & AA", "3. Enable SSR", "09. Visuals: Quality", "Enable SSR"), new ConfigRename("07. Post-Processing: AO, Reflections & AA", "4. SSR Quality", "09. Visuals: Quality", "SSR Quality"), new ConfigRename("07. Post-Processing: AO, Reflections & AA", "5. AA Method", "09. Visuals: Quality", "AA Method"), new ConfigRename("14. Debug", "1. Log Load Timing", "10. Debug", "Log Load Timing") }; private int m_cfgOrder = 10000; private const int CurrentPresetVersion = 1; private string[] m_presetNames; private float m_presetNamesTime = -100f; private bool HasCamera { get { if ((Object)(object)m_camera != (Object)null) { return (Object)(object)CinemaCameraTrans != (Object)null; } return false; } } private bool CanActivateCamera { get { if (!HasCamera) { return (Object)(object)m_sourceCamera != (Object)null; } return true; } } private static string[] GetPresetNames() { string path = Path.Combine(Paths.ConfigPath, "OutwardCinecam", "Presets"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } IEnumerable<string> second = (from n in Directory.GetFiles(path, "*.json").Select(Path.GetFileNameWithoutExtension) where n != "None" select n).OrderBy<string, string>((string n) => n, StringComparer.OrdinalIgnoreCase); return new string[1] { "None" }.Concat(second).ToArray(); } private void SetGameCameraActive(bool on) { if ((Object)(object)m_localPlayer == (Object)null || (Object)(object)m_localPlayer.CharacterCamera == (Object)null) { return; } Camera cameraScript = m_localPlayer.CharacterCamera.CameraScript; if (!((Object)(object)cameraScript == (Object)null)) { ((Component)cameraScript).gameObject.SetActive(on); if (on) { cameraScript.ResetWorldToCameraMatrix(); cameraScript.ResetProjectionMatrix(); } } } private static AcceptableValueRange<float> Rng(float min, float max) { return new AcceptableValueRange<float>(min, max); } private Dictionary<ConfigDefinition, string> GetOrphanedEntries() { try { PropertyInfo property = typeof(ConfigFile).GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property == null) { return null; } return property.GetValue(((BaseUnityPlugin)this).Config, null) as Dictionary<ConfigDefinition, string>; } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[Cinecam] Could not read orphaned config entries, old settings will not be migrated: " + ex.Message)); return null; } } private void ApplyConfigMigrations() { Dictionary<ConfigDefinition, string> orphanedEntries = GetOrphanedEntries(); if (orphanedEntries == null) { BackupConfigBeforeMigration(); } else { if (orphanedEntries.Count == 0) { return; } int num = 0; bool flag = false; ConfigRename[] configRenames = ConfigRenames; foreach (ConfigRename configRename in configRenames) { if (!orphanedEntries.TryGetValue(configRename.From, out var value)) { continue; } if (!flag) { BackupConfigBeforeMigration(); flag = true; } orphanedEntries.Remove(configRename.From); if (!orphanedEntries.ContainsKey(configRename.To)) { try { orphanedEntries[configRename.To] = ((configRename.Convert != null) ? configRename.Convert(value) : value); num++; } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[Cinecam] Could not convert old value '" + value + "' for '" + configRename.From.Section + "/" + configRename.From.Key + "': " + ex.Message)); } } } if (num > 0) { ((BaseUnityPlugin)this).Logger.LogInfo((object)$"[Cinecam] Migrated {num} setting(s) from an older config layout."); } } } private void BackupConfigBeforeMigration() { try { string configFilePath = ((BaseUnityPlugin)this).Config.ConfigFilePath; string text = configFilePath + ".before-" + ((BaseUnityPlugin)this).Info.Metadata.Version?.ToString() + ".bak"; if (File.Exists(configFilePath) && !File.Exists(text)) { File.Copy(configFilePath, text); ((BaseUnityPlugin)this).Logger.LogInfo((object)("[Cinecam] Backed up your old config to " + text)); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[Cinecam] Could not back up old config: " + ex.Message)); } } private void ValidateConfigMigrations() { ConfigRename[] configRenames = ConfigRenames; foreach (ConfigRename configRename in configRenames) { if (((BaseUnityPlugin)this).Config.ContainsKey(configRename.From)) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[Cinecam] Config migration: retired name '" + configRename.From.Section + "/" + configRename.From.Key + "' is bound again. Never reuse retired names.")); } bool flag = false; ConfigRename[] configRenames2 = ConfigRenames; for (int j = 0; j < configRenames2.Length; j++) { if (configRenames2[j].From.Equals(configRename.To)) { flag = true; break; } } if (!flag && !((BaseUnityPlugin)this).Config.ContainsKey(configRename.To)) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[Cinecam] Config migration: '" + configRename.From.Section + "/" + configRename.From.Key + "' -> '" + configRename.To.Section + "/" + configRename.To.Key + "' but nothing is bound there (typo, or setting removed?).")); } } } private ConfigEntry<T> Bind<T>(string section, string key, T defaultValue, string description, AcceptableValueBase accept = null, bool advanced = false, Action<ConfigEntryBase> customDrawer = null) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0066: Expected O, but got Unknown ConfigurationManagerAttributes configurationManagerAttributes = new ConfigurationManagerAttributes { IsAdvanced = advanced, Order = m_cfgOrder--, CustomDrawer = customDrawer }; return ((BaseUnityPlugin)this).Config.Bind<T>(new ConfigDefinition(section, key), defaultValue, new ConfigDescription(description ?? "", accept, new object[1] { configurationManagerAttributes })); } private void Awake() { bool saveOnConfigSet = ((BaseUnityPlugin)this).Config.SaveOnConfigSet; ((BaseUnityPlugin)this).Config.SaveOnConfigSet = false; try { ApplyConfigMigrations(); BindAllSettings(); ValidateConfigMigrations(); } finally { ((BaseUnityPlugin)this).Config.SaveOnConfigSet = saveOnConfigSet; } ((BaseUnityPlugin)this).Config.Save(); presetDropdown.SettingChanged += delegate { if (presetDropdown.Value != "None") { LoadPresetFromJSON(presetDropdown.Value); } }; SceneManager.sceneLoaded += OnSceneLoaded; } private void BindAllSettings() { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) presetDropdown = Bind("01. Presets & Quick Toggles", "Load Preset", "None", "Click a preset to apply it instantly. 'None' leaves your settings as they are. Click the highlighted one again to re-apply it.", null, advanced: false, DrawPresetList); presetSaveName = Bind("01. Presets & Quick Toggles", "Save Preset As", "MyNewPreset", "Name of the file to save."); savePresetBtn = Bind("01. Presets & Quick Toggles", "Save Now", defaultValue: false, "Tick this box to export your current settings to a preset file."); presetStatus = Bind("01. Presets & Quick Toggles", "Status", "Idle", "Shows the result of your last save/load action."); globalPPBypass = Bind("01. Presets & Quick Toggles", "Disable All Visual Overrides", defaultValue: false, "Completely disables every visual effect from this mod and leaves the game's default visuals untouched."); toggleCamKey = Bind<KeyboardShortcut>("02. Hotkeys", "Toggle Free Camera", new KeyboardShortcut((KeyCode)96, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "Enter or leave the free camera."); autoCinematicKey = Bind<KeyboardShortcut>("02. Hotkeys", "Toggle Director Mode", new KeyboardShortcut((KeyCode)120, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "Enter or leave Director Mode."); forceCutKey = Bind<KeyboardShortcut>("02. Hotkeys", "Force Director Cut", new KeyboardShortcut((KeyCode)99, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "Immediately cut to a new director shot."); toggleHudKey = Bind<KeyboardShortcut>("02. Hotkeys", "Toggle HUD", new KeyboardShortcut((KeyCode)291, Array.Empty<KeyCode>()), "Show or hide the game's HUD."); spectateNextKey = Bind<KeyboardShortcut>("02. Hotkeys", "Spectate Next Player", new KeyboardShortcut((KeyCode)93, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "Switches the camera to the next player (works while alive or dead)."); spectatePrevKey = Bind<KeyboardShortcut>("02. Hotkeys", "Spectate Previous Player", new KeyboardShortcut((KeyCode)91, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), "Switches the camera to the previous player (works while alive or dead)."); aimTeleportKey = Bind<KeyboardShortcut>("02. Hotkeys", "Aim Teleport", KeyboardShortcut.Empty, "Hold to aim, release to place the camera where you're pointing. Unbound by default."); freezeCamKey = Bind<KeyboardShortcut>("02. Hotkeys", "Freeze Camera", KeyboardShortcut.Empty, "Freezes the free camera in place so you can control your character. Unbound by default."); hideHudInFreecam = Bind("03. Free Camera", "Auto-Hide HUD", defaultValue: true, "Hides the HUD while the free camera is active."); freecamAutofocusRange = Bind("03. Free Camera", "Autofocus Range", 50f, "How far (in metres) the free camera looks for something to focus on. Requires 'Enable DoF in Free/Director Cam' in Visuals: Depth of Field.", (AcceptableValueBase)(object)Rng(5f, 300f)); freecamPreferCharacters = Bind("03. Free Camera", "Focus On Characters", defaultValue: true, "Like a camera's face detection: if a character is near the centre of the frame (and not hidden behind something), focus locks onto them and follows them. Turn off to focus only on whatever is under the crosshair."); freecamSharpZone = Bind("03. Free Camera", "Minimum Sharp Zone", 0.2f, "Guarantees the depth of the sharp area is at least this fraction of the focus distance, by stopping the aperture down only as much as needed. 0.2 means a subject 5 m away is sharp from about 4.5 m to 5.5 m. 0 = off (use the raw aperture, razor-thin focus up close).", (AcceptableValueBase)(object)Rng(0f, 1f)); freecamFocusPullTime = Bind("03. Free Camera", "Focus Pull Time", 0.35f, "Seconds taken to shift focus onto a new subject. Higher = slower, softer rack focus.", (AcceptableValueBase)(object)Rng(0.05f, 3f)); freecamFarPullTime = Bind("03. Free Camera", "Far Focus Pull Time", 1.5f, "Seconds taken to ease out to far focus when nothing is in range. Higher = gentler.", (AcceptableValueBase)(object)Rng(0.1f, 6f)); freecamLostSubjectDelay = Bind("03. Free Camera", "Lost Subject Delay", 0.5f, "How long focus holds on the last subject after it leaves the autofocus area, before easing out to far focus. Stops focus from flickering when something briefly drops out of view.", (AcceptableValueBase)(object)Rng(0f, 3f), advanced: true); freecamFarFocusDistance = Bind("03. Free Camera", "Far Focus Distance", 150f, "When nothing is within Autofocus Range, focus is set this far away (like focusing at infinity).", (AcceptableValueBase)(object)Rng(20f, 1000f), advanced: true); freecamFarFocusAperture = Bind("03. Free Camera", "Far Focus Aperture", 32f, "Aperture used when nothing is in range. Higher f-number = sharper background. 32 keeps everything in focus.", (AcceptableValueBase)(object)Rng(1f, 32f), advanced: true); enableCombatActionCam = Bind("04. Director Mode", "Combat Action Cam", defaultValue: true, "Switches to a playable over-the-shoulder camera when you're locked onto an enemy."); directorSwitchTime = Bind("04. Director Mode", "Auto-Switch Time", 10f, "Seconds between automatic camera cuts.", (AcceptableValueBase)(object)Rng(2f, 30f)); directorDynamicFOV = Bind("04. Director Mode", "Dynamic FOV", defaultValue: true, "Zooms in and out depending on how far the camera is from the character."); enableLetterboxing = Bind("04. Director Mode", "Letterboxing (2.35:1)", defaultValue: false, "Adds cinematic black bars to the top and bottom of the screen during Director Mode."); enableCameraShake = Bind("04. Director Mode", "Handheld Shake", defaultValue: false, "Adds subtle procedural shake for a documentary feel. Tune it under Fine Tuning."); hideHudInCinematic = Bind("04. Director Mode", "Hide HUD", defaultValue: false, "Hides the HUD while Director Mode is active."); syncCharacterHeading = Bind("04. Director Mode", "Sync Movement to Screen", defaultValue: true, "Aligns character movement inputs with the cinematic camera view when you stand still."); headingIndicatorSize = Bind("04. Director Mode", "Heading Indicator Size", 1f, "Draws a subtle golden pointer in front of you. Set to 0 to disable, or increase to make it larger.", (AcceptableValueBase)(object)Rng(0f, 3f)); occlusionCutTime = Bind("05. Director Mode: Fine Tuning", "Occlusion Cut Timer", 0.3f, "Seconds the character can be blocked or off-screen before the camera cuts.", (AcceptableValueBase)(object)Rng(0.1f, 5f)); gimbalSmoothing = Bind("05. Director Mode: Fine Tuning", "Gimbal Rotation Smoothing", 3f, "Lower = heavier/slower camera rotation.", (AcceptableValueBase)(object)Rng(0.5f, 15f), advanced: true); trackingSpeed = Bind("05. Director Mode: Fine Tuning", "Chase Tracking Speed", 3f, "How fast the chase camera catches up with the character.", (AcceptableValueBase)(object)Rng(0.5f, 15f), advanced: true); shakeIntensity = Bind("05. Director Mode: Fine Tuning", "Shake Intensity", 0.2f, "", (AcceptableValueBase)(object)Rng(0.1f, 3f)); shakeSpeed = Bind("05. Director Mode: Fine Tuning", "Shake Speed", 1.5f, "", (AcceptableValueBase)(object)Rng(0.1f, 5f)); dirMinHeight = Bind("05. Director Mode: Fine Tuning", "Min Spawn Height", 0.5f, "", (AcceptableValueBase)(object)Rng(-2f, 10f), advanced: true); dirMaxHeight = Bind("05. Director Mode: Fine Tuning", "Max Spawn Height", 8f, "", (AcceptableValueBase)(object)Rng(0f, 15f), advanced: true); dirMinDistPlace = Bind("05. Director Mode: Fine Tuning", "Min Spawn Radius", 5f, "", (AcceptableValueBase)(object)Rng(2f, 25f), advanced: true); dirMaxDistPlace = Bind("05. Director Mode: Fine Tuning", "Max Spawn Radius", 20f, "", (AcceptableValueBase)(object)Rng(5f, 40f), advanced: true); dirMinFov = Bind("05. Director Mode: Fine Tuning", "Min FOV (Tightest Zoom)", 25f, "", (AcceptableValueBase)(object)Rng(5f, 60f)); dirMaxFov = Bind("05. Director Mode: Fine Tuning", "Max FOV (Widest Zoom)", 75f, "", (AcceptableValueBase)(object)Rng(40f, 120f)); dirZoomAggression = Bind("05. Director Mode: Fine Tuning", "Zoom Aggression", 1f, "", (AcceptableValueBase)(object)Rng(0.1f, 5f)); weightStatic = Bind("05. Director Mode: Fine Tuning", "Shot Weight: Locked Static", 25, "0 = Disabled. Higher number = appears more often.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100)); weightTripod = Bind("05. Director Mode: Fine Tuning", "Shot Weight: Tripod Pan", 25, "0 = Disabled. Higher number = appears more often.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100)); weightChase = Bind("05. Director Mode: Fine Tuning", "Shot Weight: Chase Cam", 25, "0 = Disabled. Higher number = appears more often.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100)); weightSlider = Bind("05. Director Mode: Fine Tuning", "Shot Weight: Slider Track", 25, "0 = Disabled. Higher number = appears more often.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100)); enableDofNormalPlay = Bind("06. Visuals: Depth of Field", "Enable DoF in Normal Play", defaultValue: false, "Background blur while playing normally."); dofNormalAperture = Bind("06. Visuals: Depth of Field", "Normal Play Aperture", 4f, "Lower = more blur.", (AcceptableValueBase)(object)Rng(0.1f, 16f)); dofNormalFocalLength = Bind("06. Visuals: Depth of Field", "Normal Play Focal Length", 35f, "", (AcceptableValueBase)(object)Rng(10f, 150f)); dofNormalOffset = Bind("06. Visuals: Depth of Field", "Normal Play Focus Offset", 0f, "Nudge the focal plane forward/backward if your character is slightly blurry.", (AcceptableValueBase)(object)Rng(-3f, 3f), advanced: true); enableDofDirector = Bind("06. Visuals: Depth of Field", "Enable DoF in Free/Director Cam", defaultValue: true, "Background blur and autofocus while the free camera or Director Mode is active."); dofCineAperture = Bind("06. Visuals: Depth of Field", "Free/Director Cam Aperture", 2f, "Lower = more blur.", (AcceptableValueBase)(object)Rng(0.1f, 16f)); dofCineFocalLength = Bind("06. Visuals: Depth of Field", "Free/Director Cam Focal Length", 50f, "", (AcceptableValueBase)(object)Rng(10f, 150f)); enableColorGrading = Bind("07. Visuals: Color Grading", "Enable Color Grading", defaultValue: false, ""); cgTemperature = Bind("07. Visuals: Color Grading", "Temperature", 0f, "-100 (Blue) to 100 (Orange)", (AcceptableValueBase)(object)Rng(-100f, 100f)); cgTint = Bind("07. Visuals: Color Grading", "Tint", 0f, "-100 (Green) to 100 (Magenta)", (AcceptableValueBase)(object)Rng(-100f, 100f)); cgPostExposure = Bind("07. Visuals: Color Grading", "Post Exposure", 0f, "EV adjustment", (AcceptableValueBase)(object)Rng(-5f, 5f)); cgSaturation = Bind("07. Visuals: Color Grading", "Saturation", 0f, "-100 (B&W) to 100 (Vibrant)", (AcceptableValueBase)(object)Rng(-100f, 100f)); cgContrast = Bind("07. Visuals: Color Grading", "Contrast", 0f, "-100 (Flat) to 100 (Harsh)", (AcceptableValueBase)(object)Rng(-100f, 100f)); enableBloom = Bind("08. Visuals: Lens Effects", "Enable Bloom", defaultValue: false, ""); bloomIntensity = Bind("08. Visuals: Lens Effects", "Bloom Intensity", 1.5f, "", (AcceptableValueBase)(object)Rng(0f, 10f)); bloomThreshold = Bind("08. Visuals: Lens Effects", "Bloom Threshold", 1f, "Lower = more glow", (AcceptableValueBase)(object)Rng(0f, 5f)); enableVignette = Bind("08. Visuals: Lens Effects", "Enable Vignette", defaultValue: false, ""); vignetteIntensity = Bind("08. Visuals: Lens Effects", "Vignette Intensity", 0.35f, "", (AcceptableValueBase)(object)Rng(0f, 1f)); vignetteSmoothness = Bind("08. Visuals: Lens Effects", "Vignette Smoothness", 0.2f, "", (AcceptableValueBase)(object)Rng(0f, 1f)); enableChromatic = Bind("08. Visuals: Lens Effects", "Enable Chromatic Aberration", defaultValue: false, ""); chromaticIntensity = Bind("08. Visuals: Lens Effects", "Chromatic Intensity", 0.2f, "", (AcceptableValueBase)(object)Rng(0f, 1f)); enableGrain = Bind("08. Visuals: Lens Effects", "Enable Film Grain", defaultValue: false, ""); grainIntensity = Bind("08. Visuals: Lens Effects", "Grain Intensity", 0.2f, "", (AcceptableValueBase)(object)Rng(0f, 1f)); grainSize = Bind("08. Visuals: Lens Effects", "Grain Size", 1f, "", (AcceptableValueBase)(object)Rng(0.3f, 3f)); aaMode = Bind<Antialiasing>("09. Visuals: Quality", "AA Method", (Antialiasing)0, "SMAA is sharp, TAA is smooth/cinematic, FXAA is fast. Applies to the free/director camera. In normal play, 'None' leaves the game's own AA untouched; any other choice overrides it."); enableAO = Bind("09. Visuals: Quality", "Enable Ambient Occlusion", defaultValue: false, "Adds soft shadows into corners and crevices."); aoIntensity = Bind("09. Visuals: Quality", "AO Intensity", 1f, "", (AcceptableValueBase)(object)Rng(0f, 4f)); enableSSR = Bind("09. Visuals: Quality", "Enable SSR", defaultValue: false, "High performance impact. Adds real-time wet surface reflections."); ssrQuality = Bind<ScreenSpaceReflectionPreset>("09. Visuals: Quality", "SSR Quality", (ScreenSpaceReflectionPreset)2, "Higher settings drastically impact framerate. (Note: 'Custom' defaults to High)"); logLoadTiming = Bind("10. Debug", "Log Load Timing", defaultValue: false, "Logs scene loads, camera setup, camera switching and HUD show/hide timings to the BepInEx log, to help track down long loads and freezes.", null, advanced: true); } private void Start() { InitCamera(); CreateLetterboxUI(); Instance = this; } private static bool PickNearestWorldHit(int count, out RaycastHit result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) result = default(RaycastHit); float num = float.MaxValue; bool result2 = false; for (int i = 0; i < count; i++) { RaycastHit val = s_hitBuffer[i]; if (!((Object)(object)((RaycastHit)(ref val)).collider == (Object)null) && !((Object)(object)((Component)((RaycastHit)(ref val)).collider).GetComponentInParent<Character>() != (Object)null) && ((RaycastHit)(ref val)).distance < num) { num = ((RaycastHit)(ref val)).distance; result = val; result2 = true; } } return result2; } private static bool TryRaycastWorld(Vector3 from, Vector3 to, out RaycastHit result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) result = default(RaycastHit); Vector3 val = to - from; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.001f) { return false; } return PickNearestWorldHit(Physics.RaycastNonAlloc(from, val / magnitude, s_hitBuffer, magnitude, -5, (QueryTriggerInteraction)1), out result); } private static bool TrySphereCastWorld(Vector3 origin, float radius, Vector3 direction, float distance, out RaycastHit result) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) result = default(RaycastHit); if (distance < 0.001f || ((Vector3)(ref direction)).sqrMagnitude < 0.0001f) { return false; } return PickNearestWorldHit(Physics.SphereCastNonAlloc(origin, radius, ((Vector3)(ref direction)).normalized, s_hitBuffer, distance, -5, (QueryTriggerInteraction)1), out result); } private static bool TryGetAimPoint(Camera gameCam, out RaycastHit result) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) Ray val = gameCam.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0f)); return TryRaycastWorld(((Ray)(ref val)).origin, ((Ray)(ref val)).origin + ((Ray)(ref val)).direction * gameCam.farClipPlane, out result); } private static bool TryLookRotation(Vector3 delta, out Quaternion rotation) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (((Vector3)(ref delta)).sqrMagnitude > 0.0001f) { rotation = Quaternion.LookRotation(delta); return true; } rotation = Quaternion.identity; return false; } private void CaptureKeyboardFromPlayer() { if (m_previousMouseOwner != -1 && !m_keyboardDisabled) { ControlsInput.DisableKeyboardControl(m_previousMouseOwner); m_keyboardDisabled = true; } } private void ReleaseKeyboardToPlayer(bool force = false) { if (m_previousMouseOwner != -1 && (m_keyboardDisabled || force)) { ControlsInput.AssignMouseKeyboardToPlayer(m_previousMouseOwner); m_keyboardDisabled = false; } } private void TrySpectate(int direction) { if (CanActivateCamera && CycleSpectatorTarget(direction)) { m_isDirectorActive = true; DropCinematicCamera(); } } private bool CycleSpectatorTarget(int direction) { if ((Object)(object)CharacterManager.Instance == (Object)null || CharacterManager.Instance.Characters == null) { return false; } m_activePlayers = CharacterManager.Instance.Characters.Values.Where((Character c) => (Object)(object)c != (Object)null && !c.IsAI).ToList(); if (m_activePlayers.Count <= 1) { return false; } int num = m_activePlayers.IndexOf(m_cameraTarget); if (num == -1) { num = m_activePlayers.IndexOf(m_localPlayer); } num += direction; if (num >= m_activePlayers.Count) { num = 0; } else if (num < 0) { num = m_activePlayers.Count - 1; } m_cameraTarget = m_activePlayers[num]; return true; } private void CreateLetterboxUI() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)m_letterboxCanvas != (Object)null) { Object.Destroy((Object)(object)m_letterboxCanvas); } m_letterboxCanvas = new GameObject("CinecamLetterbox"); Object.DontDestroyOnLoad((Object)(object)m_letterboxCanvas); Canvas obj = m_letterboxCanvas.AddComponent<Canvas>(); obj.renderMode = (RenderMode)0; obj.sortingOrder = 9999; CanvasScaler obj2 = m_letterboxCanvas.AddComponent<CanvasScaler>(); obj2.uiScaleMode = (ScaleMode)1; obj2.referenceResolution = new Vector2(1920f, 1080f); obj2.matchWidthOrHeight = 0.5f; float num = 130f; GameObject val = new GameObject("TopBar"); val.transform.SetParent(m_letterboxCanvas.transform, false); ((Graphic)val.AddComponent<Image>()).color = Color.black; RectTransform component = val.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(0.5f, 1f); component.sizeDelta = new Vector2(0f, num); component.anchoredPosition = Vector2.zero; GameObject val2 = new GameObject("BotBar"); val2.transform.SetParent(m_letterboxCanvas.transform, false); ((Graphic)val2.AddComponent<Image>()).color = Color.black; RectTransform component2 = val2.GetComponent<RectTransform>(); component2.anchorMin = new Vector2(0f, 0f); component2.anchorMax = new Vector2(1f, 0f); component2.pivot = new Vector2(0.5f, 0f); component2.sizeDelta = new Vector2(0f, num); component2.anchoredPosition = Vector2.zero; m_letterboxCanvas.SetActive(false); } private void DeactivateOldCamera() { if ((Object)(object)m_camera != (Object)null) { ((Behaviour)m_camera).enabled = false; ((Component)m_camera).gameObject.SetActive(false); } } private void InitCamera() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) m_initPending = false; m_cameraReady = false; m_active = false; m_isDirectorActive = false; m_isFrozen = false; m_lastShake = Quaternion.identity; ReleaseKeyboardToPlayer(); if ((Object)(object)m_letterboxCanvas == (Object)null) { CreateLetterboxUI(); } Camera mainCamera = Global.MainCamera; if ((Object)(object)mainCamera == (Object)null) { DeactivateOldCamera(); return; } Stopwatch stopwatch = (logLoadTiming.Value ? Stopwatch.StartNew() : null); mainCamera.depthTextureMode = (DepthTextureMode)(mainCamera.depthTextureMode | 1); m_originalFov = mainCamera.fieldOfView; PostProcessLayer component = ((Component)mainCamera).GetComponent<PostProcessLayer>(); if ((Object)(object)component != (Object)null) { component.volumeLayer = LayerMask.op_Implicit(LayerMask.op_Implicit(component.volumeLayer) | (1 << ((Component)mainCamera).gameObject.layer)); if ((Object)(object)component != (Object)(object)m_mainPpLayer) { m_mainOriginalAA = component.antialiasingMode; } } m_mainPpLayer = component; if ((Object)(object)m_dofVolumeObj == (Object)null) { GameObject val = new GameObject("CinecamGlobalVolume"); val.transform.SetParent(((Component)this).transform, false); PostProcessVolume obj = val.AddComponent<PostProcessVolume>(); obj.isGlobal = true; obj.priority = 9999f; PostProcessProfile val2 = (obj.profile = ScriptableObject.CreateInstance<PostProcessProfile>()); m_dofVolumeObj = val; m_profile = val2; m_dof = val2.AddSettings<DepthOfField>(); ((PostProcessEffectSettings)m_dof).active = true; ((ParameterOverride)m_dof.focusDistance).overrideState = true; ((ParameterOverride)m_dof.aperture).overrideState = true; ((ParameterOverride)m_dof.focalLength).overrideState = true; m_bloom = val2.AddSettings<Bloom>(); ((PostProcessEffectSettings)m_bloom).active = false; ((ParameterOverride)m_bloom.intensity).overrideState = true; ((ParameterOverride)m_bloom.threshold).overrideState = true; ((ParameterOverride)m_bloom.fastMode).overrideState = true; ((ParameterOverride<bool>)(object)m_bloom.fastMode).value = false; m_colorGrading = val2.AddSettings<ColorGrading>(); ((PostProcessEffectSettings)m_colorGrading).active = false; ((ParameterOverride)m_colorGrading.temperature).overrideState = true; ((ParameterOverride)m_colorGrading.tint).overrideState = true; ((ParameterOverride)m_colorGrading.postExposure).overrideState = true; ((ParameterOverride)m_colorGrading.saturation).overrideState = true; ((ParameterOverride)m_colorGrading.contrast).overrideState = true; m_vignette = val2.AddSettings<Vignette>(); ((PostProcessEffectSettings)m_vignette).active = false; ((ParameterOverride)m_vignette.intensity).overrideState = true; ((ParameterOverride)m_vignette.smoothness).overrideState = true; m_chromatic = val2.AddSettings<ChromaticAberration>(); ((PostProcessEffectSettings)m_chromatic).active = false; ((ParameterOverride)m_chromatic.intensity).overrideState = true; m_grain = val2.AddSettings<Grain>(); ((PostProcessEffectSettings)m_grain).active = false; ((ParameterOverride)m_grain.intensity).overrideState = true; ((ParameterOverride)m_grain.size).overrideState = true; m_ao = val2.AddSettings<AmbientOcclusion>(); ((PostProcessEffectSettings)m_ao).active = false; ((ParameterOverride)m_ao.intensity).overrideState = true; m_ssr = val2.AddSettings<ScreenSpaceReflections>(); ((PostProcessEffectSettings)m_ssr).active = false; ((ParameterOverride)m_ssr.preset).overrideState = true; } m_dofVolumeObj.layer = ((Component)mainCamera).gameObject.layer; m_sourceCamera = mainCamera; m_cameraReady = true; if (stopwatch != null) { ((BaseUnityPlugin)this).Logger.LogInfo((object)$"[Cinecam] InitCamera: base hooks ready ({stopwatch.ElapsedMilliseconds} ms)"); } } private void BuildCinematicCamera() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown if (!((Object)(object)m_camera != (Object)null) && !((Object)(object)m_sourceCamera == (Object)null)) { GameObject val = new GameObject("CinecamCloneHolder"); val.SetActive(false); m_camera = Object.Instantiate<Camera>(m_sourceCamera, val.transform); ((Component)m_camera).gameObject.SetActive(false); m_ppLayer = ((Component)m_camera).GetComponent<PostProcessLayer>(); CameraShaker component = ((Component)m_camera).GetComponent<CameraShaker>(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } CharacterCamera component2 = ((Component)m_camera).GetComponent<CharacterCamera>(); if ((Object)(object)component2 != (Object)null) { Object.DestroyImmediate((Object)(object)component2); } PostProcessVolume[] components = ((Component)m_camera).GetComponents<PostProcessVolume>(); for (int i = 0; i < components.Length; i++) { Object.DestroyImmediate((Object)(object)components[i]); } CinemaCameraTrans = ((Component)m_camera).transform; ((Component)m_camera).transform.parent = ((Component)this).transform; UnityEngineExtensions.ResetLocal(((Component)m_camera).transform, true); Object.Destroy((Object)(object)val); } } private void UpdateHeadingIndicator() { //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) if (headingIndicatorSize.Value <= 0.01f || !m_active || !m_isDirectorActive || (Object)(object)m_localPlayer == (Object)null || m_localPlayer.IsDead) { if ((Object)(object)m_headingIndicator != (Object)null && m_headingIndicator.activeSelf) { m_headingIndicator.SetActive(false); } return; } if ((Object)(object)m_headingIndicator == (Object)null) { m_headingIndicator = GameObject.CreatePrimitive((PrimitiveType)3); Object.Destroy((Object)(object)m_headingIndicator.GetComponent<Collider>()); Renderer component = m_headingIndicator.GetComponent<Renderer>(); component.material.color = new Color(1f, 0.8f, 0.2f, 0.8f); component.shadowCastingMode = (ShadowCastingMode)0; component.receiveShadows = false; Object.DontDestroyOnLoad((Object)(object)m_headingIndicator); } m_headingIndicator.SetActive(true); float value = headingIndicatorSize.Value; m_headingIndicator.transform.localScale = new Vector3(0.08f * value, 0.02f, 0.6f * value); Vector3 val = Vector3.forward; val = ((!((Object)(object)m_localPlayer.CharacterCamera != (Object)null)) ? ((Component)m_localPlayer).transform.forward : ((Component)m_localPlayer.CharacterCamera).transform.forward); val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude > 0.001f) { ((Vector3)(ref val)).Normalize(); } else { val = Vector3.forward; } float num = 0.4f + 0.4f * value; m_headingIndicator.transform.position = ((Component)m_localPlayer).transform.position + Vector3.up * 0.1f + val * num; m_headingIndicator.transform.forward = val; } private void Update() { //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Invalid comparison between Unknown and I4 //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_0635: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) if (savePresetBtn.Value) { savePresetBtn.Value = false; SavePresetToJSON(); } UpdatePostProcessing(); if (!m_cameraReady && !m_initPending && Time.unscaledTime >= m_nextInitAttempt) { m_nextInitAttempt = Time.unscaledTime + 1f; if ((Object)(object)Global.MainCamera != (Object)null) { InitCamera(); } } if ((Object)(object)m_letterboxCanvas != (Object)null) { m_letterboxCanvas.SetActive(m_isDirectorActive && enableLetterboxing.Value); } if ((Object)(object)m_localPlayer == (Object)null && (Object)(object)Global.Lobby != (Object)null) { PlayerSystem localPlayer = Global.Lobby.GetLocalPlayer(0); if ((Object)(object)localPlayer != (Object)null) { m_localPlayer = localPlayer.ControlledCharacter; if ((Object)(object)m_localPlayer != (Object)null) { m_cameraTarget = m_localPlayer; m_lastPlayerPos = ((Component)m_localPlayer).transform.position; } } } if ((Object)(object)m_cameraTarget == (Object)null && (Object)(object)m_localPlayer != (Object)null) { m_cameraTarget = m_localPlayer; if (m_isDirectorActive && HasCamera) { DropCinematicCamera(); } } bool flag = (Object)(object)m_localPlayer != (Object)null && m_localPlayer.IsDead; if (m_wasDead && !flag && (Object)(object)m_cameraTarget != (Object)(object)m_localPlayer) { m_cameraTarget = m_localPlayer; if (m_isDirectorActive && HasCamera) { DropCinematicCamera(); } } m_wasDead = flag; KeyboardShortcut value = spectateNextKey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { TrySpectate(1); } else { value = spectatePrevKey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { TrySpectate(-1); } } if (Input.GetKeyDown((KeyCode)27) && m_active && m_cursorWasLockedLastFrame) { if (m_isDirectorActive) { m_escPauseCheckTimer = 0.5f; } else { SetCameraActive(_active: false); } } if (m_escPauseCheckTimer > 0f) { m_escPauseCheckTimer -= Time.unscaledDeltaTime; if (!m_active || !m_isDirectorActive) { m_escPauseCheckTimer = 0f; } else if ((int)Cursor.lockState != 1) { m_escPauseCheckTimer = 0f; m_isDirectorActive = false; SetCameraActive(_active: false); } } value = toggleCamKey.Value; if (((KeyboardShortcut)(ref value)).IsDown() && (m_active || CanActivateCamera)) { if (m_active) { m_isDirectorActive = false; } SetCameraActive(!m_active); } value = autoCinematicKey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { if (m_isDirectorActive) { m_isDirectorActive = false; SetCameraActive(_active: false); } else { m_isDirectorActive = true; m_directorTimer = 0f; m_occlusionTimer = 0f; DropCinematicCamera(); } } if (m_pendingDirectorRestore && m_cameraReady && (Object)(object)m_cameraTarget != (Object)null) { m_pendingDirectorRestore = false; m_isDirectorActive = true; m_directorTimer = 0f; m_occlusionTimer = 0f; DropCinematicCamera(); } if (m_isDirectorActive && HasCamera && (Object)(object)m_cameraTarget != (Object)null) { bool flag2 = (Object)(object)m_cameraTarget.TargetingSystem != (Object)null && (Object)(object)m_cameraTarget.TargetingSystem.LockedCharacter != (Object)null; if (enableCombatActionCam.Value) { if (flag2) { m_actionCamExitTimer = 0f; m_occlusionTimer = 0f; if (m_currentShotType != DirectorShotType.ActionCam) { m_currentShotType = DirectorShotType.ActionCam; m_chaseCurrentVel = Vector3.zero; SnapToActionCam(); } } else if (m_currentShotType == DirectorShotType.ActionCam) { m_actionCamExitTimer += Time.deltaTime; if (IsTargetObstructed()) { m_occlusionTimer += Time.deltaTime; } else { m_occlusionTimer = 0f; } if (!(m_actionCamExitTimer >= 2f) && !(m_occlusionTimer > occlusionCutTime.Value)) { value = forceCutKey.Value; if (!((KeyboardShortcut)(ref value)).IsDown()) { goto IL_0483; } } DropCinematicCamera(); } } else if (m_currentShotType == DirectorShotType.ActionCam) { DropCinematicCamera(); } goto IL_0483; } goto IL_0600; IL_0600: value = aimTeleportKey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { isCasting = true; } if (isCasting) { PrepareCamCast(); } value = toggleHudKey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { m_hudManuallyHidden = !m_hudManuallyHidden; } bool uIVisible = !m_hudManuallyHidden; if (m_active) { if (m_isDirectorActive && hideHudInCinematic.Value) { uIVisible = false; } if (!m_isDirectorActive && hideHudInFreecam.Value) { uIVisible = false; } } SetUIVisible(uIVisible); UpdateHeadingIndicator(); return; IL_0483: if (m_currentShotType != DirectorShotType.ActionCam) { if (IsTargetObstructed()) { m_occlusionTimer += Time.deltaTime; } else { m_occlusionTimer = 0f; } value = forceCutKey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { DropCinematicCamera(); } else { m_directorTimer += Time.deltaTime; float num = Vector3.Distance(((Component)m_camera).transform.position, ((Component)m_cameraTarget).transform.position); float num2 = Mathf.Max(dirMinDistPlace.Value, dirMaxDistPlace.Value) + 5f; if (m_directorTimer >= directorSwitchTime.Value || num >= num2 || m_occlusionTimer > occlusionCutTime.Value) { DropCinematicCamera(); } } } if (m_currentShotType == DirectorShotType.ActionCam) { m_camera.fieldOfView = Mathf.Lerp(m_camera.fieldOfView, 65f, Time.deltaTime * 2f); } else if (directorDynamicFOV.Value) { float distToPlayer = Vector3.Distance(((Component)m_camera).transform.position, ((Component)m_cameraTarget).transform.position); float num3 = ComputeDirectorFov(distToPlayer); m_camera.fieldOfView = Mathf.Lerp(m_camera.fieldOfView, num3, Time.deltaTime * 2f); } goto IL_0600; } private void LateUpdate() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Invalid comparison between Unknown and I4 //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05b7: Unknown result type (might be due to invalid IL or missing references) //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_062c: Unknown result type (might be due to invalid IL or missing references) m_cursorWasLockedLastFrame = (int)Cursor.lockState == 1; if (!m_active || !HasCamera) { return; } Transform cinemaCameraTrans = CinemaCameraTrans; cinemaCameraTrans.rotation *= Quaternion.Inverse(m_lastShake); m_lastShake = Quaternion.identity; if (m_isFrozen && syncCharacterHeading.Value && (Object)(object)m_cameraTarget == (Object)(object)m_localPlayer && (Object)(object)m_localPlayer != (Object)null && (Object)(object)m_localPlayer.CharacterCamera != (Object)null) { if (Vector3.Distance(((Component)m_localPlayer).transform.position, m_lastPlayerPos) / Mathf.Max(Time.deltaTime, 0.0001f) > 0.5f) { m_needsHeadingSync = true; } else if (m_needsHeadingSync) { Vector3 forward = CinemaCameraTrans.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude > 0.001f) { Vector3 normalized = ((Vector3)(ref forward)).normalized; ((Component)m_localPlayer.CharacterCamera).transform.forward = Vector3.Lerp(((Component)m_localPlayer.CharacterCamera).transform.forward, normalized, Time.deltaTime * 15f); if (Vector3.Angle(((Component)m_localPlayer.CharacterCamera).transform.forward, normalized) < 1f || Mathf.Abs(Input.GetAxis("Mouse X")) > 0.3f || Mathf.Abs(Input.GetAxis("Mouse Y")) > 0.3f) { m_needsHeadingSync = false; } } } } if ((Object)(object)m_localPlayer != (Object)null) { m_lastPlayerPos = ((Component)m_localPlayer).transform.position; } if (m_isDirectorActive && (Object)(object)m_cameraTarget != (Object)null) { if (m_currentShotType == DirectorShotType.Chase) { Vector3 position = ((Component)m_cameraTarget).transform.position; Vector3 val = position + m_chaseWorldOffset; if (val.y < position.y + 0.5f) { val.y = position.y + 0.5f; } Vector3 position2 = CinemaCameraTrans.position; Vector3 val2 = val - position2; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude > 0.01f && TrySphereCastWorld(position2, 0.4f, val2 / magnitude, magnitude, out var result)) { val = position2 + val2 / magnitude * ((RaycastHit)(ref result)).distance; } CinemaCameraTrans.position = Vector3.SmoothDamp(CinemaCameraTrans.position, val, ref m_chaseCurrentVel, 1f / trackingSpeed.Value); } else if (m_currentShotType == DirectorShotType.Slider) { Vector3 val3 = m_sliderDirection * m_sliderSpeed; if (TrySphereCastWorld(CinemaCameraTrans.position, 0.6f, m_sliderDirection, ((Vector3)(ref val3)).magnitude * Time.deltaTime + 0.5f, out var result2)) { Vector3 val4 = Vector3.ProjectOnPlane(m_sliderDirection, ((RaycastHit)(ref result2)).normal); val3 = ((Vector3)(ref val4)).normalized * m_sliderSpeed; } float num = 1f - Mathf.Exp((0f - Time.deltaTime) / 0.3f); m_sliderCurrentVel = Vector3.Lerp(m_sliderCurrentVel, val3, num); Transform cinemaCameraTrans2 = CinemaCameraTrans; cinemaCameraTrans2.position += m_sliderCurrentVel * Time.deltaTime; } else if (m_currentShotType == DirectorShotType.ActionCam) { GetActionCamPose(out var desiredPos, out var lookTarget); CinemaCameraTrans.position = Vector3.SmoothDamp(CinemaCameraTrans.position, desiredPos, ref m_chaseCurrentVel, 0.1f); if (TryLookRotation(lookTarget - CinemaCameraTrans.position, out var rotation)) { CinemaCameraTrans.rotation = Quaternion.Slerp(CinemaCameraTrans.rotation, rotation, Time.deltaTime * gimbalSmoothing.Value * 3f); } } } KeyboardShortcut value = freezeCamKey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { FreezeFreeCam(); } if (m_isFrozen && m_currentShotType != DirectorShotType.ActionCam) { ApplyFollow(); } if ((Object)(object)m_cameraTarget != (Object)null && (Object)(object)m_cameraTarget.Visuals != (Object)null && !((Component)m_cameraTarget.Visuals).gameObject.activeSelf) { ((Component)m_cameraTarget.Visuals).gameObject.SetActive(true); } if ((int)Cursor.lockState == 1 && !m_isFrozen) { Look(); Movement(); if ((Object)(object)m_targetTrans != (Object)null && m_currentShotType != DirectorShotType.ActionCam) { ApplyFollow(); } } if (enableCameraShake.Value) { float num2 = (Mathf.PerlinNoise(Time.time * shakeSpeed.Value, 0f) - 0.5f) * shakeIntensity.Value; float num3 = (Mathf.PerlinNoise(0f, Time.time * shakeSpeed.Value) - 0.5f) * shakeIntensity.Value; float num4 = (Mathf.PerlinNoise(Time.time * shakeSpeed.Value, Time.time * shakeSpeed.Value) - 0.5f) * (shakeIntensity.Value * 0.5f); m_lastShake = Quaternion.Euler(num2, num3, num4); Transform cinemaCameraTrans3 = CinemaCameraTrans; cinemaCameraTrans3.rotation *= m_lastShake; } if ((Object)(object)m_localPlayer != (Object)null && (Object)(object)m_localPlayer.CharacterCamera != (Object)null && (Object)(object)m_localPlayer.CharacterCamera.CameraScript != (Object)null) { Camera cameraScript = m_localPlayer.CharacterCamera.CameraScript; cameraScript.worldToCameraMatrix = m_camera.worldToCameraMatrix; cameraScript.projectionMatrix = m_camera.projectionMatrix; } } private bool IsTargetObstructed() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = m_camera.WorldToViewportPoint(m_cameraTarget.CenterPosition); bool num = val.z < 0f || val.x < 0f || val.x > 1f || val.y < 0f || val.y > 1f; RaycastHit result; bool flag = TryRaycastWorld(((Component)m_camera).transform.position, m_cameraTarget.CenterPosition, out result); return num || flag; } private float ComputeDirectorFov(float distToPlayer) { float num = Mathf.Min(dirMinFov.Value, dirMaxFov.Value); float num2 = Mathf.Max(dirMinFov.Value, dirMaxFov.Value); return Mathf.Clamp(num2 - distToPlayer * dirZoomAggression.Value * m_currentCutZoomFactor, num, num2); } private void SetUIVisible(bool show) { if (show == !m_isUiGloballyHidden) { return; } m_isUiGloballyHidden = !show; Stopwatch sw = (logLoadTiming.Value ? Stopwatch.StartNew() : null); Canvas[] hiddenCanvases; if (show) { if (m_hiddenCanvases == null) { return; } int num = m_hiddenCanvases.Length; hiddenCanvases = m_hiddenCanvases; foreach (Canvas val in hiddenCanvases) { if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = true; } } m_hiddenCanvases = null; LogStep(sw, $"HUD show: re-enabled {num} canvases"); return; } Canvas[] array = Object.FindObjectsOfType<Canvas>(); List<Canvas> list = new List<Canvas>(); hiddenCanvases = array; foreach (Canvas val2 in hiddenCanvases) { if (((Behaviour)val2).enabled && ((Object)((Component)val2).gameObject).name != "ConfigurationManager" && ((Object)((Component)val2).gameObject).name != "CinecamLetterbox") { ((Behaviour)val2).enabled = false; list.Add(val2); } } m_hiddenCanvases = list.ToArray(); LogStep(sw, $"HUD hide: scanned {array.Length} canvases, hid {list.Count}"); } private void UpdatePostProcessing() { //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Unknown result type (might be due to invalid IL or missing references) //IL_066c: Unknown result type (might be due to invalid IL or missing references) //IL_064a: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Invalid comparison between Unknown and I4 //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)m_dofVolumeObj == (Object)null) { return; } bool flag = globalPPBypass != null && globalPPBypass.Value; if ((Object)(object)m_dof != (Object)null) { bool flag2 = false; flag2 = (m_active ? enableDofDirector.Value : enableDofNormalPlay.Value); ((PostProcessEffectSettings)m_dof).active = !flag && flag2; if (flag2) { if (!m_active) { ((ParameterOverride<float>)(object)m_dof.aperture).value = dofNormalAperture.Value; ((ParameterOverride<float>)(object)m_dof.focalLength).value = dofNormalFocalLength.Value; } else { ((ParameterOverride<float>)(object)m_dof.aperture).value = dofCineAperture.Value; ((ParameterOverride<float>)(object)m_dof.focalLength).value = dofCineFocalLength.Value; } if (m_active && !m_isDirectorActive) { UpdateFreecamAutofocus(); } else { m_afSeeded = false; float num = 5f; if (m_active && m_isDirectorActive && m_currentShotType == DirectorShotType.ActionCam && (Object)(object)m_cameraTarget != (Object)null && (Object)(object)m_cameraTarget.TargetingSystem != (Object)null && (Object)(object)m_cameraTarget.TargetingSystem.LockedCharacter != (Object)null) { Vector3 val = m_cameraTarget.TargetingSystem.LockedCharacter.CenterPosition - ((Component)m_camera).transform.position; num = Mathf.Max(1.8f, Vector3.Dot(val, ((Component)m_camera).transform.forward)); } else { Character val2 = (m_active ? m_cameraTarget : m_localPlayer); if ((Object)(object)val2 != (Object)null) { Camera val3 = (m_active ? m_camera : (((Object)(object)m_localPlayer != (Object)null && (Object)(object)m_localPlayer.CharacterCamera != (Object)null) ? m_localPlayer.CharacterCamera.CameraScript : Global.MainCamera)); if ((Object)(object)val3 != (Object)null) { num = Vector3.Dot(((Component)val2).transform.position + new Vector3(0f, 1.2f, 0f) - ((Component)val3).transform.position, ((Component)val3).transform.forward); if (!m_active) { num += dofNormalOffset.Value; } num = Mathf.Max(1.8f, num); } } } m_currentFocusDistance = Mathf.Lerp(m_currentFocusDistance, num, Time.deltaTime * 10f); ((ParameterOverride<float>)(object)m_dof.focusDistance).value = m_currentFocusDistance; m_currentAperture = ((ParameterOverride<float>)(object)m_dof.aperture).value; } } else { m_afSeeded = false; } } if ((Object)(object)m_colorGrading != (Object)null) { ((PostProcessEffectSettings)m_colorGrading).active = !flag && enableColorGrading.Value; if (enableColorGrading.Value) { ((ParameterOverride<float>)(object)m_colorGrading.temperature).value = cgTemperature.Value; ((ParameterOverride<float>)(object)m_colorGrading.tint).value = cgTint.Value; ((ParameterOverride<float>)(object)m_colorGrading.postExposure).value = cgPostExposure.Value; ((ParameterOverride<float>)(object)m_colorGrading.saturation).value = cgSaturation.Value; ((ParameterOverride<float>)(object)m_colorGrading.contrast).value = cgContrast.Value; } } if ((Object)(object)m_bloom != (Object)null) { ((PostProcessEffectSettings)m_bloom).active = !flag && enableBloom.Value; if (enableBloom.Value) { ((ParameterOverride<float>)(object)m_bloom.intensity).value = bloomIntensity.Value; ((ParameterOverride<float>)(object)m_bloom.threshold).value = bloomThreshold.Value; } } if ((Object)(object)m_vignette != (Object)null) { ((PostProcessEffectSettings)m_vignette).active = !flag && enableVignette.Value; if (enableVignette.Value) { ((ParameterOverride<float>)(object)m_vignette.intensity).value = vignetteIntensity.Value; ((ParameterOverride<float>)(object)m_vignette.smoothness).value = vignetteSmoothness.Value; } } if ((Object)(object)m_chromatic != (Object)null) { ((PostProcessEffectSettings)m_chromatic).active = !flag && enableChromatic.Value; if (enableChromatic.Value) { ((ParameterOverride<float>)(object)m_chromatic.intensity).value = chromaticIntensity.Value; } } if ((Object)(object)m_grain != (Object)null) { ((PostProcessEffectSettings)m_grain).active = !flag && enableGrain.Value; if (enableGrain.Value) { ((ParameterOverride<float>)(object)m_grain.intensity).value = grainIntensity.Value; ((ParameterOverride<float>)(object)m_grain.size).value = grainSize.Value; } } if ((Object)(object)m_ao != (Object)null) { ((PostProcessEffectSettings)m_ao).active = !flag && enableAO.Value; if (enableAO.Value) { ((ParameterOverride<float>)(object)m_ao.intensity).value = aoIntensity.Value; } } if ((Object)(object)m_ssr != (Object)null) { ((PostProcessEffectSettings)m_ssr).active = !flag && enableSSR.Value; if (enableSSR.Value) { if ((int)ssrQuality.Value == 7) { ((ParameterOverride<ScreenSpaceReflectionPreset>)(object)m_ssr.preset).value = (ScreenSpaceReflectionPreset)3; } else { ((ParameterOverride<ScreenSpaceReflectionPreset>)(object)m_ssr.preset).value = ssrQuality.Value; } } } if ((Object)(object)m_ppLayer != (Object)null) { m_ppLayer.antialiasingMode = ((!flag && (int)aaMode.Value != 0) ? aaMode.Value : m_mainOriginalAA); } if ((Object)(object)m_mainPpLayer != (Object)null) { m_mainPpLayer.antialiasingMode = ((!flag && (int)aaMode.Value != 0) ? aaMode.Value : m_mainOriginalAA); } } private Character FindFocusSubject(float range) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)CharacterManager.Instance == (Object)null || CharacterManager.Instance.Characters == null) { return null; } Vector3 position = ((Component)m_camera).transform.position; Character result = null; float num = float.MaxValue; foreach (Character value in CharacterManager.Instance.Characters.Values) { if ((Object)(object)value == (Object)null || !((Component)value).gameObject.activeInHierarchy) { continue; } Vector3 centerPosition = value.CenterPosition; Vector3 val = m_camera.WorldToViewportPoint(centerPosition); if (val.z < 0.5f || val.z > range) { continue; } float num2 = 0.28f / (1f + val.z / 15f); float num3 = val.x - 0.5f; float num4 = val.y - 0.5f; float num5 = Mathf.Sqrt(num3 * num3 + num4 * num4); if (!(num5 > num2)) { if ((Object)(object)value == (Object)(object)m_afSubject) { num5 -= 0.08f; } if (!(num5 >= num) && !TryRaycastWorld(position, centerPosition, out var _)) { result = value; num = num5; } } } return result; } private bool TrySampleFreecamSurface(float range, out float depth) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) depth = 0f; Transform transform = ((Component)m_camera).transform; Ray val = m_camera.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0f)); if (TrySphereCastWorld(((Ray)(ref val)).origin, 0.25f, ((Ray)(ref val)).direction, range, out var result) && ((RaycastHit)(ref result)).distance > 0.01f) { float num = Vector3.Dot(((RaycastHit)(ref result)).point - transform.position, transform.forward); if (num > 0.3f) { depth = num; return true; } } float num2 = float.MaxValue; for (int i = 0; i < 8; i++) { float num3 = (float)i * ((float)Math.PI / 4f); Ray val2 = m_camera.ViewportPointToRay(new Vector3(0.5f + Mathf.Cos(num3) * 0.08f, 0.5f + Mathf.Sin(num3) * 0.08f, 0f)); if (TryRaycastWorld(((Ray)(ref val2)).origin, ((Ray)(ref val2)).origin + ((Ray)(ref val2)).direction * range, out result)) { float num4 = Vector3.Dot(((RaycastHit)(ref result)).point - transform.position, transform.forward); if (num4 > 0.3f && num4 < num2) { num2 = num4; } } } if (num2 == float.MaxValue) { return false; } depth = num2; return true; } private void UpdateFreecamAutofocus() { //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)m_camera == (Object)null) { return; } float value = ((ParameterOverride<float>)(object)m_dof.aperture).value; float value2 = ((ParameterOverride<float>)(object)m_dof.focalLength).value; float value3 = freecamAutofocusRange.Value; float deltaTime = Time.deltaTime; if (!m_afSeeded) { m_afLogFocus = Mathf.Log(Mathf.Max(m_currentFocusDistance, 0.5f)); m_afLogAperture = Mathf.Log(Mathf.Max(m_currentAperture, 0.1f)); m_afLogFocusVel = 0f; m_afLogApertureVel = 0f; m_afNoSubjectTimer = 0f; m_afTarget = Mathf.Max(m_currentFocusDistance, 0.5f); m_afHasTarget = false; m_afJumpTimer = 0f; m_afSubject = null; m_afScanTimer = 0f; m_afSeeded = true; } if (freecamPreferCharacters.Value) { m_afScanTimer -= deltaTime; if (m_afScanTimer <= 0f) { m_afScanTimer = 0.1f; m_afSubject = FindFocusSubject(value3); } } else { m_afSubject = null; } float depth = 0f; bool flag = false; bool flag2 = false; if ((Object)(object)m_afSubject != (Object)null) { Vector3 val = m_camera.WorldToViewportPoint(m_afSubject.CenterPosition); if (val.z >= 0.5f && val.z <= value3) { depth = val.z; flag = true; flag2 = true; } } if (!flag) { flag = TrySampleFreecamSurface(value3, out depth); } float num; float num2; float num5; if (flag) { m_afNoSubjectTimer = 0f; if (flag2 || !m_afHasTarget) { m_afTarget = depth; m_afHasTarget = true; m_afJumpTimer = 0f; } else if (Mathf.Abs(Mathf.Log(depth / m_afTarget)) < 0.15f) { m_afTarget = depth; m_afJumpTimer = 0f; } else { if (m_afJumpTimer > 0f && Mathf.Abs(Mathf.Log(depth / m_afJumpDepth)) < 0.15f) { m_afJumpTimer += deltaTime; } else { m_afJumpTimer = deltaTime; } m_afJumpDepth = depth; if (m_afJumpTimer >= 0.12f) { m_afTarget = depth; m_afJumpTimer = 0f; } } num = m_afTarget; num2 = value; if (freecamSharpZone.Value > 0.001f) { float num3 = num * 1000f; float num4 = freecamSharpZone.Value * value2 * value2 / (0.06f * num3); num2 = Mathf.Max(num2, num4); } num5 = (flag2 ? Mathf.Min(freecamFocusPullTime.Value, 0.2f) : freecamFocusPullTime.Value); } else { m_afNoSubjectTimer += deltaTime; m_afJumpTimer = 0f; if (m_afNoSubjectTimer < freecamLostSubjectDelay.Value) { num = m_afTarget; num2 = value; num5 = freecamFocusPullTime.Value; } else { m_afHasTarget = false; num = freecamFarFocusDistance.Value; num2 = freecamFarFocusAperture.Value; num5 = freecamFarPullTime.Value; } } num5 = Mathf.Max(num5, 0.02f); m_afLogFocus = Mathf.SmoothDamp(m_afLogFocus, Mathf.Log(Mathf.Max(num, 0.5f)), ref m_afLogFocusVel, num5); m_afLogAperture = Mathf.SmoothDamp(m_afLogAperture, Mathf.Log(Mathf.Clamp(num2, 0.1f, 32f)), ref m_afLogApertureVel, num5); float num6 = Mathf.Exp(m_afLogFocus); float num7 = Mathf.Clamp(Mathf.Exp(m_afLogAperture), 0.1f, 32f); m_currentFocusDistance = num6; m_currentAperture = num7; ((ParameterOverride<float>)(object)m_dof.focusDistance).value = num6; ((ParameterOverride<float>)(object)m_dof.aperture).value = num7; } private static void UpgradePreset(PresetData data) { data.presetVersion = 1; } private PresetData BuildPresetFromCurrent() { //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Expected I4, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Expected I4, but got Unknown return new PresetData { presetVersion = 1, globalBypass = globalPPBypass.Value, dofNormEnabled = enableDofNormalPlay.Value, dofNormAp = dofNormalAperture.Value, dofNormFocal = dofNormalFocalLength.Value, dofNormOffset = dofNormalOffset.Value, cgEnabled = enableColorGrading.Value, cgTemp = cgTemperature.Value, cgTint = cgTint.Value, cgExposure = cgPostExposure.Value, cgSat = cgSaturation.Value, cgContrast = cgContrast.Value, bloomEnabled = enableBloom.Value, bloomInt = bloomIntensity.Value, bloomThresh = bloomThreshold.Value, vigEnabled = enableVignette.Value, vigInt = vignetteIntensity.Value, vigSmooth = vignetteSmoothness.Value, chromEnabled = enableChromatic.Value, chromInt = chromaticIntensity.Value, grainEnabled = enableGrain.Value, grainInt = grainIntensity.Value, grainSize = grainSize.Value, aoEnabled = enableAO.Value, aoInt = aoIntensity.Value, ssrEnabled = enableSSR.Value, ssrQual = (int)ssrQuality.Value, aaMode = (int)aaMode.Value, dirSwitchTime = directorSwitchTime.Value, occlCutTime = occlusionCutTime.Value, dirDynFOV = directorDynamicFOV.Value, gimbalSmooth = gimbalSmoothing.Value, trackSpeed = trackingSpeed.Value, hideHudCine = hideHudInCinematic.Value, syncHead = syncCharacterHeading.Value, headingIndSize = headingIndicatorSize.Value, dirMinH = dirMinHeight.Value, dirMax