Decompiled source of CustomRankLetterColorizer v1.0.0

CustomRankLetterColorizer.dll

Decompiled 12 hours ago
using System;
using System.Collections.Generic;
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 System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using TMPro;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("CustomRankLetterColorizer")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CustomRankLetterColorizer")]
[assembly: AssemblyTitle("CustomRankLetterColorizer")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace CustomRankLetterColorizer;

[BepInPlugin("ali.uk.customrankcolor", "Custom Rank Letter Colorizer", "1.0.0")]
public class CustomRankLetterColorizerPlugin : BaseUnityPlugin
{
	public static ManualLogSource Log;

	public Color DColor = HexToColor("0094FF");

	public Color CColor = HexToColor("4CFF00");

	public Color BColor = HexToColor("FFD800");

	public Color AColor = HexToColor("FF6A00");

	public Color SColor = HexToColor("FF0000");

	public Color PColor = HexToColor("FFFFFF");

	public Color BorderColor = HexToColor("FFB100");

	private PluginConfigurator config;

	public static CustomRankLetterColorizerPlugin Instance { get; private set; }

	private void Awake()
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Expected O, but got Unknown
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Expected O, but got Unknown
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Expected O, but got Unknown
		//IL_0161: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Expected O, but got Unknown
		//IL_0194: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: Expected O, but got Unknown
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Expected O, but got Unknown
		//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01df: Expected O, but got Unknown
		//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fd: Expected O, but got Unknown
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_0219: Unknown result type (might be due to invalid IL or missing references)
		//IL_0220: Expected O, but got Unknown
		//IL_0223: Unknown result type (might be due to invalid IL or missing references)
		//IL_0228: Unknown result type (might be due to invalid IL or missing references)
		//IL_0236: Unknown result type (might be due to invalid IL or missing references)
		//IL_0240: Expected O, but got Unknown
		//IL_0257: Unknown result type (might be due to invalid IL or missing references)
		//IL_025c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0263: Expected O, but got Unknown
		//IL_0266: Unknown result type (might be due to invalid IL or missing references)
		//IL_026b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_0283: Expected O, but got Unknown
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_029f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a6: Expected O, but got Unknown
		//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c6: Expected O, but got Unknown
		//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02da: Expected O, but got Unknown
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		Instance = this;
		Log = ((BaseUnityPlugin)this).Logger;
		config = PluginConfigurator.Create("Rank Colorizer", "ali.uk.customrankcolor");
		try
		{
			Texture2D val = new Texture2D(2, 2);
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("CustomRankLetterColorizer.iconofalltime.png");
			if (stream != null)
			{
				byte[] array = new byte[stream.Length];
				stream.Read(array, 0, array.Length);
				ImageConversion.LoadImage(val, array);
				config.image = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
			}
			else
			{
				Log.LogWarning((object)"Made a fuck up whoops");
			}
		}
		catch (Exception)
		{
		}
		new ConfigHeader(config.rootPanel, "Change rank & medal colors", 24);
		ColorField val2 = new ColorField(config.rootPanel, "D Rank", "color_D", DColor);
		DColor = val2.value;
		val2.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			DColor = e.value;
			UpdateRankColorCache();
		};
		ColorField val3 = new ColorField(config.rootPanel, "C Rank", "color_C", CColor);
		CColor = val3.value;
		val3.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			CColor = e.value;
			UpdateRankColorCache();
		};
		ColorField val4 = new ColorField(config.rootPanel, "B Rank", "color_B", BColor);
		BColor = val4.value;
		val4.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			BColor = e.value;
			UpdateRankColorCache();
		};
		ColorField val5 = new ColorField(config.rootPanel, "A Rank", "color_A", AColor);
		AColor = val5.value;
		val5.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			AColor = e.value;
			UpdateRankColorCache();
		};
		ColorField val6 = new ColorField(config.rootPanel, "S Rank", "color_S", SColor);
		SColor = val6.value;
		val6.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			SColor = e.value;
			UpdateRankColorCache();
		};
		ColorField val7 = new ColorField(config.rootPanel, "P Rank", "color_P", PColor);
		PColor = val7.value;
		val7.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			PColor = e.value;
			UpdateRankColorCache();
		};
		ColorField val8 = new ColorField(config.rootPanel, "Gold Border", "color_border", BorderColor);
		BorderColor = val8.value;
		val8.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			BorderColor = e.value;
			UpdateRankColorCache();
		};
		UpdateRankColorCache();
		Harmony val9 = new Harmony("ali.uk.customrankcolor");
		val9.PatchAll();
		Log.LogInfo((object)"Enjoy ur ranks :3.");
	}

	private static Color HexToColor(string hex)
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		Color result = default(Color);
		if (ColorUtility.TryParseHtmlString("#" + hex, ref result))
		{
			return result;
		}
		return Color.white;
	}

	private void UpdateRankColorCache()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: 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_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		RankColors.D = DColor;
		RankColors.C = CColor;
		RankColors.B = BColor;
		RankColors.A = AColor;
		RankColors.S = SColor;
		RankColors.P = PColor;
		RankColors.GoldBorder = BorderColor;
	}
}
public static class RankColors
{
	public static Color D = (Color)(((??)CustomRankLetterColorizerPlugin.Instance?.DColor) ?? new Color(0f, 0.5843f, 1f));

