using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using DarkMachine.UI; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [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 = ".NET Standard 2.1")] [assembly: AssemblyCompany("MoreFOV")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("MoreFOV")] [assembly: AssemblyTitle("MoreFOV")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace MoreFOV { [BepInPlugin("Bryan_-000-.MoreFOV", "MoreFOV", "1.0.0")] public class Plugin : BaseUnityPlugin { public static class PluginInfo { public const string GUID = "Bryan_-000-.MoreFOV"; public const string Name = "MoreFOV"; public const string Version = "1.0.0"; public static Harmony Harm { get; internal set; } } [CompilerGenerated] private sealed class d__3 : IEnumerable, IEnumerable, IEnumerator, IEnumerator, IDisposable { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable instructions; public IEnumerable <>3__instructions; private MethodInfo 5__1; private FieldInfo 5__2; private CodeInstruction[] 5__3; private int 5__4; private CodeInstruction 5__5; CodeInstruction IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; 5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Expected O, but got Unknown //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Expected O, but got Unknown //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = AccessTools.Method(typeof(Mathf), "Clamp", new Type[3] { typeof(float), typeof(float), typeof(float) }, (Type[])null); 5__2 = AccessTools.Field(typeof(ENT_Player), "curFOV"); 5__3 = instructions.ToArray(); 5__4 = 0; goto IL_01e7; case 1: <>1__state = -1; <>2__current = new CodeInstruction(OpCodes.Pop, (object)null); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = new CodeInstruction(OpCodes.Ldc_R4, (object)0f); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = new CodeInstruction(OpCodes.Ldc_R4, (object)180f); <>1__state = 4; return true; case 4: <>1__state = -1; goto IL_01b3; case 5: { <>1__state = -1; 5__5 = null; 5__4++; goto IL_01e7; } IL_01e7: if (5__4 < 5__3.Length) { 5__5 = 5__3[5__4]; if (CodeInstructionExtensions.Calls(5__5, 5__1) && CodeInstructionExtensions.Is(5__3[5__4 + 1], OpCodes.Stfld, (MemberInfo)5__2)) { <>2__current = new CodeInstruction(OpCodes.Pop, (object)null); <>1__state = 1; return true; } goto IL_01b3; } return false; IL_01b3: <>2__current = 5__5; <>1__state = 5; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__3 d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; d__ = this; } else { d__ = new d__3(0); } d__.instructions = <>3__instructions; return d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } public void Awake() { PluginInfo.Harm = Harmony.CreateAndPatchAll(((object)this).GetType(), "Bryan_-000-.MoreFOV"); } [HarmonyPostfix] [HarmonyPatch(typeof(UI_SettingsMenu), "Start")] public static void EditFOV(UI_SettingsMenu __instance) { Transform transform = ((Component)__instance).transform; Transform val = transform.Find("SettingsParent/Settings Pane/Video Settings/Options Tab/Video/SliderAsset - FOV/Slider"); SubmitSlider component = ((Component)val).GetComponent(); component.maxValue = 180f; component.minValue = 0f; component.value = SettingsManager.settings.playerFOV; } [IteratorStateMachine(typeof(d__3))] [HarmonyTranspiler] [HarmonyPatch(typeof(ENT_Player), "FixedUpdate")] public static IEnumerable DontClampFOV(IEnumerable instructions) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(-2) { <>3__instructions = instructions }; } } }