Decompiled source of enforcerstareslovinglyintoyoureyes v1.0.1

enforcerstareslovinglyintoyoureyes.dll

Decompiled a day ago
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.Configuration;
using BepInEx.Logging;
using HG.Reflection;
using Microsoft.CodeAnalysis;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using UnityEngine;
using UnityHotReloadNS;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("enforcerstareslovinglyintoyoureyes")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+c36324f6c70f093084d781f3b7c0da257de14b67")]
[assembly: AssemblyProduct("enforcerstareslovinglyintoyoureyes")]
[assembly: AssemblyTitle("enforcerstareslovinglyintoyoureyes")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
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 enforcerstareslovinglyintoyoureyes
{
	[BepInPlugin("kina.enforcerstareslovinglyintoyoureyes", "enforcerstareslovinglyintoyoureyes", "1.0.1")]
	public class enforcerstareslovinglyintoyoureyes : BaseUnityPlugin
	{
		private const string PluginGUID = "kina.enforcerstareslovinglyintoyoureyes";

		private const string PluginAuthor = "kina";

		private const string PluginName = "enforcerstareslovinglyintoyoureyes";

		private const string PluginVersion = "1.0.1";

		private static AssetBundle oldIconBundle;

		public void Awake()
		{
			Log.Init(((BaseUnityPlugin)this).Logger);
			oldIconBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "enforcerstareslovinglyintoyoureyes"));
			RoR2Application.onLoadFinished = (Action)Delegate.Combine(RoR2Application.onLoadFinished, new Action(OnLoadFinished));
		}

		private void OnLoadFinished()
		{
			if ((Object)(object)BodyPrefabs.Enforcer2Body != (Object)null && (Object)(object)oldIconBundle != (Object)null)
			{
				BodyPrefabs.Enforcer2Body.portraitIcon = oldIconBundle.LoadAsset<Texture>("texEnforcer2BodyIconOld");
			}
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	internal static class UHRSupport
	{
		internal static void hotReload(Assembly assembly, string path)
		{
			UnityHotReload.LoadNewAssemblyVersion(assembly, path);
		}
	}
	public static class Utils
	{
		public static void SliderConfig(float min, float max, ConfigEntry<float> config)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			StepSliderConfig val = new StepSliderConfig
			{
				max = max,
				min = min,
				FormatString = "{0:0}"
			};
			StepSliderOption val2 = new StepSliderOption(config, val);
			ModSettingsManager.AddOption((BaseOption)(object)val2);
		}

		public static void SliderConfig(int min, int max, ConfigEntry<int> config)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			IntSliderConfig val = new IntSliderConfig
			{
				max = max,
				min = min,
				formatString = "{0:0}"
			};
			IntSliderOption val2 = new IntSliderOption(config, val);
			ModSettingsManager.AddOption((BaseOption)(object)val2);
		}

		public static void CheckboxConfig(ConfigEntry<bool> config, bool restartRequired = false)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			CheckBoxConfig val = new CheckBoxConfig();
			((BaseOptionConfig)val).restartRequired = restartRequired;
			CheckBoxOption val2 = new CheckBoxOption(config, val);
			ModSettingsManager.AddOption((BaseOption)(object)val2);
		}

		public static void StringConfig(ConfigEntry<string> config)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			InputFieldConfig val = new InputFieldConfig();
			StringInputFieldOption val2 = new StringInputFieldOption(config, val);
			ModSettingsManager.AddOption((BaseOption)(object)val2);
		}

		public static void KeyboardConfig(ConfigEntry<KeyboardShortcut> config)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			KeyBindConfig val = new KeyBindConfig();
			KeyBindOption val2 = new KeyBindOption(config, val);
			ModSettingsManager.AddOption((BaseOption)(object)val2);
		}
	}
}