Decompiled source of UltrawideOrLongFix v0.1.2

UltrawideOrLongFix.dll

Decompiled a day 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 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: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("UltrawideOrLongFix")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("UltrawideOrLongFix")]
[assembly: AssemblyTitle("UltrawideOrLongFix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.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 UltrawideOrLongFix
{
	[BepInPlugin("Oksamies.UltrawideOrLongFix", "UltrawideOrLongFix", "0.1.2")]
	public class Plugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(GraphicsManager), "Update")]
		public class AwakePatch
		{
			public static void Prefix()
			{
				//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0103: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
				if (!(GraphicsManager.instance.fullscreenCheckTimer <= 0f))
				{
					return;
				}
				GameObject val = GameObject.Find("Render Texture Overlay");
				GameObject val2 = GameObject.Find("Render Texture Main");
				if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val2))
				{
					return;
				}
				RectTransform component = val.gameObject.GetComponent<RectTransform>();
				RectTransform component2 = val2.gameObject.GetComponent<RectTransform>();
				if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2))
				{
					float num = (float)Screen.width / (float)Screen.height;
					if (num > 1.7777778f)
					{
						component.sizeDelta = new Vector2(428f * num, 428f);
						component2.sizeDelta = new Vector2(428f * num, 428f);
					}
					else
					{
						component.sizeDelta = new Vector2(750f, 750f / num);
						component2.sizeDelta = new Vector2(750f, 750f / num);
					}
				}
			}
		}

		public const string modGUID = "Oksamies.UltrawideOrLongFix";

		public const string modName = "UltrawideOrLongFix";

		public const string modVersion = "0.1.2";

		private readonly Harmony harmony = new Harmony("Oksamies.UltrawideOrLongFix");

		public static ManualLogSource mls;

		private void Awake()
		{
			mls = Logger.CreateLogSource("Oksamies.UltrawideOrLongFix");
			mls.LogInfo((object)"Oksamies.UltrawideOrLongFix is now awake!");
			harmony.PatchAll();
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "UltrawideOrLongFix";

		public const string PLUGIN_NAME = "UltrawideOrLongFix";

		public const string PLUGIN_VERSION = "0.1.0";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}