	public static Color C = (Color)(((??)CustomRankLetterColorizerPlugin.Instance?.CColor) ?? new Color(0.298f, 1f, 0f));

	public static Color B = (Color)(((??)CustomRankLetterColorizerPlugin.Instance?.BColor) ?? new Color(1f, 0.847f, 0f));

	public static Color A = (Color)(((??)CustomRankLetterColorizerPlugin.Instance?.AColor) ?? new Color(1f, 0.415f, 0f));

	public static Color S = (Color)(((??)CustomRankLetterColorizerPlugin.Instance?.SColor) ?? new Color(1f, 0f, 0f));

	public static Color P = (Color)(((??)CustomRankLetterColorizerPlugin.Instance?.PColor) ?? new Color(1f, 1f, 1f));

	public static Color GoldBorder = (Color)(((??)CustomRankLetterColorizerPlugin.Instance?.BorderColor) ?? new Color(1f, 0.694f, 0f));

	public static Color GetColor(string rank)
	{
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		return (Color)(rank switch
		{
			"D" => D, 
			"C" => C, 
			"B" => B, 
			"A" => A, 
			"S" => S, 
			"P" => P, 
			_ => Color.white, 
		});
	}
}
[HarmonyPatch(typeof(TMP_Text), "set_text")]
internal static class RankTextPatch
{
	private static readonly Dictionary<string, string> RankHexPatterns = new Dictionary<string, string>
	{
		{ "0094FF", "D" },
		{ "4CFF00", "C" },
		{ "FFD800", "B" },
		{ "FF6A00", "A" },
		{ "FF0000", "S" },
		{ "FFFFFF", "P" },
		{ "FFAF00", "P" }
	};

	private static readonly Regex ColorTagRegex = new Regex("<color=#([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?>(.*?)</color>", RegexOptions.Compiled);

