Decompiled source of LethalWidescreen v1.0.4

LethalWidescreen.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalWidescreen")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("A plugin for Lethal Company to support widescreen/ultrawidescreen monitors")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1")]
[assembly: AssemblyProduct("LethalWidescreen")]
[assembly: AssemblyTitle("LethalWidescreen")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.1.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 LethalWidescreen
{
	[BepInPlugin("LethalWidescreen", "LethalWidescreen", "1.0.1")]
	public class LethalWidescreen : BaseUnityPlugin
	{
		internal static ManualLogSource mls;

		private readonly Harmony harmony = new Harmony("LethalWidescreen");

		private static LethalWidescreen Instance;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("LethalWidescreen");
			mls.LogInfo((object)"Plugin LethalWidescreen is loaded!");
			harmony.PatchAll();
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LethalWidescreen";

		public const string PLUGIN_NAME = "LethalWidescreen";

		public const string PLUGIN_VERSION = "1.0.1";
	}
}
namespace LethalWidescreen.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("OnEnable")]
		private static void OnEnable()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			RectTransform component = GameObject.Find("Panel").GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0f, 0f);
			component.anchorMax = new Vector2(1f, 1f);
			component.pivot = new Vector2(0f, 1f);
			component.anchoredPosition = Vector2.zero;
			component.sizeDelta = Vector2.zero;
			ManualLogSource mls = LethalWidescreen.mls;
			float num = (float)Screen.width / ((float)Screen.height * 1.7777778f);
			mls.LogInfo((object)("!!! " + num + " set to xScaleFactor!"));
			((Transform)component).localScale = new Vector3(num + 0.1f, 1f, 1f);
		}

		[HarmonyPostfix]
		[HarmonyPatch("Update")]
		private static void LateUpdate(PlayerControllerB __instance)
		{
			Camera gameplayCamera = __instance.gameplayCamera;
			__instance.targetFOV = gameplayCamera.fieldOfView * 1.25f;
		}
	}
}