Decompiled source of ZoomOutMod v1.0.3

ZoomOutMod.dll

Decompiled 2 days 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.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("ZoomOutMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+bf89420a94a9e6637fe92d4c407a6ddd620c07a2")]
[assembly: AssemblyProduct("ZoomOutMod")]
[assembly: AssemblyTitle("ZoomOutMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 ZoomOutMod
{
	[BepInPlugin("com.github.antigravity.zoomoutmod", "Zoom Out Mod", "1.0.0")]
	public class Plugin : BasePlugin
	{
		public static ManualLogSource? Log;

		private Harmony? _harmony;

		public static ConfigEntry<float>? MaxZoomMultiplier;

		public override void Load()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Expected O, but got Unknown
			Log = ((BasePlugin)this).Log;
			Log.LogInfo((object)"Sineus Arena Zoom Out Mod is initializing...");
			try
			{
				MaxZoomMultiplier = ((BasePlugin)this).Config.Bind<float>("Settings", "MaxZoomMultiplier", 2f, "Multiplier for the maximum camera zoom out distance (e.g. 2.0 doubles it).");
				_harmony = new Harmony("com.github.antigravity.zoomoutmod");
				_harmony.PatchAll();
				Log.LogInfo((object)"Harmony patches for Zoom Out Mod applied successfully!");
			}
			catch (Exception ex)
			{
				Log.LogError((object)("Failed to initialize Zoom Out Mod: " + ex));
			}
		}
	}
	[HarmonyPatch(typeof(CameraScrollZoom), "Awake")]
	public static class CameraScrollZoom_Awake_Patch
	{
		[HarmonyPostfix]
		public static void Postfix(CameraScrollZoom __instance)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			try
			{
				float maxCameraDistance = __instance.maxCameraDistance;
				float num = Plugin.MaxZoomMultiplier?.Value ?? 2f;
				float num2 = (__instance.maxCameraDistance = maxCameraDistance * num);
				ManualLogSource log = Plugin.Log;
				if (log != null)
				{
					bool flag = default(bool);
					BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(76, 3, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[CameraScrollZoom] Applied multiplier ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(". Modified maxCameraDistance from ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(maxCameraDistance);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" to ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num2);
					}
					log.LogInfo(val);
				}
			}
			catch (Exception ex)
			{
				ManualLogSource? log2 = Plugin.Log;
				if (log2 != null)
				{
					log2.LogError((object)("Error in CameraScrollZoom Awake Postfix: " + ex));
				}
			}
		}
	}
	[HarmonyPatch(typeof(CinemachineZoomController), "Start")]
	public static class CinemachineZoomController_Start_Patch
	{
		[HarmonyPostfix]
		public static void Postfix(CinemachineZoomController __instance)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			try
			{
				float maxDistance = __instance.maxDistance;
				float num = Plugin.MaxZoomMultiplier?.Value ?? 2f;
				float num2 = (__instance.maxDistance = maxDistance * num);
				ManualLogSource log = Plugin.Log;
				if (log != null)
				{
					bool flag = default(bool);
					BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(79, 3, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[CinemachineZoomController] Applied multiplier ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(". Modified maxDistance from ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(maxDistance);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" to ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<float>(num2);
					}
					log.LogInfo(val);
				}
			}
			catch (Exception ex)
			{
				ManualLogSource? log2 = Plugin.Log;
				if (log2 != null)
				{
					log2.LogError((object)("Error in CinemachineZoomController Start Postfix: " + ex));
				}
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte b)
		{
			NullableFlags = new byte[1] { b };
		}

		public NullableAttribute(byte[] flags)
		{
			NullableFlags = flags;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}