using System; using System.Collections; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using Atlyss.CameraFreedom.SoftDependencies; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Mirror; using Nessie.ATLYSS.EasySettings; using Nessie.ATLYSS.EasySettings.UIElements; using UnityEngine; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Atlyss.CameraFreedom")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("Atlyss.CameraFreedom")] [assembly: AssemblyTitle("Atlyss.CameraFreedom")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } } namespace Atlyss.CameraFreedom { [BepInPlugin("ATLYSS.CameraFreedom", "Camera Freedom", "3.2.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public sealed class Mod : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__180_0; internal void b__180_0() { SettingsTab orAddCustomTab = EasySettingsCompatibility.GetOrAddCustomTab("Camera Freedom"); if (orAddCustomTab != null) { orAddCustomTab.AddHeader("Camera Freedom"); orAddCustomTab.AddToggle(MatchHeightKey, MatchPlayerHeight); orAddCustomTab.AddToggle(MatchNPCKey, MatchNPCHeight); orAddCustomTab.AddToggle(AllowNegativeKey, AllowNegativeZoom); orAddCustomTab.AddToggle(IgnoreCollisionKey, IgnoreCollision); orAddCustomTab.AddToggle(StiffKey, StiffCamera); orAddCustomTab.AddAdvancedSlider(RenderDistanceKey, RenderDistance, false); orAddCustomTab.AddSpace(); orAddCustomTab.AddKeyButton(IncreaseModifierKey, IncreaseModifier); orAddCustomTab.AddKeyButton(DecreaseModifierKey, DecreaseModifier); orAddCustomTab.AddKeyButton(HeightScrollKey, HeightScrollModifier); orAddCustomTab.AddKeyButton(HorizKey, HorizontalModifier); orAddCustomTab.AddKeyButton(RotationKey, RotationHotkey); orAddCustomTab.AddKeyButton(ShowPlayerKey, ShowPlayerHotkey); orAddCustomTab.AddKeyButton(ShowHeadKey, ShowHeadHotkey); orAddCustomTab.AddHeader("Camera Freedom (Free Camera)"); orAddCustomTab.AddToggle(DisablePlayerControlKey, DisablePlayerControl); orAddCustomTab.AddToggle(UsePlayerInputKey, UsePlayerInput); orAddCustomTab.AddSpace(); orAddCustomTab.AddKeyButton(EnableFreeCamKey, EnableFreeCamHotkey); orAddCustomTab.AddKeyButton(UpFreeCamKey, UpFreeCamHotkey); orAddCustomTab.AddKeyButton(DownFreeCamKey, DownFreeCamHotkey); orAddCustomTab.AddKeyButton(RightFreeCamKey, RightFreeCamHotkey); orAddCustomTab.AddKeyButton(LeftFreeCamKey, LeftFreeCamHotkey); } else { EasySettingsCompatibility.AddHeader("Camera Freedom"); EasySettingsCompatibility.AddToggle(MatchHeightKey, MatchPlayerHeight); EasySettingsCompatibility.AddToggle(MatchNPCKey, MatchNPCHeight); EasySettingsCompatibility.AddToggle(AllowNegativeKey, AllowNegativeZoom); EasySettingsCompatibility.AddToggle(IgnoreCollisionKey, IgnoreCollision); EasySettingsCompatibility.AddToggle(StiffKey, StiffCamera); EasySettingsCompatibility.AddAdvancedSlider(RenderDistanceKey, RenderDistance); EasySettingsCompatibility.AddSpace(); EasySettingsCompatibility.AddKeyButton(IncreaseModifierKey, IncreaseModifier); EasySettingsCompatibility.AddKeyButton(DecreaseModifierKey, DecreaseModifier); EasySettingsCompatibility.AddKeyButton(HeightScrollKey, HeightScrollModifier); EasySettingsCompatibility.AddKeyButton(HorizKey, HorizontalModifier); EasySettingsCompatibility.AddKeyButton(RotationKey, RotationHotkey); EasySettingsCompatibility.AddKeyButton(ShowPlayerKey, ShowPlayerHotkey); EasySettingsCompatibility.AddKeyButton(ShowHeadKey, ShowHeadHotkey); EasySettingsCompatibility.AddHeader("Camera Freedom (Free Camera)"); EasySettingsCompatibility.AddToggle(DisablePlayerControlKey, DisablePlayerControl); EasySettingsCompatibility.AddToggle(UsePlayerInputKey, UsePlayerInput); EasySettingsCompatibility.AddSpace(); EasySettingsCompatibility.AddKeyButton(EnableFreeCamKey, EnableFreeCamHotkey); EasySettingsCompatibility.AddKeyButton(UpFreeCamKey, UpFreeCamHotkey); EasySettingsCompatibility.AddKeyButton(DownFreeCamKey, DownFreeCamHotkey); EasySettingsCompatibility.AddKeyButton(RightFreeCamKey, RightFreeCamHotkey); EasySettingsCompatibility.AddKeyButton(LeftFreeCamKey, LeftFreeCamHotkey); } } } private const string modGUID = "ATLYSS.CameraFreedom"; private const string modName = "Camera Freedom"; private const string modVersion = "3.2.1"; public static string HeightScrollKey = "Height Modifier"; public static string HorizKey = "Horizontal Modifier"; public static string IncreaseModifierKey = "Increase Adjustment Sensitivity"; public static string DecreaseModifierKey = "Decrease Adjustment Sensitivity"; public static string RotationKey = "Rotation Mode"; public static string ShowPlayerKey = "Show Player"; public static string MatchHeightKey = "Match Player Height"; public static string MatchNPCKey = "Match NPC Height"; public static string AllowNegativeKey = "Allows Negative Zoom Value"; public static string IgnoreCollisionKey = "Camera Ignores Collision"; public static string StiffKey = "Stiff Camera"; public static string ShowHeadKey = "Show Head"; public static string EnableFreeCamKey = "Enable Free Camera"; public static string UpFreeCamKey = "Up Free Camera Input"; public static string DownFreeCamKey = "Down Free Camera Input"; public static string RightFreeCamKey = "Right Free Camera Input"; public static string LeftFreeCamKey = "Left Free Camera Input"; public static string DisablePlayerControlKey = "Disable Player in Free Cam"; public static string UsePlayerInputKey = "Use Player Input for Free Cam"; public static string RenderDistanceKey = "Render Distance"; public Vector2 eulerFreeCam = Vector2.zero; public Vector3 overridePositionAdjust = Vector3.zero; public Vector3 rotationAdjust = Vector3.zero; public float changeValue = 3.2f; public float matchHeightAdjust = 0f; public float npcHeightAdjust = 0f; public float prevDistanceHeightScale = 1f; public float zoomChangeValue = 35.5f; public float zoomChangeValueDPad = 65.5f; public bool displayHead = true; private bool AdjustingRotation = false; private float prevHeightScale; private float prevNPCHeightScale; private float scaleAdjustMultiplier = 0f; private static readonly Harmony harmony = new Harmony("ATLYSS.CameraFreedom"); public static ManualLogSource Log = new ManualLogSource("Camera Freedom"); public static Mod Instance; public static ConfigEntry HeightScrollModifier { get; set; } public static ConfigEntry HorizontalModifier { get; set; } public static ConfigEntry IncreaseModifier { get; set; } public static ConfigEntry DecreaseModifier { get; set; } public static ConfigEntry RotationHotkey { get; set; } public static ConfigEntry ShowPlayerHotkey { get; set; } public static ConfigEntry MatchPlayerHeight { get; set; } public static ConfigEntry MatchNPCHeight { get; set; } public static ConfigEntry AllowNegativeZoom { get; set; } public static ConfigEntry StiffCamera { get; set; } public static ConfigEntry ShowHeadHotkey { get; set; } public static ConfigEntry IgnoreCollision { get; set; } public static ConfigEntry EnableFreeCamHotkey { get; set; } public static ConfigEntry UpFreeCamHotkey { get; set; } public static ConfigEntry DownFreeCamHotkey { get; set; } public static ConfigEntry RightFreeCamHotkey { get; set; } public static ConfigEntry LeftFreeCamHotkey { get; set; } public static ConfigEntry DisablePlayerControl { get; set; } public static ConfigEntry UsePlayerInput { get; set; } public static ConfigEntry RenderDistance { get; set; } public Vector3 prevPositionAdjust { get; set; } public Quaternion prevRotation { get; set; } public Transform dialogNPCTransform { get; set; } public Vector3 dialogOverridePosition { get; set; } = Vector3.one; public float cachedDistance { get; set; } public float cachedDialogueDistance { get; set; } public float currentHeight { get; set; } public float currentHoriz { get; set; } public float heightScale { get; set; } public float prevZoomLocked { get; set; } = 30f; public float zoomLockedValue { get; set; } = 30f; public bool ControllingCamera { get; set; } public bool AlwaysShowPlayer { get; set; } public bool FreeCamera { get; set; } public bool LockCamera { get; set; } public void Awake() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Expected O, but got Unknown //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Expected O, but got Unknown //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Expected O, but got Unknown //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Expected O, but got Unknown //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Expected O, but got Unknown //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Expected O, but got Unknown //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Expected O, but got Unknown //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Expected O, but got Unknown //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Expected O, but got Unknown //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Expected O, but got Unknown //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Expected O, but got Unknown //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Expected O, but got Unknown //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Expected O, but got Unknown //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Expected O, but got Unknown if ((Object)(object)Instance == (Object)null) { Instance = this; } Log = Logger.CreateLogSource("ATLYSS.CameraFreedom"); Log.LogInfo((object)"Starting Camera Freedom"); MatchPlayerHeight = ((BaseUnityPlugin)this).Config.Bind("General", MatchHeightKey, false, new ConfigDescription("Whether or not the camera tries to match the height of the player.", (AcceptableValueBase)null, Array.Empty())); MatchNPCHeight = ((BaseUnityPlugin)this).Config.Bind("General", MatchNPCKey, false, new ConfigDescription("Whether or not the camera tries to match the height of an NPC you're having dialog with", (AcceptableValueBase)null, Array.Empty())); AllowNegativeZoom = ((BaseUnityPlugin)this).Config.Bind("General", AllowNegativeKey, false, new ConfigDescription("Allows the camera to have negative zoom values. This lets you scroll past the \"First Person\" view", (AcceptableValueBase)null, Array.Empty())); StiffCamera = ((BaseUnityPlugin)this).Config.Bind("General", StiffKey, false, new ConfigDescription("Toggles Stiff Camera Mode. The stiff camera follows the player without smooth movement", (AcceptableValueBase)null, Array.Empty())); IgnoreCollision = ((BaseUnityPlugin)this).Config.Bind("General", IgnoreCollisionKey, false, new ConfigDescription("Toggles whether the camera collides with the environment", (AcceptableValueBase)null, Array.Empty())); RenderDistance = ((BaseUnityPlugin)this).Config.Bind("General", RenderDistanceKey, 1000f, new ConfigDescription("Directly control the render distance", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 8000f), Array.Empty())); HeightScrollModifier = ((BaseUnityPlugin)this).Config.Bind("General", HeightScrollKey, (KeyCode)308, new ConfigDescription("The key to hold in order to change height while scrolling", (AcceptableValueBase)null, Array.Empty())); HorizontalModifier = ((BaseUnityPlugin)this).Config.Bind("General", HorizKey, (KeyCode)307, new ConfigDescription("The key to hold in order to change horizontal offset while scrolling", (AcceptableValueBase)null, Array.Empty())); IncreaseModifier = ((BaseUnityPlugin)this).Config.Bind("General", IncreaseModifierKey, (KeyCode)93, new ConfigDescription("The key to increase strength of sensitivity", (AcceptableValueBase)null, Array.Empty())); DecreaseModifier = ((BaseUnityPlugin)this).Config.Bind("General", DecreaseModifierKey, (KeyCode)91, new ConfigDescription("The key to decrease strength of sensitivity", (AcceptableValueBase)null, Array.Empty())); RotationHotkey = ((BaseUnityPlugin)this).Config.Bind("General", RotationKey, (KeyCode)110, new ConfigDescription("Press this key to switch position adjust into rotation adjust", (AcceptableValueBase)null, Array.Empty())); ShowPlayerHotkey = ((BaseUnityPlugin)this).Config.Bind("General", ShowPlayerKey, (KeyCode)44, new ConfigDescription("This key toggles whether the player model is always visible or not", (AcceptableValueBase)null, Array.Empty())); ShowHeadHotkey = ((BaseUnityPlugin)this).Config.Bind("General", ShowHeadKey, (KeyCode)46, new ConfigDescription("This key toggles whether the player's head is visible.", (AcceptableValueBase)null, Array.Empty())); EnableFreeCamHotkey = ((BaseUnityPlugin)this).Config.Bind("Free Camera", EnableFreeCamKey, (KeyCode)99, new ConfigDescription("Press this key to toggle free camera", (AcceptableValueBase)null, Array.Empty())); UpFreeCamHotkey = ((BaseUnityPlugin)this).Config.Bind("Free Camera", UpFreeCamKey, (KeyCode)273, new ConfigDescription("This key will move the free camera up", (AcceptableValueBase)null, Array.Empty())); DownFreeCamHotkey = ((BaseUnityPlugin)this).Config.Bind("Free Camera", DownFreeCamKey, (KeyCode)274, new ConfigDescription("This key will move the free camera down", (AcceptableValueBase)null, Array.Empty())); RightFreeCamHotkey = ((BaseUnityPlugin)this).Config.Bind("Free Camera", RightFreeCamKey, (KeyCode)275, new ConfigDescription("This key will move the free camera right", (AcceptableValueBase)null, Array.Empty())); LeftFreeCamHotkey = ((BaseUnityPlugin)this).Config.Bind("Free Camera", LeftFreeCamKey, (KeyCode)276, new ConfigDescription("This key will move the free camera left", (AcceptableValueBase)null, Array.Empty())); DisablePlayerControl = ((BaseUnityPlugin)this).Config.Bind("Free Camera", DisablePlayerControlKey, true, new ConfigDescription("Toggle whether you can control the player while the free camera is active", (AcceptableValueBase)null, Array.Empty())); UsePlayerInput = ((BaseUnityPlugin)this).Config.Bind("Free Camera", UsePlayerInputKey, false, new ConfigDescription("If enabled, the free camera will use your player's vanilla movement inputs instead of the inputs set by CameraFreedom", (AcceptableValueBase)null, Array.Empty())); if (EasySettingsCompatibility.enabled) { UnityEvent onInitialized = EasySettingsCompatibility.OnInitialized; object obj = <>c.<>9__180_0; if (obj == null) { UnityAction val = delegate { SettingsTab orAddCustomTab = EasySettingsCompatibility.GetOrAddCustomTab("Camera Freedom"); if (orAddCustomTab != null) { orAddCustomTab.AddHeader("Camera Freedom"); orAddCustomTab.AddToggle(MatchHeightKey, MatchPlayerHeight); orAddCustomTab.AddToggle(MatchNPCKey, MatchNPCHeight); orAddCustomTab.AddToggle(AllowNegativeKey, AllowNegativeZoom); orAddCustomTab.AddToggle(IgnoreCollisionKey, IgnoreCollision); orAddCustomTab.AddToggle(StiffKey, StiffCamera); orAddCustomTab.AddAdvancedSlider(RenderDistanceKey, RenderDistance, false); orAddCustomTab.AddSpace(); orAddCustomTab.AddKeyButton(IncreaseModifierKey, IncreaseModifier); orAddCustomTab.AddKeyButton(DecreaseModifierKey, DecreaseModifier); orAddCustomTab.AddKeyButton(HeightScrollKey, HeightScrollModifier); orAddCustomTab.AddKeyButton(HorizKey, HorizontalModifier); orAddCustomTab.AddKeyButton(RotationKey, RotationHotkey); orAddCustomTab.AddKeyButton(ShowPlayerKey, ShowPlayerHotkey); orAddCustomTab.AddKeyButton(ShowHeadKey, ShowHeadHotkey); orAddCustomTab.AddHeader("Camera Freedom (Free Camera)"); orAddCustomTab.AddToggle(DisablePlayerControlKey, DisablePlayerControl); orAddCustomTab.AddToggle(UsePlayerInputKey, UsePlayerInput); orAddCustomTab.AddSpace(); orAddCustomTab.AddKeyButton(EnableFreeCamKey, EnableFreeCamHotkey); orAddCustomTab.AddKeyButton(UpFreeCamKey, UpFreeCamHotkey); orAddCustomTab.AddKeyButton(DownFreeCamKey, DownFreeCamHotkey); orAddCustomTab.AddKeyButton(RightFreeCamKey, RightFreeCamHotkey); orAddCustomTab.AddKeyButton(LeftFreeCamKey, LeftFreeCamHotkey); } else { EasySettingsCompatibility.AddHeader("Camera Freedom"); EasySettingsCompatibility.AddToggle(MatchHeightKey, MatchPlayerHeight); EasySettingsCompatibility.AddToggle(MatchNPCKey, MatchNPCHeight); EasySettingsCompatibility.AddToggle(AllowNegativeKey, AllowNegativeZoom); EasySettingsCompatibility.AddToggle(IgnoreCollisionKey, IgnoreCollision); EasySettingsCompatibility.AddToggle(StiffKey, StiffCamera); EasySettingsCompatibility.AddAdvancedSlider(RenderDistanceKey, RenderDistance); EasySettingsCompatibility.AddSpace(); EasySettingsCompatibility.AddKeyButton(IncreaseModifierKey, IncreaseModifier); EasySettingsCompatibility.AddKeyButton(DecreaseModifierKey, DecreaseModifier); EasySettingsCompatibility.AddKeyButton(HeightScrollKey, HeightScrollModifier); EasySettingsCompatibility.AddKeyButton(HorizKey, HorizontalModifier); EasySettingsCompatibility.AddKeyButton(RotationKey, RotationHotkey); EasySettingsCompatibility.AddKeyButton(ShowPlayerKey, ShowPlayerHotkey); EasySettingsCompatibility.AddKeyButton(ShowHeadKey, ShowHeadHotkey); EasySettingsCompatibility.AddHeader("Camera Freedom (Free Camera)"); EasySettingsCompatibility.AddToggle(DisablePlayerControlKey, DisablePlayerControl); EasySettingsCompatibility.AddToggle(UsePlayerInputKey, UsePlayerInput); EasySettingsCompatibility.AddSpace(); EasySettingsCompatibility.AddKeyButton(EnableFreeCamKey, EnableFreeCamHotkey); EasySettingsCompatibility.AddKeyButton(UpFreeCamKey, UpFreeCamHotkey); EasySettingsCompatibility.AddKeyButton(DownFreeCamKey, DownFreeCamHotkey); EasySettingsCompatibility.AddKeyButton(RightFreeCamKey, RightFreeCamHotkey); EasySettingsCompatibility.AddKeyButton(LeftFreeCamKey, LeftFreeCamHotkey); } }; <>c.<>9__180_0 = val; obj = (object)val; } onInitialized.AddListener((UnityAction)obj); EasySettingsCompatibility.OnApplySettings.AddListener((UnityAction)delegate { ((BaseUnityPlugin)this).Config.Save(); }); } heightScale = 1f; Log.LogInfo((object)"Camera Freedom: Patching..."); harmony.PatchAll(); Log.LogInfo((object)"Camera Freedom: Active!"); } private void SettingChanged(object sender, EventArgs e) { SettingChangedEventArgs e2 = (SettingChangedEventArgs)(object)((e is SettingChangedEventArgs) ? e : null); if (e2 != null && sender == RenderDistance && !((Object)(object)CameraFunction._current == (Object)null)) { CameraFunction._current._mainCamera.farClipPlane = RenderDistance.Value; CameraFunction._current._UICamera.farClipPlane = RenderDistance.Value; } } public void Update() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_0174: 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) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_064c: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0730: Unknown result type (might be due to invalid IL or missing references) //IL_0668: 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_0392: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_0780: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_09f6: Unknown result type (might be due to invalid IL or missing references) //IL_0a40: Unknown result type (might be due to invalid IL or missing references) //IL_0a50: Unknown result type (might be due to invalid IL or missing references) //IL_0a73: Unknown result type (might be due to invalid IL or missing references) //IL_08f4: Unknown result type (might be due to invalid IL or missing references) //IL_093e: Unknown result type (might be due to invalid IL or missing references) //IL_094e: Unknown result type (might be due to invalid IL or missing references) //IL_0971: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player._mainPlayer == (Object)null || (int)Player._mainPlayer._currentGameCondition != 1) { return; } if (Input.GetKeyDown(IncreaseModifier.Value) && !Player._mainPlayer._inChat) { changeValue *= 2f; zoomChangeValue *= 2f; zoomChangeValueDPad *= 2f; ChatBehaviour._current.Init_GameLogicMessage("CF - Increased Camera Adjustment Sensitivity..."); } if (Input.GetKeyDown(DecreaseModifier.Value) && !Player._mainPlayer._inChat) { changeValue /= 2f; zoomChangeValue /= 2f; zoomChangeValueDPad /= 2f; ChatBehaviour._current.Init_GameLogicMessage("CF - Decreased Camera Adjustment Sensitivity..."); } if (Input.GetKeyDown(ShowPlayerHotkey.Value) && !Player._mainPlayer._inChat) { AlwaysShowPlayer = !AlwaysShowPlayer; if (AlwaysShowPlayer) { ChatBehaviour._current.Init_GameLogicMessage("CF - Always Show Player Enabled..."); } else { ChatBehaviour._current.Init_GameLogicMessage("CF - Always Show Player Disabled..."); } } if (Input.GetKeyDown(ShowHeadHotkey.Value) && !Player._mainPlayer._inChat) { displayHead = !displayHead; if (displayHead) { ChatBehaviour._current.Init_GameLogicMessage("CF - Displaying Player's Head..."); } else { ChatBehaviour._current.Init_GameLogicMessage("CF - No Longer Displaying Player's Head..."); } } if (Input.GetKeyDown(EnableFreeCamHotkey.Value) && !Player._mainPlayer._inChat) { FreeCamera = !FreeCamera; if (FreeCamera && DisablePlayerControl.Value) { Player._mainPlayer._pMove._movementLockType = (MovementLockType)2; } if (!FreeCamera) { Player._mainPlayer._pMove._movementLockType = (MovementLockType)0; CameraFunction._current.CameraReset_Lerp(); } if (FreeCamera) { ChatBehaviour._current.Init_GameLogicMessage("CF - Enabling Free Camera Mode..."); } else { ChatBehaviour._current.Init_GameLogicMessage("CF - Disabling Free Camera Mode..."); } } if ((Object)(object)CameraFunction._current == (Object)null) { return; } if (Input.GetKeyDown(RotationHotkey.Value) && !Player._mainPlayer._inChat) { if (CameraFunction._current._unlockedCamera) { AdjustingRotation = !AdjustingRotation; if (AdjustingRotation) { ChatBehaviour._current.Init_GameLogicMessage("CF - Rotation Mode Enabled..."); } else { ChatBehaviour._current.Init_GameLogicMessage("CF - Rotation Mode Disable..."); } } else { ChatBehaviour._current.Init_GameLogicMessage("CF - Camera must be in a locked state to turn on Rotation Mode"); } } heightScale = Player._mainPlayer._pVisual._playerAppearanceStruct._heightWeight; ControllingCamera = false; if (CameraFunction._current._unlockedCamera) { if (Input.GetKey(HeightScrollModifier.Value)) { ControllingCamera = true; if (Input.mouseScrollDelta.y > 0f) { if (AdjustingRotation) { rotationAdjust.y += changeValue; } else { overridePositionAdjust.y += changeValue; } } else if (Input.mouseScrollDelta.y < 0f) { if (AdjustingRotation) { rotationAdjust.y -= changeValue; } else { overridePositionAdjust.y -= changeValue; } } } if (Input.GetKey(HorizontalModifier.Value)) { ControllingCamera = true; if (Input.mouseScrollDelta.y > 0f) { if (AdjustingRotation) { rotationAdjust.x += changeValue; } else { overridePositionAdjust.x += changeValue; } } else if (Input.mouseScrollDelta.y < 0f) { if (AdjustingRotation) { rotationAdjust.x -= changeValue; } else { overridePositionAdjust.x -= changeValue; } } } if (!ControllingCamera) { float axis = Input.GetAxis("Mouse ScrollWheel"); if (AdjustingRotation) { if ((double)axis != 0.0) { rotationAdjust.z += axis * changeValue; } if (InputControlManager.current.DpadUp((DpadHoldType)1)) { rotationAdjust.z -= changeValue * Time.deltaTime; } if (InputControlManager.current.DpadDown((DpadHoldType)1)) { rotationAdjust.z += changeValue * Time.deltaTime; } } else { if ((double)axis != 0.0) { zoomLockedValue += axis * zoomChangeValue; } if (InputControlManager.current.DpadUp((DpadHoldType)1)) { zoomLockedValue -= zoomChangeValueDPad * Time.deltaTime; } if (InputControlManager.current.DpadDown((DpadHoldType)1)) { zoomLockedValue += zoomChangeValueDPad * Time.deltaTime; } } } } else { if (Input.GetKey(HeightScrollModifier.Value)) { ControllingCamera = true; if (Input.mouseScrollDelta.y > 0f) { CameraFunction._current.positionAdjust.y += changeValue; if (MatchPlayerHeight.Value) { matchHeightAdjust += changeValue; } } else if (Input.mouseScrollDelta.y < 0f) { CameraFunction._current.positionAdjust.y -= changeValue; if (MatchPlayerHeight.Value) { matchHeightAdjust -= changeValue; } } currentHeight = CameraFunction._current.positionAdjust.y; } if (Input.GetKey(HorizontalModifier.Value)) { ControllingCamera = true; if (Input.mouseScrollDelta.y > 0f) { CameraFunction._current.positionAdjust.x += changeValue; } else if (Input.mouseScrollDelta.y < 0f) { CameraFunction._current.positionAdjust.x -= changeValue; } currentHoriz = CameraFunction._current.positionAdjust.x; } } if (MatchPlayerHeight.Value) { float num = heightScale - prevHeightScale; if (Mathf.Abs(num) > 0.001f) { if (num > 0f) { scaleAdjustMultiplier += 0.0005f; } else if (num < 0f) { scaleAdjustMultiplier -= 0.0005f; } } prevHeightScale = heightScale; float num2 = heightScale * scaleAdjustMultiplier; if (scaleAdjustMultiplier < 0f) { num2 = 0f; } if (scaleAdjustMultiplier > 1f) { num2 = heightScale; } if (heightScale < 1f) { num2 = 0f - (1f - heightScale); } if ((Object)(object)dialogNPCTransform != (Object)null && DialogManager._current._isDialogEnabled && MatchNPCHeight.Value) { float num3 = dialogNPCTransform.localScale.y - prevNPCHeightScale; if (Mathf.Abs(num3) > 0.0001f) { zoomLockedValue += num3 * 2f; } CameraFunction._current._overridePosition.y = dialogOverridePosition.y + (dialogNPCTransform.localScale.y - 1f) * 2f; prevNPCHeightScale = dialogNPCTransform.localScale.y; } else { CameraFunction._current.positionAdjust.y = Player._mainPlayer._pVisual._headPos.y * heightScale + num2 + matchHeightAdjust; } } else if ((Object)(object)dialogNPCTransform != (Object)null && DialogManager._current._isDialogEnabled && MatchNPCHeight.Value) { float num4 = dialogNPCTransform.localScale.y - prevNPCHeightScale; if (Mathf.Abs(num4) > 0.0001f) { zoomLockedValue += num4 * 2f; } CameraFunction._current._overridePosition.y = dialogOverridePosition.y + (dialogNPCTransform.localScale.y - 1f) * 2f; prevNPCHeightScale = dialogNPCTransform.localScale.y; } } public static IEnumerator FreeCameraReset() { CameraFunction._current._isLerpingReset = true; yield return (object)new WaitForSeconds(0.45f); CameraFunction._current._isLerpingReset = false; } } } namespace Atlyss.CameraFreedom.SoftDependencies { public static class EasySettingsCompatibility { private const MethodImplOptions SoftDepend = MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization; public const string modGUID = "EasySettings"; private static bool _warnedAboutTextFields = false; private static bool _warnedAboutModTabs = false; private static bool? _enabled; private static BaseUnityPlugin? _plugin; public static Version CurrentVersion { get; private set; } = new Version("1.3.0"); public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("EasySettings"); _plugin = (Chainloader.PluginInfos.TryGetValue("EasySettings", out var value) ? value.Instance : null); if ((Object)(object)_plugin == (Object)null) { Mod.Log.LogWarning((object)"Soft dependency EasySettings was not found."); } else { CurrentVersion = _plugin.Info.Metadata.Version; } } return _enabled.Value; } } public static UnityEvent OnInitialized { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] get { return Settings.OnInitialized; } } public static UnityEvent OnCancelSettings { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] get { return Settings.OnCancelSettings; } } public static UnityEvent OnApplySettings { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] get { return Settings.OnApplySettings; } } public static UnityEvent OnCloseSettings { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] get { return Settings.OnCloseSettings; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static SettingsTab GetOrAddCustomTab(string label) { if (CurrentVersion < new Version(1, 3, 0)) { if (!_warnedAboutModTabs) { _warnedAboutModTabs = true; Mod.Log.LogWarning((object)$"EasySettings mod tabs are not supported in version {CurrentVersion} (need {new Version(1, 3, 0)})"); Mod.Log.LogWarning((object)"This means that this mod won't be able to initialize mod tabs, so you may have some missing stuff."); Mod.Log.LogWarning((object)"Please update EasySettings or edit the configuration manually instead."); } return null; } return GetOrAddCustomTabInternal(label); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static SettingsTab GetOrAddCustomTabInternal(string label) { return Settings.GetOrAddCustomTab(label); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static GameObject AddSpace() { return ((Component)((BaseAtlyssElement)Settings.ModTab.AddSpace()).Root).gameObject; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static GameObject AddHeader(string label) { return ((Component)((BaseAtlyssElement)Settings.ModTab.AddHeader(label)).Root).gameObject; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static GameObject AddButton(string buttonLabel, UnityAction onClick) { return ((Component)((BaseAtlyssElement)Settings.ModTab.AddButton(buttonLabel, onClick)).Root).gameObject; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static GameObject AddToggle(string label, ConfigEntry config) { return ((Component)((BaseAtlyssElement)Settings.ModTab.AddToggle(label, config)).Root).gameObject; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static GameObject AddSlider(string label, ConfigEntry config, bool wholeNumbers = false) { return ((Component)((BaseAtlyssElement)Settings.ModTab.AddSlider(label, config, wholeNumbers)).Root).gameObject; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static GameObject AddAdvancedSlider(string label, ConfigEntry config, bool wholeNumbers = false) { return ((Component)((BaseAtlyssElement)Settings.ModTab.AddAdvancedSlider(label, config, wholeNumbers)).Root).gameObject; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static GameObject AddAdvancedSlider(string label, ConfigEntry config, float min, float max, bool wholeNumbers = false) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown AtlyssAdvancedSlider element = Settings.ModTab.AddAdvancedSlider(label, config.Value, min, max, wholeNumbers); AtlyssAdvancedSlider obj = element; if (obj != null) { obj.OnValueChanged.AddListener((UnityAction)delegate(float newValue) { config.Value = newValue; }); } AtlyssAdvancedSlider obj2 = element; if (obj2 != null) { obj2.OnResetClicked.AddListener((UnityAction)delegate { element.SetValue((float)((ConfigEntryBase)config).DefaultValue); }); } return ((Component)((BaseAtlyssElement)element).Root).gameObject; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static GameObject AddAdvancedSliderInTab(SettingsTab tab, string label, ConfigEntry config, float min, float max, bool wholeNumbers = false) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown AtlyssAdvancedSlider element = tab.AddAdvancedSlider(label, config.Value, min, max, wholeNumbers); AtlyssAdvancedSlider obj = element; if (obj != null) { obj.OnValueChanged.AddListener((UnityAction)delegate(float newValue) { config.Value = newValue; }); } AtlyssAdvancedSlider obj2 = element; if (obj2 != null) { obj2.OnResetClicked.AddListener((UnityAction)delegate { element.SetValue((float)((ConfigEntryBase)config).DefaultValue); }); } return ((Component)((BaseAtlyssElement)element).Root).gameObject; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static GameObject AddDropdown(string label, ConfigEntry config) where T : Enum { return ((Component)((BaseAtlyssElement)Settings.ModTab.AddDropdown(label, config)).Root).gameObject; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static GameObject AddKeyButton(string label, ConfigEntry config) { return ((Component)((BaseAtlyssElement)Settings.ModTab.AddKeyButton(label, config)).Root).gameObject; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static GameObject AddTextField(string label, ConfigEntry config, string preset = "Text...") { if (CurrentVersion < new Version(1, 2, 0)) { if (!_warnedAboutTextFields) { _warnedAboutTextFields = true; Mod.Log.LogWarning((object)$"EasySettings text fields are not supported in version {CurrentVersion} (need {new Version(1, 2, 0)})"); Mod.Log.LogWarning((object)"This means that this mod won't be able to initialize text field settings, so you may have some missing stuff."); Mod.Log.LogWarning((object)"Please update EasySettings or edit the configuration manually instead."); } return null; } return AddTextFieldInternal(label, config, preset); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static GameObject AddTextFieldInternal(string label, ConfigEntry config, string preset = "Text...") { //IL_0056: Unknown result type (might be due to invalid IL or missing references) string value = config.Value; AtlyssTextField val = Settings.ModTab.AddTextField(label, config, preset); val.InputField.characterLimit = 0; val.InputField.SetTextWithoutNotify(value); val.Apply(); RectTransform component = ((Component)val.InputField).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.SetInsetAndSizeFromParentEdge((Edge)1, 10f, component.sizeDelta.x * 1.5f); } return ((Component)((BaseAtlyssElement)val).Root).gameObject; } } } namespace Atlyss.CameraFreedom.Patches { [HarmonyPatch(typeof(CameraCollision), "Handle_DetectGroundLayer")] internal static class Handle_DetectGroundLayer { [HarmonyPrefix] internal static bool CheckRaycast(CameraCollision __instance, ref bool __result) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) if (Mod.IgnoreCollision.Value) { return false; } Vector3 val = ((!Player._mainPlayer._inUI) ? CameraFunction._current.positionAdjust : Mod.Instance.overridePositionAdjust); LayerMask val2 = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "Ground" })); __result = Physics.Linecast(((Component)__instance).transform.parent.position + val, ((Component)__instance).transform.parent.TransformPoint(__instance.dollyDir * __instance.maxDistance), ref __instance.hit, LayerMask.op_Implicit(val2), (QueryTriggerInteraction)1); return false; } } [HarmonyPatch(typeof(CameraCollision), "LateUpdate")] internal static class CameraCollision__LateUpdate { [HarmonyPrefix] internal static bool BeforeHandling(CameraCollision __instance) { //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Player._mainPlayer)) { return false; } if (Mod.Instance.ControllingCamera) { return false; } float num = 1f; if (Mod.Instance.heightScale < 1f) { num = Mod.Instance.heightScale; } PlayerVisual pVisual = Player._mainPlayer._pVisual; Handle_DistanceControl(); if ((double)__instance.maxDistance <= (double)(0.6f * num) && !Mod.AllowNegativeZoom.Value) { __instance.maxDistance = 0.6f * num; } else if ((double)__instance.maxDistance <= (double)(0.6f * num) && Mod.Instance.FreeCamera) { __instance.maxDistance = 0.6f * num; } if ((double)Vector3.Distance(((Component)CameraFunction._current._mainCamera).transform.position, ((Component)Player._mainPlayer).transform.position + CameraFunction._current.positionAdjust) <= 2.799999952316284 * (double)num && !Mod.Instance.AlwaysShowPlayer) { pVisual.RenderPlayerModel(false); __instance._unhidePlayerModel = true; } else if (__instance._unhidePlayerModel) { pVisual.RenderPlayerModel(true); __instance._unhidePlayerModel = false; } __instance.distance = ((!__instance.Handle_DetectGroundLayer()) ? __instance.maxDistance : Mathf.Clamp(((RaycastHit)(ref __instance.hit)).distance * __instance.step, __instance.minDistance, __instance.maxDistance)); ((Component)__instance).transform.localPosition = __instance.dollyDir * __instance.distance; return false; void Handle_DistanceControl() { if (!Player._mainPlayer._bufferingStatus && !Player._mainPlayer._inUI && !Player._mainPlayer._inChat) { if (Mod.Instance.prevDistanceHeightScale != Mod.Instance.heightScale && Mod.MatchPlayerHeight.Value && !Mod.Instance.FreeCamera) { float num2 = Mod.Instance.heightScale - Mod.Instance.prevDistanceHeightScale; float num3 = 10f * Mod.Instance.heightScale; if (Mod.Instance.heightScale > 1f && __instance.maxDistance > num3) { CameraCollision obj = __instance; obj.maxDistance += num2 * 10f; } if (Mod.Instance.heightScale < 1f && __instance.maxDistance > num3) { CameraCollision obj2 = __instance; obj2.maxDistance += num2 * 6f / Mathf.Clamp(Mod.Instance.heightScale, 0f, 1f); } Mod.Instance.prevDistanceHeightScale = Mod.Instance.heightScale; } float axis = Input.GetAxis("Mouse ScrollWheel"); if ((double)axis != 0.0) { CameraCollision obj3 = __instance; obj3.maxDistance += axis * Mod.Instance.zoomChangeValue; if (!GamepadInput.GetButton((GamepadButton)8) && !GamepadInput.GetButton((GamepadButton)11)) { if (InputControlManager.current.DpadUp((DpadHoldType)1)) { CameraCollision obj4 = __instance; obj4.maxDistance -= Mod.Instance.zoomChangeValueDPad * Time.deltaTime; } if (InputControlManager.current.DpadDown((DpadHoldType)1)) { CameraCollision obj5 = __instance; obj5.maxDistance += Mod.Instance.zoomChangeValueDPad * Time.deltaTime; } } } } } } } [HarmonyPatch(typeof(CameraCollision), "Start")] internal static class CameraCollision__Start { [HarmonyPostfix] internal static void SetMaxDistance(CameraCollision __instance) { if (Mod.Instance.cachedDistance != 0f) { CameraCollision._current.maxDistance = Mod.Instance.cachedDistance; } } } [HarmonyPatch(typeof(CameraFunction), "CameraReset_Lerp")] internal static class CameraFunction__CameraReset_Lerp { [HarmonyPostfix] internal static void ResetExtraValues(CameraFunction __instance) { //IL_0006: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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) if (Input.GetKeyDown(InputControlManager.current._resetCamera) || (GamepadInput.GetButton((GamepadButton)13) && !Object.op_Implicit((Object)(object)Player._mainPlayer._pTargeting._foundEntity))) { if ((Object)(object)Player._mainPlayer != (Object)null) { __instance.positionAdjust = Player._mainPlayer._pVisual._headPos; } Mod.Instance.overridePositionAdjust = Vector3.zero; Mod.Instance.rotationAdjust = Vector3.zero; Mod.Instance.zoomLockedValue = 30f; if (Mod.MatchPlayerHeight.Value) { Mod.Instance.matchHeightAdjust = 0f; } } } } [HarmonyPatch(typeof(CameraFunction), "FollowTargetObj")] internal static class CameraFunction__FollowTargetObj { [HarmonyPrefix] internal static bool AltFollowTarget(CameraFunction __instance) { //IL_0037: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Invalid comparison between Unknown and I4 //IL_0102: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00e9: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Player._mainPlayer) || !Object.op_Implicit((Object)(object)__instance._CameraFollowObj) || Mod.Instance.FreeCamera) { return false; } bool flag = (int)Player._mainPlayer._currentGameCondition == 0 && (double)__instance._snapLoadCameraBuffer >= 0.30000001192092896; if ((int)Player._mainPlayer._currentGameCondition == 0 && (double)__instance._snapLoadCameraBuffer < 0.30000001192092896) { __instance._snapLoadCameraBuffer += Time.deltaTime; } if ((int)Player._mainPlayer._currentGameCondition > 0) { __instance._snapLoadCameraBuffer = 0f; } if (__instance._initCameraOverride) { return false; } if (flag || Mod.StiffCamera.Value) { ((Component)__instance).transform.position = __instance._CameraFollowObj.position + __instance.positionAdjust; } else { ((Component)__instance).transform.position = Vector3.Lerp(((Component)__instance).transform.position, __instance._CameraFollowObj.position + __instance.positionAdjust, __instance.step * Time.deltaTime); } return false; } } [HarmonyPatch(typeof(CameraFunction), "Handle_CameraControl")] internal static class CameraFunction__Handle_CameraControl { [HarmonyPrefix] internal static bool FreeCamUpdate(CameraFunction __instance) { //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0527: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Invalid comparison between Unknown and I4 //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_025b: 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_026b: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: 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_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Invalid comparison between Unknown and I4 //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_044c: 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) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) if (Mod.Instance.FreeCamera) { bool flag = Input.GetKeyDown((KeyCode)27) || Input.GetKeyDown(InputControlManager.current._hostConsole) || Input.GetKeyDown(InputControlManager.current._tabMenu); if (Object.op_Implicit((Object)(object)TabMenu._current._itemCell._heldItemListDataEntry)) { flag = false; } if (flag) { __instance._unlockedCamera = !__instance._unlockedCamera; } if (__instance._unlockedCamera) { if (!DialogManager._current._isDialogEnabled) { if ((int)InputControlManager.current._setGamepadType == 13) { Cursor.visible = true; } else { if (!Cursor.visible && (double)InputControlManager.current._gamepadMouseCursorBuffer > 0.0) { ToolTipManager._current.Disable_AllTooltips(); } Cursor.visible = (double)InputControlManager.current._gamepadMouseCursorBuffer > 0.0; } Cursor.lockState = (CursorLockMode)(!Cursor.visible); } } else { Cursor.lockState = (CursorLockMode)1; Cursor.visible = false; if ((Input.GetKeyDown(InputControlManager.current._resetCamera) || GamepadInput.GetButton((GamepadButton)13)) && Object.op_Implicit((Object)(object)Player._mainPlayer) && !__instance._isLerpingReset) { ((MonoBehaviour)__instance).StartCoroutine(Mod.FreeCameraReset()); } } if ((double)InGameUI._current._escapeMenuBuffer > 0.0) { Cursor.lockState = (CursorLockMode)1; Cursor.visible = false; __instance._unlockedCamera = false; } if (TabMenu._current._isOpen) { __instance._unlockedCamera = true; } else if (Input.GetKey(InputControlManager.current._tabMenu)) { __instance._unlockedCamera = false; } if (Player._mainPlayer._inChat) { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; __instance._unlockedCamera = true; } __instance.finalInputX = InputControlManager.current._altHoriz_input; __instance.finalInputZ = InputControlManager.current._altVert_input; if (__instance._unlockedCamera) { __instance.finalInputX = 0f; __instance.finalInputZ = 0f; } if (__instance._isLerpingReset) { Vector3 val = __instance._CameraFollowObj.position + __instance.positionAdjust; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(0f, ((Component)__instance._CameraFollowObj).transform.eulerAngles.y, 0f); ((Component)__instance).transform.position = Vector3.Lerp(((Component)__instance).transform.position, val, 12.5f * Time.deltaTime); ((Component)__instance).transform.rotation = Quaternion.Lerp(((Component)__instance).transform.rotation, Quaternion.Euler(val2), 12.5f * Time.deltaTime); } else if (!Player._mainPlayer._inChat) { Vector3 val3 = default(Vector3); if (Mod.UsePlayerInput.Value) { float num; float num2; if ((int)InputControlManager.current._setGamepadType == 13) { num = (Input.GetKey(InputControlManager.current._right) ? 1 : 0) - (Input.GetKey(InputControlManager.current._left) ? 1 : 0); num2 = (Input.GetKey(InputControlManager.current._up) ? 1 : 0) - (Input.GetKey(InputControlManager.current._down) ? 1 : 0); } else { num = InputControlManager.current._horiz_input; num2 = InputControlManager.current._vert_input; } ((Vector3)(ref val3))..ctor(num, 0f, num2); } else { float num3 = (Input.GetKey(Mod.RightFreeCamHotkey.Value) ? 1 : 0) - (Input.GetKey(Mod.LeftFreeCamHotkey.Value) ? 1 : 0); float num4 = (Input.GetKey(Mod.UpFreeCamHotkey.Value) ? 1 : 0) - (Input.GetKey(Mod.DownFreeCamHotkey.Value) ? 1 : 0); ((Vector3)(ref val3))..ctor(num3, 0f, num4); } ((Component)__instance).transform.Translate(val3 * (Mod.Instance.changeValue * 10f) * Time.deltaTime); Quaternion rotation = ((Component)__instance).transform.rotation; Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(__instance.finalInputZ, __instance.finalInputX); Mod instance = Mod.Instance; instance.eulerFreeCam += __instance.inputSensitivity * val4 * Time.deltaTime * 100f; Mod.Instance.eulerFreeCam.x = Mathf.Clamp(Mathf.Repeat(Mod.Instance.eulerFreeCam.x + 180f, 360f) - 180f, -89.95f, 89.95f); ((Component)__instance).transform.localEulerAngles = Vector2.op_Implicit(Mod.Instance.eulerFreeCam); } return false; } Mod.Instance.eulerFreeCam = Vector2.op_Implicit(((Component)__instance).transform.localEulerAngles); return true; } [HarmonyPostfix] internal static void PositionAdjustAffectsOverride(CameraFunction __instance) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0087: Unknown result type (might be due to invalid IL or missing references) if (__instance._initCameraOverride && !Mod.Instance.FreeCamera) { ((Component)__instance).transform.SetPositionAndRotation(Vector3.Lerp(((Component)__instance).transform.position, __instance._overridePosition + Mod.Instance.overridePositionAdjust, 3f * Time.deltaTime), Quaternion.Lerp(((Component)__instance).transform.rotation, Quaternion.Euler(__instance._overrideRotation + Mod.Instance.rotationAdjust), 3f * Time.deltaTime)); CameraCollision._current.maxDistance = Mathf.Lerp(CameraCollision._current.maxDistance, Mod.Instance.zoomLockedValue, 3f * Time.deltaTime); } } } [HarmonyPatch(typeof(DialogManager), "End_Dialog")] internal static class DialogManager__End_Dialog { [HarmonyPostfix] internal static void ResetMaxDistance() { if (Mod.Instance.cachedDistance != 0f) { CameraCollision._current.maxDistance = Mod.Instance.cachedDistance; } if (!Mod.MatchNPCHeight.Value) { } } } [HarmonyPatch(typeof(DialogManager), "Start_Dialog")] internal static class DialogManager__Start_Dialog { [HarmonyPrefix] internal static void SaveCameraDistance() { Mod.Instance.cachedDistance = CameraCollision._current.maxDistance; } } [HarmonyPatch(typeof(MainMenuManager), "Awake")] internal static class MainMenuManager__Awake { [HarmonyPostfix] internal static void Postfix() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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) Mod.Instance.overridePositionAdjust = Vector3.zero; Mod.Instance.rotationAdjust = Vector3.zero; Mod.Instance.zoomLockedValue = 30f; Mod.Instance.matchHeightAdjust = 0f; Mod.Instance.cachedDistance = 0f; Mod.Instance.cachedDialogueDistance = 0f; Mod.Instance.changeValue = 3.2f; Mod.Instance.zoomChangeValue = 35.5f; Mod.Instance.zoomChangeValueDPad = 65.5f; Mod.Instance.prevDistanceHeightScale = 1f; Mod.Instance.displayHead = true; Mod.Instance.FreeCamera = false; } } [HarmonyPatch(typeof(PlayerInteract), "InteractQueue_DialogTrigger")] internal static class PlayerInteract__InteractQueue_DialogTrigger { [HarmonyPostfix] internal static void ObtainNPCTransform(PlayerInteract __instance, DialogTrigger _foundDialogTrigger) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) if (!NetworkClient.active || !Mod.MatchNPCHeight.Value || !InputControlManager.current.IsInteractionInput || !Object.op_Implicit((Object)(object)((Component)_foundDialogTrigger).GetComponentInParent())) { return; } try { Mod.Instance.dialogNPCTransform = ((Component)((Component)_foundDialogTrigger).GetComponentInParent()).transform.Find("_visual"); Mod.Instance.dialogOverridePosition = _foundDialogTrigger._cameraFocusTransform.position; Mod.Instance.zoomLockedValue += Mod.Instance.dialogNPCTransform.localScale.y * 2f; } catch (Exception ex) { Mod.Log.LogWarning((object)"NPC lacks a \"_visual\" skeleton. NPC height won't be matched"); Mod.Log.LogWarning((object)ex.ToString()); } } } [HarmonyPatch(typeof(PlayerMove), "Handle_MovementControl")] internal static class PlayerMove__Handle_MovementControl { [HarmonyPrefix] internal static void PreviousRotation(PlayerMove __instance) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) Mod.Instance.prevRotation = ((Component)__instance).transform.rotation; } [HarmonyPostfix] internal static void FirstPersonAdjustments(PlayerMove __instance) { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Invalid comparison between Unknown and I4 //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Invalid comparison between Unknown and I4 //IL_0061: 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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Invalid comparison between Unknown and I4 //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Invalid comparison between Unknown and I4 //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) if (__instance._player._inChat || __instance._player._bufferingStatus || Object.op_Implicit((Object)(object)__instance._pTargeting._targetedEntity) || __instance._player._pProfession._isProfessionAction || (int)__instance._movementLockType != 0 || __instance._lockControl || TabMenu._current._isOpen || ((int)__instance._currentMovementAction == 6 && (int)__instance._currentMovementAction == 7)) { return; } float num = 1f; if (Mod.Instance.heightScale < 1f) { num = Mod.Instance.heightScale; } if ((double)CameraCollision._current.maxDistance <= 1.2000000476837158 * (double)num && !Mod.Instance.FreeCamera) { __instance._strafeToggle = true; } else { __instance._strafeToggle = false; ((Component)__instance).transform.rotation = Mod.Instance.prevRotation; } if (SettingsManager._current._inputStrafeWhileHoldingWeapon.isOn) { __instance._strafeToggle = (int)__instance._pCombat._currentSheathCondition == 1; } if (SettingsManager._current._inputStrafeWhileCastingOffensiveSkill.isOn) { if (Object.op_Implicit((Object)(object)__instance._pCasting._currentCastSkill) && __instance._pCasting._currentCastSkill._strafeDirection) { __instance._strafeToggle = true; } if (__instance._castStrafeLock) { __instance._strafeToggle = true; } } bool flag = SettingsManager._current._inputStrafeWhileMoveAttack.isOn && ((double)InputControlManager.current._horiz_input != 0.0 || (double)InputControlManager.current._vert_input != 0.0); if (((((int)__instance._player._currentPlayerAction == 1) ? 1 : (__instance._pCombat._isChargingWeapon ? 1 : 0)) & (flag ? 1 : 0)) != 0) { __instance._strafeToggle = true; } else if (__instance._strafeToggleWasOn) { __instance._strafeToggle = false; } if ((double)__instance._disableStrafeBuffer > 0.0) { __instance._strafeToggle = false; } else if (InputControlManager.current.isLockDirectionToggled && __instance._strafeToggleWasOn && !__instance._strafeToggle) { __instance._strafeToggle = true; } if (__instance._lockControlMidair) { return; } if (!((double)__instance._attackForce <= 0.0) && ((__instance._attackForceInput != Vector3.zero) ? true : false)) { if (!__instance._strafeToggle) { ((Component)__instance).transform.rotation = Quaternion.LookRotation(__instance._attackForceInput); } else { Handle_StrafeRotation(); } } else if (__instance._strafeToggle) { Handle_StrafeRotation(); } else if (__instance._worldSpaceInput != Vector3.zero) { ((Component)__instance).transform.rotation = Quaternion.LookRotation(__instance._worldSpaceInput); } void Handle_StrafeRotation() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) ((Component)__instance).transform.rotation = Quaternion.Euler(0f, CameraFunction._current._RotY, 0f); } } } [HarmonyPatch(typeof(PlayerTargeting), "Client_EndTarget")] internal static class PlayerTargeting__Client_EndTarget { [HarmonyPrefix] internal static void SaveAdjustedPosition() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) Mod.Instance.prevPositionAdjust = CameraFunction._current.positionAdjust; } [HarmonyPostfix] internal static void SetAdjustedPosition() { //IL_000b: 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) CameraFunction._current.positionAdjust = Mod.Instance.prevPositionAdjust; } } [HarmonyPatch(typeof(RaceModelEquipDisplay), "Apply_EquipmentVisualDisplay")] internal static class RaceModelEquipDisplay__Apply_EquipmentVisualDisplay { [HarmonyPostfix] internal static void HeadDisplay(RaceModelEquipDisplay __instance) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown if ((Object)(object)Player._mainPlayer == (Object)null || (int)Player._mainPlayer._currentGameCondition != 1 || !((Object)(object)__instance._player == (Object)(object)Player._mainPlayer)) { return; } if (Object.op_Implicit((Object)(object)__instance._pEquip._equips["Helm"]._scriptableEquip)) { ScriptableHelm val = (ScriptableHelm)__instance._pEquip._equips["Helm"]._scriptableEquip; if (val._isFullHelm && !__instance._hideHelmVisual) { return; } } if (Object.op_Implicit((Object)(object)__instance._pEquip._equips["Helm"]._vanityEquip)) { ScriptableHelm val2 = (ScriptableHelm)__instance._pEquip._equips["Helm"]._vanityEquip; if (val2._isFullHelm && !__instance._hideVanityHelm) { return; } } __instance._playerRaceModel.Init_CullHead(!Mod.Instance.displayHead); __instance._playerRaceModel._hideEars = !Mod.Instance.displayHead; __instance._playerRaceModel.Apply_CharacterDisplay(); } } [HarmonyPatch(typeof(SettingsManager), "Apply_CameraParameters")] internal static class SettingsManager__Apply_CameraParameters { [HarmonyPostfix] internal static void RenderDistancePostfix(SettingsManager __instance) { if (Object.op_Implicit((Object)(object)CameraFunction._current)) { CameraFunction._current._mainCamera.farClipPlane = Mod.RenderDistance.Value; CameraFunction._current._UICamera.farClipPlane = Mod.RenderDistance.Value; } } } }