using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FOV_Changer;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
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("FOV_Changer")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyInformationalVersion("3.0.0")]
[assembly: AssemblyProduct("FOV Changer")]
[assembly: AssemblyTitle("FOV_Changer")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("3.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;
}
}
}
public class util
{
public static Texture2D LoadEmbeddedTexture(string resourceName)
{
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Expected O, but got Unknown
Assembly executingAssembly = Assembly.GetExecutingAssembly();
using Stream stream = executingAssembly.GetManifestResourceStream(resourceName);
if (stream == null)
{
Plugin.Logger.LogError((object)("Embedded resource '" + resourceName + "' not found"));
return null;
}
byte[] array = new byte[stream.Length];
stream.Read(array, 0, array.Length);
Texture2D val = new Texture2D(2, 2);
if (ImageConversion.LoadImage(val, array))
{
return val;
}
Plugin.Logger.LogError((object)"Failed to load embedded texture");
return null;
}
}
namespace FOV_ChangerPatches
{
public class func
{
public static float GetDirectionValue(Vector3 velocity, Transform playerTransform)
{
//IL_0003: 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_001b: 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)
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(velocity.x, 0f, velocity.z);
float num = Vector3.Dot(((Vector3)(ref val)).normalized, playerTransform.forward);
return Mathf.Clamp(num, -1f, 1f);
}
}
[HarmonyPatch(typeof(CameraController), "Update")]
public class CameraControllerPatch
{
public static void Prefix(ref CameraController __instance)
{
if (Plugin.fovEnabled.value && Plugin.modEnabled.value)
{
if (!Plugin.ogFovSet)
{
Plugin.ogFov = __instance.defaultFov;
Plugin.ogFovSet = true;
}
__instance.defaultFov = Plugin.fov.value;
}
else if (Plugin.ogFovSet)
{
__instance.defaultFov = Plugin.ogFov;
Plugin.ogFovSet = false;
}
}
public static void Postfix(ref CameraController __instance, ref Camera ___hudCamera)
{
//IL_0287: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_028e: 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_0301: Unknown result type (might be due to invalid IL or missing references)
//IL_0303: 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_0450: Unknown result type (might be due to invalid IL or missing references)
//IL_0480: 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)
if (!Plugin.modEnabled.value)
{
return;
}
float num = 0f;
if (__instance.pm.sliding)
{
if (__instance.dodgeDirection == 0)
{
num = (Plugin.forwardSlidingMultiplierEnabled.value ? (__instance.defaultFov / 20f * Plugin.forwardSlidingMultiplier.value) : (__instance.defaultFov / 20f));
__instance.cam.fieldOfView = __instance.defaultFov - num;
}
else if (__instance.dodgeDirection == 1)
{
num = (Plugin.backwardSlidingMultiplierEnabled.value ? (__instance.defaultFov / 10f * Plugin.backwardSlidingMultiplier.value) : (__instance.defaultFov / 10f));
__instance.cam.fieldOfView = __instance.defaultFov + num;
}
}
else if (__instance.pm.boost && !__instance.pm.sliding)
{
if (__instance.dodgeDirection == 0)
{
num = (Plugin.forwardDashingMultiplierEnabled.value ? (__instance.defaultFov / 20f * Plugin.forwardDashingMultiplier.value) : (__instance.defaultFov / 20f));
__instance.cam.fieldOfView = __instance.defaultFov - num;
}
else if (__instance.dodgeDirection == 1)
{
num = (Plugin.backwardDashingMultiplierEnabled.value ? (__instance.defaultFov / 10f * Plugin.backwardDashingMultiplier.value) : (__instance.defaultFov / 10f));
__instance.cam.fieldOfView = __instance.defaultFov + num;
}
}
if (__instance.pm.gc.heavyFall || (Plugin.ignoreVelocityIfSliding.value && __instance.pm.sliding) || (Plugin.ignoreVelocityIfDashing.value && __instance.pm.boost && !__instance.pm.sliding))
{
return;
}
if (__instance.dodgeDirection == 0)
{
num = 0f - num;
}
if (Plugin.forwardVelocityMultiplierEnabled.value)
{
Vector3 playerVelocity = MonoSingleton<PlayerTracker>.Instance.GetPlayerVelocity(Plugin.trueVelocity.value);
float directionValue = func.GetDirectionValue(playerVelocity, ((Component)__instance).transform);
if (directionValue > 0f)
{
__instance.cam.fieldOfView = __instance.defaultFov - directionValue * ((Vector3)(ref playerVelocity)).magnitude * Plugin.forwardVelocityMultiplier.value + num;
}
}
if (Plugin.backwardVelocityMultiplierEnabled.value)
{
Vector3 playerVelocity2 = MonoSingleton<PlayerTracker>.Instance.GetPlayerVelocity(Plugin.trueVelocity.value);
float directionValue2 = func.GetDirectionValue(playerVelocity2, ((Component)__instance).transform);
if (directionValue2 < 0f)
{
__instance.cam.fieldOfView = __instance.defaultFov - directionValue2 * ((Vector3)(ref playerVelocity2)).magnitude * Plugin.backwardVelocityMultiplier.value + num;
}
}
Transform val = ((Component)__instance.cam).transform.Find("Guns");
if ((Object)(object)val != (Object)null)
{
val.localScale = new Vector3(Plugin.gunScaleX.value, Plugin.gunScaleY.value, Plugin.gunScaleZ.value);
}
Transform val2 = ((Component)__instance.cam).transform.Find("Punch");
if ((Object)(object)val2 != (Object)null)
{
val2.localScale = new Vector3(Plugin.armScaleX.value, Plugin.armScaleY.value, Plugin.armScaleZ.value);
}
__instance.cam.farClipPlane = Plugin.farCutoffDistance.value;
__instance.cam.nearClipPlane = Plugin.nearCutoffDistance.value;
__instance.cam.rect = new Rect(0f, 0f, 1f / Plugin.sidewaysStretchMultiplier.value, 1f / Plugin.forwardStretchMultiplier.value);
((Component)___hudCamera).transform.localScale = new Vector3(Plugin.hudScaleX.value, Plugin.hudScaleY.value, Plugin.hudScaleZ.value);
}
}
}
namespace FOV_Changer
{
[BepInPlugin("billy.fov_changer", "FOV Changer", "3.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static FloatValueChangeEventDelegate <>9__38_8;
public static FloatValueChangeEventDelegate <>9__38_9;
public static FloatValueChangeEventDelegate <>9__38_10;
public static FloatValueChangeEventDelegate <>9__38_11;
internal void <Awake>b__38_8(FloatValueChangeEvent e)
{
if (e.value <= 0f)
{
forwardStretchMultiplier.value = 1f;
e.value = 1f;
}
}
internal void <Awake>b__38_9(FloatValueChangeEvent e)
{
if (e.value <= 0f)
{
sidewaysStretchMultiplier.value = 1f;
e.value = 1f;
}
}
internal void <Awake>b__38_10(FloatValueChangeEvent e)
{
if (e.value <= 0.1f)
{
farCutoffDistance.value = 0.11f;
e.value = 0.11f;
}
}
internal void <Awake>b__38_11(FloatValueChangeEvent e)
{
if (e.value <= 0f)
{
nearCutoffDistance.value = 0.01f;
e.value = 0.01f;
}
}
}
private static readonly Harmony Harmony = new Harmony("billy.fov_changer");
internal static ManualLogSource Logger;
private static PluginConfigurator config;
public static Texture2D fovSquareTexture = util.LoadEmbeddedTexture("FOV_Changer.assets.fov_square.png");
public static Sprite fovSquareSprite = Sprite.Create(fovSquareTexture, new Rect(0f, 0f, (float)((Texture)fovSquareTexture).width, (float)((Texture)fovSquareTexture).height), new Vector2(0.5f, 0.5f), 100f);
public static BoolField modEnabled;
public static BoolField fovEnabled;
public static IntField fov;
public static bool ogFovSet;
public static float ogFov;
public static BoolField forwardSlidingMultiplierEnabled;
public static FloatField forwardSlidingMultiplier;
public static BoolField backwardSlidingMultiplierEnabled;
public static FloatField backwardSlidingMultiplier;
public static BoolField forwardDashingMultiplierEnabled;
public static FloatField forwardDashingMultiplier;
public static BoolField backwardDashingMultiplierEnabled;
public static FloatField backwardDashingMultiplier;
public static BoolField ignoreVelocityIfSliding;
public static BoolField ignoreVelocityIfDashing;
public static BoolField trueVelocity;
public static BoolField forwardVelocityMultiplierEnabled;
public static FloatField forwardVelocityMultiplier;
public static BoolField backwardVelocityMultiplierEnabled;
public static FloatField backwardVelocityMultiplier;
public static FloatField hudScaleX;
public static FloatField hudScaleY;
public static FloatField hudScaleZ;
public static FloatField gunScaleX;
public static FloatField gunScaleY;
public static FloatField gunScaleZ;
public static FloatField armScaleX;
public static FloatField armScaleY;
public static FloatField armScaleZ;
public static FloatField forwardStretchMultiplier;
public static FloatField sidewaysStretchMultiplier;
public static FloatField farCutoffDistance;
public static FloatField nearCutoffDistance;
private void Awake()
{
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Expected O, but got Unknown
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Expected O, but got Unknown
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Expected O, but got Unknown
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Expected O, but got Unknown
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Expected O, but got Unknown
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Expected O, but got Unknown
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Expected O, but got Unknown
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Expected O, but got Unknown
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Expected O, but got Unknown
//IL_017d: Unknown result type (might be due to invalid IL or missing references)
//IL_0187: Expected O, but got Unknown
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Expected O, but got Unknown
//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: Expected O, but got Unknown
//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
//IL_01d3: Expected O, but got Unknown
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Expected O, but got Unknown
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_01fa: Expected O, but got Unknown
//IL_0210: Unknown result type (might be due to invalid IL or missing references)
//IL_021a: Expected O, but got Unknown
//IL_0222: Unknown result type (might be due to invalid IL or missing references)
//IL_0234: Unknown result type (might be due to invalid IL or missing references)
//IL_023e: Expected O, but got Unknown
//IL_0245: Unknown result type (might be due to invalid IL or missing references)
//IL_024f: Expected O, but got Unknown
//IL_025b: Unknown result type (might be due to invalid IL or missing references)
//IL_0265: Expected O, but got Unknown
//IL_027b: Unknown result type (might be due to invalid IL or missing references)
//IL_0285: Expected O, but got Unknown
//IL_0291: Unknown result type (might be due to invalid IL or missing references)
//IL_029b: Expected O, but got Unknown
//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
//IL_02ac: Expected O, but got Unknown
//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
//IL_02c2: Expected O, but got Unknown
//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
//IL_02e2: Expected O, but got Unknown
//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0304: Unknown result type (might be due to invalid IL or missing references)
//IL_0311: Unknown result type (might be due to invalid IL or missing references)
//IL_031b: Expected O, but got Unknown
//IL_032c: Unknown result type (might be due to invalid IL or missing references)
//IL_0336: Expected O, but got Unknown
//IL_0347: Unknown result type (might be due to invalid IL or missing references)
//IL_0351: Expected O, but got Unknown
//IL_035e: Unknown result type (might be due to invalid IL or missing references)
//IL_0375: Unknown result type (might be due to invalid IL or missing references)
//IL_037f: Expected O, but got Unknown
//IL_038c: Unknown result type (might be due to invalid IL or missing references)
//IL_039e: Unknown result type (might be due to invalid IL or missing references)
//IL_03a8: Expected O, but got Unknown
//IL_03af: Unknown result type (might be due to invalid IL or missing references)
//IL_03b9: Expected O, but got Unknown
//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
//IL_03cf: Expected O, but got Unknown
//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
//IL_03ef: Expected O, but got Unknown
//IL_041d: Unknown result type (might be due to invalid IL or missing references)
//IL_0427: Expected O, but got Unknown
//IL_042e: Unknown result type (might be due to invalid IL or missing references)
//IL_0438: Expected O, but got Unknown
//IL_0444: Unknown result type (might be due to invalid IL or missing references)
//IL_044e: Expected O, but got Unknown
//IL_0464: Unknown result type (might be due to invalid IL or missing references)
//IL_046e: Expected O, but got Unknown
//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
//IL_04d7: Expected O, but got Unknown
//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
//IL_04eb: Unknown result type (might be due to invalid IL or missing references)
//IL_0501: Unknown result type (might be due to invalid IL or missing references)
//IL_050b: Expected O, but got Unknown
//IL_051b: Unknown result type (might be due to invalid IL or missing references)
//IL_0525: Expected O, but got Unknown
//IL_0535: Unknown result type (might be due to invalid IL or missing references)
//IL_053f: Expected O, but got Unknown
//IL_054f: Unknown result type (might be due to invalid IL or missing references)
//IL_0555: Expected O, but got Unknown
//IL_055b: Unknown result type (might be due to invalid IL or missing references)
//IL_0569: Unknown result type (might be due to invalid IL or missing references)
//IL_057f: Unknown result type (might be due to invalid IL or missing references)
//IL_0589: Expected O, but got Unknown
//IL_0599: Unknown result type (might be due to invalid IL or missing references)
//IL_05a3: Expected O, but got Unknown
//IL_05b3: Unknown result type (might be due to invalid IL or missing references)
//IL_05bd: Expected O, but got Unknown
//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
//IL_05d4: Expected O, but got Unknown
//IL_05db: Unknown result type (might be due to invalid IL or missing references)
//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
//IL_0601: Unknown result type (might be due to invalid IL or missing references)
//IL_060b: Expected O, but got Unknown
//IL_061c: Unknown result type (might be due to invalid IL or missing references)
//IL_0626: Expected O, but got Unknown
//IL_0637: Unknown result type (might be due to invalid IL or missing references)
//IL_0641: Expected O, but got Unknown
//IL_0651: Unknown result type (might be due to invalid IL or missing references)
//IL_0658: Expected O, but got Unknown
//IL_065f: Unknown result type (might be due to invalid IL or missing references)
//IL_0676: Unknown result type (might be due to invalid IL or missing references)
//IL_0680: Expected O, but got Unknown
//IL_06bb: Unknown result type (might be due to invalid IL or missing references)
//IL_06c5: Expected O, but got Unknown
//IL_0699: Unknown result type (might be due to invalid IL or missing references)
//IL_069e: Unknown result type (might be due to invalid IL or missing references)
//IL_06a4: Expected O, but got Unknown
//IL_0700: Unknown result type (might be due to invalid IL or missing references)
//IL_070a: Expected O, but got Unknown
//IL_06de: Unknown result type (might be due to invalid IL or missing references)
//IL_06e3: Unknown result type (might be due to invalid IL or missing references)
//IL_06e9: Expected O, but got Unknown
//IL_0745: Unknown result type (might be due to invalid IL or missing references)
//IL_074f: Expected O, but got Unknown
//IL_0723: Unknown result type (might be due to invalid IL or missing references)
//IL_0728: Unknown result type (might be due to invalid IL or missing references)
//IL_072e: Expected O, but got Unknown
//IL_0768: Unknown result type (might be due to invalid IL or missing references)
//IL_076d: Unknown result type (might be due to invalid IL or missing references)
//IL_0773: Expected O, but got Unknown
Logger = ((BaseUnityPlugin)this).Logger;
Logger.LogInfo((object)"Plugin FOV_Changer is loaded!");
Harmony.PatchAll();
config = PluginConfigurator.Create("FOV Changer", "billy.fov_changer");
config.image = fovSquareSprite;
modEnabled = new BoolField(config.rootPanel, "Enable the whole mod", "modEnabled", true);
ConfigDivision allDiv = new ConfigDivision(config.rootPanel, "allDiv");
modEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)allDiv).interactable = e.value;
};
fovEnabled = new BoolField((ConfigPanel)(object)allDiv, "Enable FOV override", "fovEnabled", true);
ConfigDivision fovDiv = new ConfigDivision((ConfigPanel)(object)allDiv, "fovDiv");
fovEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)fovDiv).interactable = e.value;
};
fov = new IntField((ConfigPanel)(object)fovDiv, "FOV value", "fov", 170);
fov.maximumValue = 180;
fov.minimumValue = 0;
ConfigPanel val = new ConfigPanel((ConfigPanel)(object)allDiv, "More FOV options", "fovPanel");
new ConfigSpace(val, 10f);
new ConfigHeader(val, "The values below determine how much the FOV changes when you're sliding or dashing\r\n0 - FOV doesn't change\r\n0.5 - FOV change is half as strong\r\n1 - vanilla FOV change\r\n2 - FOV change is doubled\r\n-1 - FOV change direction is reversed", 16);
new ConfigHeader(val, "Sliding", 28);
forwardSlidingMultiplierEnabled = new BoolField(val, "Enable forward sliding multiplier", "forwardSlidingMultiplierEnabled", true);
ConfigDivision forwardSlidingDiv = new ConfigDivision(val, "forwardSlidingDiv");
forwardSlidingMultiplierEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)forwardSlidingDiv).interactable = e.value;
};
forwardSlidingMultiplier = new FloatField((ConfigPanel)(object)forwardSlidingDiv, "Forward sliding FOV multiplier", "forwardSlidingMultiplier", 0f);
backwardSlidingMultiplierEnabled = new BoolField(val, "Enable backward sliding multiplier", "backwardSlidingMultiplierEnabled", true);
ConfigDivision backwardSlidingDiv = new ConfigDivision(val, "backwardSlidingDiv");
backwardSlidingMultiplierEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)backwardSlidingDiv).interactable = e.value;
};
backwardSlidingMultiplier = new FloatField((ConfigPanel)(object)backwardSlidingDiv, "Backward sliding FOV multiplier", "backwardSlidingMultiplier", 0f);
new ConfigHeader(val, "Dashing", 28);
forwardDashingMultiplierEnabled = new BoolField(val, "Enable forward dashing multiplier", "forwardDashingMultiplierEnabled", true);
ConfigDivision forwardDashingDiv = new ConfigDivision(val, "forwardDashingDiv");
forwardDashingMultiplierEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)forwardDashingDiv).interactable = e.value;
};
forwardDashingMultiplier = new FloatField((ConfigPanel)(object)forwardDashingDiv, "Forward dashing FOV multiplier", "forwardDashingMultiplier", 0.35f);
backwardDashingMultiplierEnabled = new BoolField(val, "Enable backward dashing multiplier", "backwardDashingMultiplierEnabled", true);
ConfigDivision backwardDashingDiv = new ConfigDivision(val, "backwardDashingDiv");
backwardDashingMultiplierEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)backwardDashingDiv).interactable = e.value;
};
backwardDashingMultiplier = new FloatField((ConfigPanel)(object)backwardDashingDiv, "Backward dashing FOV multiplier", "backwardDashingMultiplier", 0.25f);
new ConfigSpace(val, 10f);
new ConfigHeader(val, "Velocity-based", 28);
new ConfigHeader(val, "The following settings determine how much the FOV changes based on your velocity\r\n0 - FOV doesn't change\r\n0.25 - FOV change is noticeable but not that strong\r\n1 - FOV change is the same as your velocity (which is way too much)", 16);
ConfigDivision velocityIgnoreDiv = new ConfigDivision(val, "velocityIgnoreDiv");
ignoreVelocityIfSliding = new BoolField((ConfigPanel)(object)velocityIgnoreDiv, "Prevent sliding velocity FOV change", "ignoreVelocityIfSliding", false);
ignoreVelocityIfDashing = new BoolField((ConfigPanel)(object)velocityIgnoreDiv, "Prevent dashing velocity FOV change", "ignoreVelocityIfDashing", true);
new ConfigHeader((ConfigPanel)(object)velocityIgnoreDiv, "When the options above are turned on, you'll always have the same FOV when sliding or dashing and it won't depend on how fast you're going", 14);
trueVelocity = new BoolField((ConfigPanel)(object)velocityIgnoreDiv, "Enable true velocity", "trueVelocity", false);
new ConfigHeader((ConfigPanel)(object)velocityIgnoreDiv, "When true velocity is disabled, dashing will affect the FOV 3 times less. This is the same reason why dashing with an Impact Hammer only counts as a green gauge", 14);
forwardVelocityMultiplierEnabled = new BoolField(val, "Enable forward velocity multiplier", "forwardVelocityMultiplierEnabled", false);
ConfigDivision forwardVelocityDiv = new ConfigDivision(val, "forwardVelocityDiv");
forwardVelocityMultiplierEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)forwardVelocityDiv).interactable = e.value;
if (!e.value && !backwardVelocityMultiplierEnabled.value)
{
((ConfigField)velocityIgnoreDiv).interactable = false;
}
else
{
((ConfigField)velocityIgnoreDiv).interactable = true;
}
};
forwardVelocityMultiplier = new FloatField((ConfigPanel)(object)forwardVelocityDiv, "Forward velocity FOV multiplier", "forwardVelocityMultiplier", 0.25f);
if (!forwardVelocityMultiplierEnabled.value)
{
((ConfigField)forwardVelocityDiv).interactable = false;
}
backwardVelocityMultiplierEnabled = new BoolField(val, "Enable backward velocity multiplier", "backwardVelocityMultiplierEnabled", false);
ConfigDivision backwardVelocityDiv = new ConfigDivision(val, "backwardVelocityDiv");
backwardVelocityMultiplierEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((ConfigField)backwardVelocityDiv).interactable = e.value;
if (!e.value && !forwardVelocityMultiplierEnabled.value)
{
((ConfigField)velocityIgnoreDiv).interactable = false;
}
else
{
((ConfigField)velocityIgnoreDiv).interactable = true;
}
};
backwardVelocityMultiplier = new FloatField((ConfigPanel)(object)backwardVelocityDiv, "Backward velocity FOV multiplier", "backwardVelocityMultiplier", 0.25f);
if (!backwardVelocityMultiplierEnabled.value)
{
((ConfigField)backwardVelocityDiv).interactable = false;
}
if (!backwardVelocityMultiplierEnabled.value && !forwardVelocityMultiplierEnabled.value)
{
((ConfigField)velocityIgnoreDiv).interactable = false;
}
ConfigPanel val2 = new ConfigPanel((ConfigPanel)(object)allDiv, "HUD options", "hudPanel");
new ConfigSpace(val2, 10f);
new ConfigHeader(val2, "X - horizontal strech\r\nY - vertical stretch\r\nZ - distance from the camera\r\nIf you want to change both X and Y to the same value, it's better to change Z to the inverse of that value to prevent particles from looking weird, e.g. instead of X = 0.25 and Y = 0.25 it's better to do Z = 4", 16);
hudScaleX = new FloatField(val2, "HUD scale X", "hudScaleX", 1f);
hudScaleY = new FloatField(val2, "HUD scale Y", "hudScaleY", 1f);
hudScaleZ = new FloatField(val2, "HUD scale Z", "hudScaleZ", 1f);
ConfigPanel val3 = new ConfigPanel((ConfigPanel)(object)allDiv, "Weapon options", "gunPanel");
new ConfigSpace(val3, 10f);
new ConfigHeader(val3, "X - horizontal strech\r\nY - vertical stretch\r\nZ - distance from the camera\r\nIf you want to change both X and Y to the same value, it's better to change Z to the inverse of that value to prevent particles from looking weird, e.g. instead of X = 0.25 and Y = 0.25 it's better to do Z = 4", 16);
gunScaleX = new FloatField(val3, "Weapon scale X", "gunScaleX", 1f);
gunScaleY = new FloatField(val3, "Weapon scale Y", "gunScaleY", 1f);
gunScaleZ = new FloatField(val3, "Weapon scale Z", "gunScaleZ", 1f);
ConfigPanel val4 = new ConfigPanel((ConfigPanel)(object)allDiv, "Arm options", "armPanel");
new ConfigSpace(val4, 10f);
new ConfigHeader(val4, "X - horizontal strech\r\nY - vertical stretch\r\nZ - distance from the camera\r\nIf you want to change both X and Y to the same value, it's better to change Z to the inverse of that value to prevent particles from looking weird, e.g. instead of X = 0.25 and Y = 0.25 it's better to do Z = 4", 16);
armScaleX = new FloatField(val4, "Arm scale X", "armScaleX", 1f);
armScaleY = new FloatField(val4, "Arm scale Y", "armScaleY", 1f);
armScaleZ = new FloatField(val4, "Arm scale Z", "armScaleZ", 1f);
ConfigPanel val5 = new ConfigPanel((ConfigPanel)(object)allDiv, "Other options", "otherPanel");
new ConfigSpace(val5, 10f);
forwardStretchMultiplier = new FloatField(val5, "Forward stretch multiplier", "forwardStretchMultiplier", 1f);
FloatField obj = forwardStretchMultiplier;
object obj2 = <>c.<>9__38_8;
if (obj2 == null)
{
FloatValueChangeEventDelegate val6 = delegate(FloatValueChangeEvent e)
{
if (e.value <= 0f)
{
forwardStretchMultiplier.value = 1f;
e.value = 1f;
}
};
<>c.<>9__38_8 = val6;
obj2 = (object)val6;
}
obj.onValueChange += (FloatValueChangeEventDelegate)obj2;
sidewaysStretchMultiplier = new FloatField(val5, "Sideways stretch multiplier", "sidewaysStretchMultiplier", 1f);
FloatField obj3 = sidewaysStretchMultiplier;
object obj4 = <>c.<>9__38_9;
if (obj4 == null)
{
FloatValueChangeEventDelegate val7 = delegate(FloatValueChangeEvent e)
{
if (e.value <= 0f)
{
sidewaysStretchMultiplier.value = 1f;
e.value = 1f;
}
};
<>c.<>9__38_9 = val7;
obj4 = (object)val7;
}
obj3.onValueChange += (FloatValueChangeEventDelegate)obj4;
farCutoffDistance = new FloatField(val5, "Far cutoff distance", "farCutoffDistance", 4000f);
FloatField obj5 = farCutoffDistance;
object obj6 = <>c.<>9__38_10;
if (obj6 == null)
{
FloatValueChangeEventDelegate val8 = delegate(FloatValueChangeEvent e)
{
if (e.value <= 0.1f)
{
farCutoffDistance.value = 0.11f;
e.value = 0.11f;
}
};
<>c.<>9__38_10 = val8;
obj6 = (object)val8;
}
obj5.onValueChange += (FloatValueChangeEventDelegate)obj6;
nearCutoffDistance = new FloatField(val5, "Near cutoff distance", "nearCutoffDistance", 0.1f);
FloatField obj7 = nearCutoffDistance;
object obj8 = <>c.<>9__38_11;
if (obj8 == null)
{
FloatValueChangeEventDelegate val9 = delegate(FloatValueChangeEvent e)
{
if (e.value <= 0f)
{
nearCutoffDistance.value = 0.01f;
e.value = 0.01f;
}
};
<>c.<>9__38_11 = val9;
obj8 = (object)val9;
}
obj7.onValueChange += (FloatValueChangeEventDelegate)obj8;
if (!modEnabled.value)
{
((ConfigField)allDiv).interactable = false;
}
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "FOV_Changer";
public const string PLUGIN_NAME = "FOV Changer";
public const string PLUGIN_VERSION = "3.0.0";
}
}