Decompiled source of ScalableUI v0.1.0

BepInEx/plugins/CastleStory_ScalableUI.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Brix.UI.Scripts;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyCompany("CastleStory_ScalableUI")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("CastleStory: Scalable UI Plugin")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0+fc13c15f79e0a2e10e91e2c4daf5fe61c9a95104")]
[assembly: AssemblyProduct("CastleStory_ScalableUI")]
[assembly: AssemblyTitle("CastleStory_ScalableUI")]
[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 CastleStory_ScalableUI
{
	[BepInPlugin("CastleStory_ScalableUI", "CastleStory_ScalableUI", "0.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			Object.DontDestroyOnLoad((Object)new GameObject("UIScaler", new Type[1] { typeof(UIScalerComponent) }));
		}
	}
	public class UIScalerComponent : MonoBehaviour
	{
		private void Update()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKey((KeyCode)304) && Input.GetKey((KeyCode)308) && Input.mouseScrollDelta.y != 0f)
			{
				Object.FindObjectsOfType<CanvasScalerDriver>().ToList().SelectMany((CanvasScalerDriver driver) => driver.CanvasScalers)
					.ToList()
					.ForEach(delegate(CanvasScaler canvasScaler)
					{
						//IL_000c: Unknown result type (might be due to invalid IL or missing references)
						canvasScaler.scaleFactor += 0.1f * Input.mouseScrollDelta.y;
					});
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "CastleStory_ScalableUI";

		public const string PLUGIN_NAME = "CastleStory_ScalableUI";

		public const string PLUGIN_VERSION = "0.1.0";
	}
}