	private static void Prefix(ref string value)
	{
		if (string.IsNullOrEmpty(value))
		{
			return;
		}
		value = ColorTagRegex.Replace(value, delegate(Match match)
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			string key = match.Groups[1].Value.ToUpperInvariant();
			string value2 = match.Groups[2].Value;
			string value3 = match.Groups[3].Value;
			if (!RankHexPatterns.TryGetValue(key, out var value4))
			{
				return match.Value;
			}
			Color color = RankColors.GetColor(value4);
			string text = ColorUtility.ToHtmlStringRGB(color);
			return string.IsNullOrEmpty(value2) ? ("<color=#" + text + ">" + value3 + "</color>") : ("<color=#" + text + value2 + ">" + value3 + "</color>");
		});
	}
}
[HarmonyPatch(typeof(ChallengeManager), "OnEnable")]
internal static class ChallengeManager_OnEnable_Patch
{
	private static void Postfix(ChallengeManager __instance)
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)__instance.challengePanel == (Object)null))
		{
			Image component = __instance.challengePanel.GetComponent<Image>();
			if ((Object)(object)component != (Object)null && Mathf.Approximately(((Graphic)component).color.r, 1f) && Mathf.Approximately(((Graphic)component).color.g, 0.696f) && Mathf.Approximately(((Graphic)component).color.b, 0f))
			{
				((Graphic)component).color = new Color(RankColors.GoldBorder.r, RankColors.GoldBorder.g, RankColors.GoldBorder.b, ((Graphic)component).color.a);
			}
		}
	}
}
[HarmonyPatch(typeof(ChallengeManager), "ChallengeDone")]
internal static class ChallengeManager_ChallengeDone_Patch
{
	private static void Postfix(ChallengeManager __instance)
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)__instance.challengePanel == (Object)null))
		{
			Image component = __instance.challengePanel.GetComponent<Image>();
			if ((Object)(object)component != (Object)null && Mathf.Approximately(((Graphic)component).color.r, 1f) && Mathf.Approximately(((Graphic)component).color.g, 0.696f) && Mathf.Approximately(((Graphic)component).color.b, 0f))
			{
				((Graphic)component).color = new Color(RankColors.GoldBorder.r, RankColors.GoldBorder.g, RankColors.GoldBorder.b, ((Graphic)component).color.a);
			}
		}
	}
}
[HarmonyPatch(typeof(LayerSelect), "Gold")]
internal static class LayerSelect_Gold_Patch
{
	private static void Postfix(LayerSelect __instance)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		Image component = ((Component)__instance).GetComponent<Image>();
		if ((Object)(object)component != (Object)null && Mathf.Approximately(((Graphic)component).color.r, 1f) && Mathf.Approximately(((Graphic)component).color.g, 0.686f) && Mathf.Approximately(((Graphic)component).color.b, 0f))
		{
			((Graphic)component).color = new Color(RankColors.GoldBorder.r, RankColors.GoldBorder.g, RankColors.GoldBorder.b, ((Graphic)component).color.a);
		}
	}
}
[HarmonyPatch(typeof(LayerSelect), "SecretMissionDone")]
internal static class LayerSelect_SecretMissionDone_Patch
{
	private static void Postfix(LayerSelect __instance)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		Image component = ((Component)__instance).GetComponent<Image>();
		if ((Object)(object)component != (Object)null && Mathf.Approximately(((Graphic)component).color.r, 1f) && Mathf.Approximately(((Graphic)component).color.g, 0.686f) && Mathf.Approximately(((Graphic)component).color.b, 0f))
		{
			((Graphic)component).color = new Color(RankColors.GoldBorder.r, RankColors.GoldBorder.g, RankColors.GoldBorder.b, ((Graphic)component).color.a);
		}
	}
}
[HarmonyPatch(typeof(LayerSelect), "AddScore")]
internal static class LayerSelect_AddScore_Patch
{
	private static void Postfix(LayerSelect __instance)
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)__instance.rankImage != (Object)null && Mathf.Approximately(((Graphic)__instance.rankImage).color.r, 1f) && Mathf.Approximately(((Graphic)__instance.rankImage).color.g, 0.686f) && Mathf.Approximately(((Graphic)__instance.rankImage).color.b, 0f))
		{
			((Graphic)__instance.rankImage).color = new Color(RankColors.GoldBorder.r, RankColors.GoldBorder.g, RankColors.GoldBorder.b, ((Graphic)__instance.rankImage).color.a);
		}
	}
}
[HarmonyPatch(typeof(LevelSelectPanel), "CheckScore")]
internal static class LevelSelectPanel_CheckScore_Patch
{
	private static void Postfix(LevelSelectPanel __instance)
	{
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		Transform val = ((Component)__instance).transform.Find("Stats/Rank");
		if ((Object)(object)val != (Object)null)
		{
			Image component = ((Component)val).GetComponent<Image>();
			if ((Object)(object)component != (Object)null && Mathf.Approximately(((Graphic)component).color.r, 1f) && Mathf.Approximately(((Graphic)component).color.g, 0.686f) && Mathf.Approximately(((Graphic)component).color.b, 0f))
			{
				((Graphic)component).color = new Color(RankColors.GoldBorder.r, RankColors.GoldBorder.g, RankColors.GoldBorder.b, ((Graphic)component).color.a);
			}
		}
		Image component2 = ((Component)__instance).GetComponent<Image>();
		if ((Object)(object)component2 != (Object)null && Mathf.Approximately(((Graphic)component2).color.r, 1f) && Mathf.Approximately(((Graphic)component2).color.g, 0.686f) && Mathf.Approximately(((Graphic)component2).color.b, 0f))
		{
			((Graphic)component2).color = new Color(RankColors.GoldBorder.r, RankColors.GoldBorder.g, RankColors.GoldBorder.b, ((Graphic)component2).color.a);
		}
	}
}
[HarmonyPatch(typeof(ChapterSelectButton), "CheckScore")]
internal static class ChapterSelectButton_CheckScore_Patch
{
	private static void Postfix(ChapterSelectButton __instance)
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		Image value = Traverse.Create((object)__instance).Field("rankButton").GetValue<Image>();
		if ((Object)(object)value != (Object)null && Mathf.Approximately(((Graphic)value).color.r, 1f) && Mathf.Approximately(((Graphic)value).color.g, 0.686f) && Mathf.Approximately(((Graphic)value).color.b, 0f))
		{
			((Graphic)value).color = new Color(RankColors.GoldBorder.r, RankColors.GoldBorder.g, RankColors.GoldBorder.b, ((Graphic)value).color.a);
		}
		Image component = ((Component)__instance).GetComponent<Image>();
		if ((Object)(object)component != (Object)null && Mathf.Approximately(((Graphic)component).color.r, 1f) && Mathf.Approximately(((Graphic)component).color.g, 0.686f) && Mathf.Approximately(((Graphic)component).color.b, 0f))
		{
			((Graphic)component).color = new Color(RankColors.GoldBorder.r, RankColors.GoldBorder.g, RankColors.GoldBorder.b, ((Graphic)component).color.a);
		}
	}
}
[HarmonyPatch(typeof(StatsManager), "GetFinalRank")]
internal static class StatsManager_GetFinalRank_Patch
{
	private static void Postfix(StatsManager __instance)
	{
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)__instance.fr == (Object)null) && !((Object)(object)__instance.fr.totalRank == (Object)null))
		{
			Transform parent = __instance.fr.totalRank.transform.parent;
			Image val = ((parent != null) ? ((Component)parent).GetComponent<Image>() : null);
			if ((Object)(object)val != (Object)null && Mathf.Approximately(((Graphic)val).color.r, 1f) && Mathf.Approximately(((Graphic)val).color.g, 0.686f) && Mathf.Approximately(((Graphic)val).color.b, 0f))
			{
				((Graphic)val).color = new Color(RankColors.GoldBorder.r, RankColors.GoldBorder.g, RankColors.GoldBorder.b, ((Graphic)val).color.a);
			}
		}
	}
}
[HarmonyPatch(typeof(RankHelper), "GetRankBackgroundColor")]
internal static class RankHelper_GetRankBackgroundColor_Patch
{
	private static void Postfix(int rank, ref Color __result)
	{
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		if (rank == 12 && Mathf.Approximately(__result.r, 1f) && Mathf.Approximately(__result.g, 0.686f) && Mathf.Approximately(__result.b, 0f))
		{
			__result = RankColors.GoldBorder;
		}
	}
}
public static class PluginInfo
{
	public const string PLUGIN_GUID = "ali.uk.customrankcolor";

	public const string PLUGIN_NAME = "Custom Rank Letter Colorizer";

	public const string PLUGIN_VERSION = "1.0.0";
}