Decompiled source of CrosshairColorFixer v1.0.1

CrosshairColorFixer.dll

Decompiled 3 weeks 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 Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[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("CrosshairColorFixer")]
[assembly: AssemblyConfiguration("release")]
[assembly: AssemblyDescription("Changes the color of the health bar near the crosshair to the one specified in the settings")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1+45c389758882adb05cc409661052e6ae208a7c3c")]
[assembly: AssemblyProduct("CrosshairColorFixer")]
[assembly: AssemblyTitle("CrosshairColorFixer")]
[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 CrosshairColorFixer
{
	[BepInPlugin("xzxADIxzx.CorsshairColorFixer", "CrosshairColorFixer", "1.0.1")]
	public class PluginLoader : BaseUnityPlugin
	{
		private void Awake()
		{
			SceneManager.sceneLoaded += delegate
			{
				((MonoBehaviour)MonoSingleton<Plugin>.Instance).Invoke("ApplyFix", 0.1f);
			};
		}
	}
	[ConfigureSingleton(/*Could not decode attribute arguments.*/)]
	public class Plugin : MonoSingleton<Plugin>
	{
		private ColorBlindSettings cb => MonoSingleton<ColorBlindSettings>.Instance;

		private void ApplyFix()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			CanvasController instance = MonoSingleton<CanvasController>.Instance;
			object obj;
			if (instance == null)
			{
				obj = null;
			}
			else
			{
				Transform obj2 = ((Component)instance).transform.Find("Crosshair Filler/Crosshair/HealthBars");
				obj = ((obj2 != null) ? ((Component)obj2).GetComponentsInChildren<Image>(true) : null);
			}
			Image[] array = (Image[])obj;
			if (array != null && Object.op_Implicit((Object)(object)cb))
			{
				((Graphic)array[0]).color = cb.healthBarAfterImageColor;
				((Graphic)array[1]).color = cb.healthBarColor;
				((Graphic)array[2]).color = cb.antiHpColor;
				((Graphic)array[3]).color = cb.healthBarAfterImageColor;
				((Graphic)array[4]).color = cb.overHealColor;
			}
		}
	}
}