Decompiled source of More Colours v1.0.6

MoreColours.dll

Decompiled 3 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Rendering.Universal;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("MoreColours")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.5.0")]
[assembly: AssemblyInformationalVersion("1.0.2")]
[assembly: AssemblyProduct("MoreColours")]
[assembly: AssemblyTitle("MoreColours")]
[assembly: AssemblyVersion("1.0.5.0")]
namespace MoreColours;

internal static class MenuChrome
{
	public static Image ButtonFill(Button b)
	{
		if (!((Object)(object)b == (Object)null))
		{
			return ((Component)b).GetComponent<Image>();
		}
		return null;
	}

	public static IEnumerable<Image> ButtonOutlines(Button b)
	{
		if ((Object)(object)b == (Object)null)
		{
			yield break;
		}
		Image[] componentsInChildren = ((Component)b).GetComponentsInChildren<Image>(true);
		foreach (Image val in componentsInChildren)
		{
			if ((Object)(object)((Component)val).transform != (Object)(object)((Component)b).transform)
			{
				yield return val;
			}
		}
	}

	public static Image Track(Slider s)
	{
		if (!((Object)(object)s == (Object)null))
		{
			return ((Component)s).GetComponent<Image>();
		}
		return null;
	}

	public static Image Fill(Slider s)
	{
		if (!((Object)(object)s == (Object)null) && !((Object)(object)s.fillRect == (Object)null))
		{
			return ((Component)s.fillRect).GetComponent<Image>();
		}
		return null;
	}

	public static Image Handle(Slider s)
	{
		if (!((Object)(object)s == (Object)null) && !((Object)(object)s.handleRect == (Object)null))
		{
			return ((Component)s.handleRect).GetComponent<Image>();
		}
		return null;
	}

	public static bool IsIconButton(Button b)
	{
		if ((Object)(object)b != (Object)null && (Object)(object)((Component)b).GetComponentInChildren<TMP_Text>(true) == (Object)null)
		{
			return (Object)(object)((Component)b).GetComponentInChildren<Image>(true) != (Object)null;
		}
		return false;
	}

	public static IEnumerable<Image> Icons(Button b)
	{
		if (!((Object)(object)b == (Object)null))
		{
			Image[] componentsInChildren = ((Component)b).GetComponentsInChildren<Image>(true);
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				yield return componentsInChildren[i];
			}
		}
	}
}
internal static class Applier
{
	private class RowOrig
	{
		public Color typing;

		public Color typed;

		public Color score;
	}

	private class VitalsOrig
	{
		public Color hFill;

		public Color hTrail;

		public Color fFill;

		public Color fTrail;

		public Color pFill;

		public Color pTrail;

		public Color fireFill;

		public Color fireTrail;

		public Color hIcon;

		public Color fIcon;
	}

	private class BossOrig
	{
		public Color trail;

		public Color timer;

		public Color name;
	}

	private class VignetteOrig
	{
		public Color damage;

		public Color poison;

		public Color fire;

		public Color hunger;
	}

	public static bool Dirty = true;

	private static GameInfo _giCaptured;

	private static Color _oRed;

	private static Color _oGreen;

	private static Color _oOrange;

	private static Color _oMini;

	private static Color _oCommon;

	private static Color _oRare;

	private static Color _oLegend;

	private static Gradient _oDrip;

	private static Gradient _customDrip;

	private static int _dripHash;

	private static readonly List<PlayerKillScore> KillScores = new List<PlayerKillScore>();

	private static readonly Dictionary<BonusScoreRow, RowOrig> RowOrigs = new Dictionary<BonusScoreRow, RowOrig>();

	private static readonly Dictionary<PlayerKillScore, Color> MultOrigs = new Dictionary<PlayerKillScore, Color>();

	private static readonly Dictionary<VitalsUI, VitalsOrig> Vitals = new Dictionary<VitalsUI, VitalsOrig>();

	private static readonly Dictionary<CloseItemsUI, Color> RadarOrigs = new Dictionary<CloseItemsUI, Color>();

	private static float _nextRadarScan;

	private static readonly Dictionary<BossUI, BossOrig> Bosses = new Dictionary<BossUI, BossOrig>();

	private static TextMeshProUGUI _moneyText;

	private static Color _moneyOrig;

	private static readonly Dictionary<Graphic, Color> GraphicOrigs = new Dictionary<Graphic, Color>();

	private static readonly Dictionary<Graphic, Color> AppliedColours = new Dictionary<Graphic, Color>();

	private static readonly Dictionary<Graphic, float> HoverAlpha = new Dictionary<Graphic, float>();

	private static float _nextHudScan;

	private static readonly List<WeaponUI> WeaponUIs = new List<WeaponUI>();

	private static readonly List<CanvasManager> Canvases = new List<CanvasManager>();

	private static readonly List<ItemUI> ItemUIs = new List<ItemUI>();

	private static readonly List<NpcUI> NpcUIs = new List<NpcUI>();

	private static readonly List<VoiceUI> VoiceUIs = new List<VoiceUI>();

	private static readonly List<PlayerInventory> Inventories = new List<PlayerInventory>();

	private static readonly List<TMP_Text> VersionTexts = new List<TMP_Text>();

	private static readonly List<PlayerEffects> Effects = new List<PlayerEffects>();

	private static HashSet<Assembly> _pluginAsms;

	private static readonly Dictionary<ParticleSystem, MinMaxGradient> ParticleOrigs = new Dictionary<ParticleSystem, MinMaxGradient>();

	private static readonly Dictionary<DecalProjector, Material> DecalOrigMats = new Dictionary<DecalProjector, Material>();

	private static readonly Dictionary<Renderer, Material> RendererOrigMats = new Dictionary<Renderer, Material>();

	private static readonly HashSet<string> LoggedMats = new HashSet<string>();

	private static readonly Dictionary<Material, Material> TintedMats = new Dictionary<Material, Material>();

	private static readonly string[] ColourProps = new string[4] { "_BaseColor", "_Color", "_TintColor", "_MainColor" };

	private static readonly Dictionary<PlayerEffects, VignetteOrig> VignetteOrigs = new Dictionary<PlayerEffects, VignetteOrig>();

	private static ModSettings S => MoreColoursPlugin.S;

	internal static void Tint(Graphic g, ColorOv ov)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: 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_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)g == (Object)null)
		{
			return;
		}
		if (!GraphicOrigs.TryGetValue(g, out var value))
		{
			value = g.color;
			GraphicOrigs[g] = value;
		}
		int num;
		Color val;
		if (ov != null)
		{
			num = (ov.on ? 1 : 0);
			if (num != 0)
			{
				val = ov.c;
				goto IL_0044;
			}
		}
		else
		{
			num = 0;
		}
		val = value;
		goto IL_0044;
		IL_0044:
		Color val2 = val;
		if (num != 0)
		{
			AppliedColours[g] = val2;
		}
		else
		{
			AppliedColours.Remove(g);
		}
		if (num != 0 && HoverAlpha.TryGetValue(g, out var value2))
		{
			val2.a *= value2;
		}
		g.color = val2;
	}

	public static void OnButtonEffect(Graphic g)
	{
		//IL_000b: 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_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: 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)g == (Object)null))
		{
			float a = g.color.a;
			HoverAlpha[g] = a;
			if (AppliedColours.TryGetValue(g, out var value))
			{
				g.color = new Color(value.r, value.g, value.b, value.a * a);
			}
		}
	}

	public static Color OrigOf(Graphic g, Color fallback)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)g == (Object)null)
		{
			return fallback;
		}
		if (!GraphicOrigs.TryGetValue(g, out var value))
		{
			return g.color;
		}
		return value;
	}

	public static void RegisterKillScore(PlayerKillScore ks)
	{
		//IL_00c9: 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_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_012e: 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_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)ks == (Object)null || KillScores.Contains(ks))
		{
			return;
		}
		KillScores.Add(ks);
		BonusScoreRow main = Refl.Get<BonusScoreRow>(ks, typeof(PlayerKillScore), "_mainBonusScoreRow");
		CaptureRow(main);
		List<BonusScoreRow> list = Refl.Get<List<BonusScoreRow>>(ks, typeof(PlayerKillScore), "_bonusRows");
		if (list != null)
		{
			foreach (BonusScoreRow item in list)
			{
				CaptureRow(item);
			}
		}
		TextMeshProUGUI val = Refl.Get<TextMeshProUGUI>(ks, typeof(PlayerKillScore), "_multiplierText");
		if ((Object)(object)val != (Object)null && !MultOrigs.ContainsKey(ks))
		{
			MultOrigs[ks] = ((Graphic)val).color;
		}
		VanillaCache van = S.van;
		if (!van.hasPopup && (Object)(object)main != (Object)null && RowOrigs.TryGetValue(main, out var value))
		{
			van.popupMainTyping = value.typing;
			van.popupMainTyped = value.typed;
			van.popupMainScore = value.score;
			if ((Object)(object)val != (Object)null)
			{
				van.popupMult = (MultOrigs.TryGetValue(ks, out var value2) ? value2 : ((Graphic)val).color);
			}
			BonusScoreRow val2 = list?.FirstOrDefault((Func<BonusScoreRow, bool>)((BonusScoreRow r) => (Object)(object)r != (Object)null && (Object)(object)r != (Object)(object)main));
			if ((Object)(object)val2 != (Object)null && RowOrigs.TryGetValue(val2, out var value3))
			{
				van.popupBonusTyping = value3.typing;
				van.popupBonusTyped = value3.typed;
				van.popupBonusScore = value3.score;
			}
			van.hasPopup = true;
			van.v2 = true;
			MoreColoursPlugin.CfgDirty = true;
		}
		Dirty = true;
	}

	private static void CaptureRow(BonusScoreRow row)
	{
		//IL_0033: 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_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)row == (Object)null) && !RowOrigs.ContainsKey(row))
		{
			RowOrigs[row] = new RowOrig
			{
				typing = Refl.Get<Color>(row, typeof(BonusScoreRow), "_typingColor"),
				typed = Refl.Get<Color>(row, typeof(BonusScoreRow), "_typedColor"),
				score = (((Object)(object)row.ScoreText != (Object)null) ? ((Graphic)row.ScoreText).color : Color.white)
			};
		}
	}

	public static void RegisterVitals(VitalsUI v)
	{
		//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_0034: 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_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: 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_0089: 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)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: 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_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)v == (Object)null) && !Vitals.ContainsKey(v))
		{
			VitalsOrig vitalsOrig = new VitalsOrig
			{
				hFill = ImgColor(v, "_healthPercent"),
				hTrail = ImgColor(v, "_healthPercentLerped"),
				fFill = ImgColor(v, "_fullnessPercent"),
				fTrail = ImgColor(v, "_fullnessPercentLerped"),
				pFill = ImgColor(v, "_poisonPercent"),
				pTrail = ImgColor(v, "_poisonPercentLerped"),
				fireFill = ImgColor(v, "_firePercent"),
				fireTrail = ImgColor(v, "_firePercentLerped"),
				hIcon = Refl.Get<Color>(v, typeof(VitalsUI), "_healthColor"),
				fIcon = Refl.Get<Color>(v, typeof(VitalsUI), "_fullnessColor")
			};
			Vitals[v] = vitalsOrig;
			VanillaCache van = S.van;
			if (!van.hasVitals)
			{
				van.vHealthFill = vitalsOrig.hFill;
				van.vHealthTrail = vitalsOrig.hTrail;
				van.vHungerFill = vitalsOrig.fFill;
				van.vHungerTrail = vitalsOrig.fTrail;
				van.vPoisonFill = vitalsOrig.pFill;
				van.vPoisonTrail = vitalsOrig.pTrail;
				van.vFireFill = vitalsOrig.fireFill;
				van.vFireTrail = vitalsOrig.fireTrail;
				van.vHealthIcon = vitalsOrig.hIcon;
				van.vHungerIcon = vitalsOrig.fIcon;
				van.hasVitals = true;
				MoreColoursPlugin.CfgDirty = true;
			}
			Dirty = true;
		}
	}

	private static Color ImgColor(VitalsUI v, string field)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		Image val = Refl.Get<Image>(v, typeof(VitalsUI), field);
		if (!((Object)(object)val != (Object)null))
		{
			return Color.white;
		}
		return ((Graphic)val).color;
	}

	public static void Apply()
	{
		CleanDead();
		ApplyPalette();
		ApplyKillScores();
		ApplyVitals();
		ApplyRadar();
		ApplyBoss();
		ApplyMoney();
		ApplyHud();
		ApplyBlood();
		ApplyMenu();
		ApplyVignette();
		try
		{
			ModCompat.Apply();
		}
		catch (Exception ex)
		{
			MoreColoursPlugin.Log.LogWarning((object)("mod compat: " + ex.Message));
		}
	}

	private static void CleanDead()
	{
		KillScores.RemoveAll((PlayerKillScore k) => (Object)(object)k == (Object)null);
		foreach (BonusScoreRow item in RowOrigs.Keys.Where((BonusScoreRow r) => (Object)(object)r == (Object)null).ToList())
		{
			RowOrigs.Remove(item);
		}
		foreach (PlayerKillScore item2 in MultOrigs.Keys.Where((PlayerKillScore r) => (Object)(object)r == (Object)null).ToList())
		{
			MultOrigs.Remove(item2);
		}
		foreach (VitalsUI item3 in Vitals.Keys.Where((VitalsUI r) => (Object)(object)r == (Object)null).ToList())
		{
			Vitals.Remove(item3);
		}
		foreach (CloseItemsUI item4 in RadarOrigs.Keys.Where((CloseItemsUI r) => (Object)(object)r == (Object)null).ToList())
		{
			RadarOrigs.Remove(item4);
		}
		foreach (BossUI item5 in Bosses.Keys.Where((BossUI r) => (Object)(object)r == (Object)null).ToList())
		{
			Bosses.Remove(item5);
		}
		foreach (Graphic item6 in GraphicOrigs.Keys.Where((Graphic r) => (Object)(object)r == (Object)null).ToList())
		{
			GraphicOrigs.Remove(item6);
		}
		ModCompat.Prune();
		foreach (Graphic item7 in AppliedColours.Keys.Where((Graphic r) => (Object)(object)r == (Object)null).ToList())
		{
			AppliedColours.Remove(item7);
		}
		foreach (Graphic item8 in HoverAlpha.Keys.Where((Graphic r) => (Object)(object)r == (Object)null).ToList())
		{
			HoverAlpha.Remove(item8);
		}
		foreach (ParticleSystem item9 in ParticleOrigs.Keys.Where((ParticleSystem r) => (Object)(object)r == (Object)null).ToList())
		{
			ParticleOrigs.Remove(item9);
		}
		foreach (DecalProjector item10 in DecalOrigMats.Keys.Where((DecalProjector r) => (Object)(object)r == (Object)null).ToList())
		{
			DecalOrigMats.Remove(item10);
		}
		foreach (Renderer item11 in RendererOrigMats.Keys.Where((Renderer r) => (Object)(object)r == (Object)null).ToList())
		{
			RendererOrigMats.Remove(item11);
		}
		foreach (PlayerEffects item12 in VignetteOrigs.Keys.Where((PlayerEffects r) => (Object)(object)r == (Object)null).ToList())
		{
			VignetteOrigs.Remove(item12);
		}
	}

	private static Color Pick(ColorOv ov, Color orig)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		if (ov == null || !ov.on)
		{
			return orig;
		}
		return ov.c;
	}

	private static void ApplyPalette()
	{
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_0192: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: 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_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: 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_007f: 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_0090: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: 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)
		GameInfo s = Refl.GetS<GameInfo>(typeof(GameInfo), "_instance");
		if ((Object)(object)s == (Object)null)
		{
			return;
		}
		Type typeFromHandle = typeof(GameInfo);
		if ((Object)(object)s != (Object)(object)_giCaptured)
		{
			_giCaptured = s;
			_oRed = Refl.Get<Color>(s, typeFromHandle, "_redColor");
			_oGreen = Refl.Get<Color>(s, typeFromHandle, "_greenColor");
			_oOrange = Refl.Get<Color>(s, typeFromHandle, "_orangeColor");
			_oMini = Refl.Get<Color>(s, typeFromHandle, "_minBossColor");
			_oCommon = Refl.Get<Color>(s, typeFromHandle, "_commonColor");
			_oRare = Refl.Get<Color>(s, typeFromHandle, "_rareColor");
			_oLegend = Refl.Get<Color>(s, typeFromHandle, "_legendaryColor");
			_oDrip = Refl.Get<Gradient>(s, typeFromHandle, "_dripGradient");
		}
		Refl.Set(s, typeFromHandle, "_redColor", Pick(S.palRed, _oRed));
		Refl.Set(s, typeFromHandle, "_greenColor", Pick(S.palGreen, _oGreen));
		Refl.Set(s, typeFromHandle, "_orangeColor", Pick(S.palOrange, _oOrange));
		Refl.Set(s, typeFromHandle, "_minBossColor", Pick(S.palMiniBoss, _oMini));
		Refl.Set(s, typeFromHandle, "_commonColor", Pick(S.palCommon, _oCommon));
		Refl.Set(s, typeFromHandle, "_rareColor", Pick(S.palRare, _oRare));
		Refl.Set(s, typeFromHandle, "_legendaryColor", Pick(S.palLegendary, _oLegend));
		if (S.dripOn && S.dripStops != null && S.dripStops.Count >= 2)
		{
			int num = StopsHash();
			if (_customDrip == null || num != _dripHash)
			{
				_customDrip = BuildGradient(S.dripStops);
				_dripHash = num;
			}
			Refl.Set(s, typeFromHandle, "_dripGradient", _customDrip);
		}
		else if (_oDrip != null)
		{
			Refl.Set(s, typeFromHandle, "_dripGradient", _oDrip);
		}
	}

	private static int StopsHash()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		int num = 17;
		foreach (Color dripStop in S.dripStops)
		{
			num = num * 31 + ((object)dripStop/*cast due to .constrained prefix*/).GetHashCode();
		}
		return num;
	}

	public static Gradient BuildGradient(List<Color> stops)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Expected O, but got Unknown
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: 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_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		Gradient val = new Gradient();
		int num = Mathf.Clamp(stops.Count, 2, 8);
		GradientColorKey[] array = (GradientColorKey[])(object)new GradientColorKey[num];
		for (int i = 0; i < num; i++)
		{
			array[i] = new GradientColorKey(stops[i], (num == 1) ? 0f : ((float)i / (float)(num - 1)));
		}
		val.colorKeys = array;
		val.alphaKeys = (GradientAlphaKey[])(object)new GradientAlphaKey[2]
		{
			new GradientAlphaKey(1f, 0f),
			new GradientAlphaKey(1f, 1f)
		};
		val.mode = (GradientMode)0;
		return val;
	}

	private static void ApplyKillScores()
	{
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		foreach (PlayerKillScore killScore in KillScores)
		{
			if ((Object)(object)killScore == (Object)null)
			{
				continue;
			}
			BonusScoreRow val = Refl.Get<BonusScoreRow>(killScore, typeof(PlayerKillScore), "_mainBonusScoreRow");
			ApplyRow(val, S.scoreMainTyping, S.scoreMainTyped, S.scoreMainScore);
			List<BonusScoreRow> list = Refl.Get<List<BonusScoreRow>>(killScore, typeof(PlayerKillScore), "_bonusRows");
			if (list != null)
			{
				foreach (BonusScoreRow item in list)
				{
					if (!((Object)(object)item == (Object)(object)val))
					{
						ApplyRow(item, S.scoreBonusTyping, S.scoreBonusTyped, S.scoreBonusScore);
					}
				}
			}
			TextMeshProUGUI val2 = Refl.Get<TextMeshProUGUI>(killScore, typeof(PlayerKillScore), "_multiplierText");
			if ((Object)(object)val2 != (Object)null && MultOrigs.TryGetValue(killScore, out var value))
			{
				((Graphic)val2).color = Pick(S.scoreMultiplier, value);
			}
		}
	}

	private static void ApplyRow(BonusScoreRow row, ColorOv typing, ColorOv typed, ColorOv score)
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: 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_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)row == (Object)null)
		{
			return;
		}
		CaptureRow(row);
		if (RowOrigs.TryGetValue(row, out var value))
		{
			Refl.Set(row, typeof(BonusScoreRow), "_typingColor", Pick(typing, value.typing));
			Refl.Set(row, typeof(BonusScoreRow), "_typedColor", Pick(typed, value.typed));
			if ((Object)(object)row.ScoreText != (Object)null)
			{
				((Graphic)row.ScoreText).color = Pick(score, value.score);
			}
		}
	}

	private static void ApplyVitals()
	{
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: 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_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		foreach (KeyValuePair<VitalsUI, VitalsOrig> vital in Vitals)
		{
			VitalsUI key = vital.Key;
			VitalsOrig value = vital.Value;
			if (!((Object)(object)key == (Object)null) && value != null)
			{
				SetImg(key, "_healthPercent", Pick(S.healthFill, value.hFill));
				SetImg(key, "_healthPercentLerped", Pick(S.healthTrail, value.hTrail));
				SetImg(key, "_fullnessPercent", Pick(S.hungerFill, value.fFill));
				SetImg(key, "_fullnessPercentLerped", Pick(S.hungerTrail, value.fTrail));
				SetImg(key, "_poisonPercent", Pick(S.poisonFill, value.pFill));
				SetImg(key, "_poisonPercentLerped", Pick(S.poisonTrail, value.pTrail));
				SetImg(key, "_firePercent", Pick(S.fireFill, value.fireFill));
				SetImg(key, "_firePercentLerped", Pick(S.fireTrail, value.fireTrail));
				Refl.Set(key, typeof(VitalsUI), "_healthColor", Pick(S.healthIconLow, value.hIcon));
				Refl.Set(key, typeof(VitalsUI), "_fullnessColor", Pick(S.hungerIconLow, value.fIcon));
				Image val = Refl.Get<Image>(key, typeof(VitalsUI), "_healthPercent");
				if ((Object)(object)val != (Object)null)
				{
					key.SetPlayerHp(val.fillAmount);
				}
				Image val2 = Refl.Get<Image>(key, typeof(VitalsUI), "_fullnessPercent");
				if ((Object)(object)val2 != (Object)null)
				{
					key.SetPlayerFullness(val2.fillAmount);
				}
			}
		}
	}

	private static void SetImg(VitalsUI v, string field, Color c)
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		Image val = Refl.Get<Image>(v, typeof(VitalsUI), field);
		if ((Object)(object)val != (Object)null)
		{
			((Graphic)val).color = c;
		}
	}

	private static void ApplyRadar()
	{
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		if (RadarOrigs.Count == 0 || RadarOrigs.Keys.Any((CloseItemsUI k) => (Object)(object)k == (Object)null))
		{
			if (Time.unscaledTime < _nextRadarScan)
			{
				return;
			}
			_nextRadarScan = Time.unscaledTime + 3f;
			CloseItemsUI[] array = Resources.FindObjectsOfTypeAll<CloseItemsUI>();
			foreach (CloseItemsUI val in array)
			{
				if ((Object)(object)val == (Object)null)
				{
					continue;
				}
				Scene scene = ((Component)val).gameObject.scene;
				if (((Scene)(ref scene)).IsValid() && !RadarOrigs.ContainsKey(val))
				{
					Color val2 = Refl.Get<Color>(val, typeof(CloseItemsUI), "_aliveColor");
					RadarOrigs[val] = val2;
					if (!S.van.hasRadar)
					{
						S.van.radarAlive = val2;
						S.van.hasRadar = true;
						MoreColoursPlugin.CfgDirty = true;
					}
				}
			}
		}
		foreach (KeyValuePair<CloseItemsUI, Color> radarOrig in RadarOrigs)
		{
			if (!((Object)(object)radarOrig.Key == (Object)null))
			{
				Refl.Set(radarOrig.Key, typeof(CloseItemsUI), "_aliveColor", Pick(S.radarAlive, radarOrig.Value));
			}
		}
	}

	public static void RegisterBoss(BossUI b)
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: 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)
		//IL_004d: 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_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)b == (Object)null)
		{
			return;
		}
		if (!Bosses.ContainsKey(b))
		{
			BossOrig bossOrig = new BossOrig
			{
				trail = BossImgColor(b, "_bossHealthLerped"),
				timer = BossImgColor(b, "_timeLeftImage"),
				name = BossTextColor(b, "_bossNameText")
			};
			Bosses[b] = bossOrig;
			if (!S.van.hasBoss)
			{
				S.van.bossTrail = bossOrig.trail;
				S.van.bossTimer = bossOrig.timer;
				S.van.bossName = bossOrig.name;
				S.van.hasBoss = true;
				MoreColoursPlugin.CfgDirty = true;
			}
		}
		Dirty = true;
	}

	private static Color BossImgColor(BossUI b, string field)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		Image val = Refl.Get<Image>(b, typeof(BossUI), field);
		if (!((Object)(object)val != (Object)null))
		{
			return Color.white;
		}
		return ((Graphic)val).color;
	}

	private static Color BossTextColor(BossUI b, string field)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		TextMeshProUGUI val = Refl.Get<TextMeshProUGUI>(b, typeof(BossUI), field);
		if (!((Object)(object)val != (Object)null))
		{
			return Color.white;
		}
		return ((Graphic)val).color;
	}

	private static void ApplyBoss()
	{
		//IL_0068: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: 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_012c: Invalid comparison between Unknown and I4
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0192: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		foreach (KeyValuePair<BossUI, BossOrig> boss in Bosses)
		{
			BossUI key = boss.Key;
			BossOrig value = boss.Value;
			if ((Object)(object)key == (Object)null || value == null)
			{
				continue;
			}
			Image val = Refl.Get<Image>(key, typeof(BossUI), "_bossHealthLerped");
			if ((Object)(object)val != (Object)null)
			{
				((Graphic)val).color = Pick(S.bossTrail, value.trail);
			}
			Image val2 = Refl.Get<Image>(key, typeof(BossUI), "_timeLeftImage");
			if ((Object)(object)val2 != (Object)null)
			{
				((Graphic)val2).color = Pick(S.bossTimer, value.timer);
			}
			TextMeshProUGUI val3 = Refl.Get<TextMeshProUGUI>(key, typeof(BossUI), "_bossNameText");
			if ((Object)(object)val3 != (Object)null)
			{
				((Graphic)val3).color = Pick(S.bossName, value.name);
			}
			Image val4 = Refl.Get<Image>(key, typeof(BossUI), "_bossHealth");
			if ((Object)(object)val4 != (Object)null && Object.op_Implicit((Object)(object)BossManager.Boss))
			{
				bool flag = (int)BossManager.Boss.BossType == 2;
				ColorOv colorOv = (flag ? S.bossBar : S.miniBossBar);
				if (colorOv != null && colorOv.on)
				{
					((Graphic)val4).color = colorOv.c;
				}
				else if ((Object)(object)Refl.GetS<GameInfo>(typeof(GameInfo), "_instance") != (Object)null)
				{
					((Graphic)val4).color = (flag ? GameInfo.RedColor : GameInfo.MiniBossColor);
				}
			}
		}
	}

	private static void ApplyHud()
	{
		if (Time.unscaledTime >= _nextHudScan || WeaponUIs.Any((WeaponUI x) => (Object)(object)x == (Object)null) || Canvases.Any((CanvasManager x) => (Object)(object)x == (Object)null) || ItemUIs.Any((ItemUI x) => (Object)(object)x == (Object)null) || NpcUIs.Any((NpcUI x) => (Object)(object)x == (Object)null) || VoiceUIs.Any((VoiceUI x) => (Object)(object)x == (Object)null) || Inventories.Any((PlayerInventory x) => (Object)(object)x == (Object)null))
		{
			_nextHudScan = Time.unscaledTime + 4f;
			Rescan<WeaponUI>(WeaponUIs);
			Rescan<CanvasManager>(Canvases);
			Rescan<ItemUI>(ItemUIs);
			Rescan<NpcUI>(NpcUIs);
			Rescan<VoiceUI>(VoiceUIs);
			Rescan<PlayerInventory>(Inventories);
			Rescan<PlayerEffects>(Effects);
			RescanVersionTexts();
		}
		foreach (WeaponUI weaponUI in WeaponUIs)
		{
			if (!((Object)(object)weaponUI == (Object)null))
			{
				Tint((Graphic)(object)Refl.Get<TextMeshProUGUI>(weaponUI, typeof(WeaponUI), "_inspectedNameText"), S.inspectName);
				Tint((Graphic)(object)Refl.Get<TextMeshProUGUI>(weaponUI, typeof(WeaponUI), "_descriptionText"), S.inspectBody);
			}
		}
		foreach (TMP_Text versionText in VersionTexts)
		{
			Tint((Graphic)(object)versionText, S.versionText);
		}
		foreach (ItemUI itemUI in ItemUIs)
		{
			if (!((Object)(object)itemUI == (Object)null))
			{
				Tint((Graphic)(object)Refl.Get<TextMeshProUGUI>(itemUI, typeof(ItemUI), "_itemInfoText"), S.promptText);
			}
		}
		foreach (NpcUI npcUI in NpcUIs)
		{
			if (!((Object)(object)npcUI == (Object)null))
			{
				Tint((Graphic)(object)Refl.Get<TextMeshProUGUI>(npcUI, typeof(NpcUI), "_npcText"), S.npcText);
			}
		}
		foreach (VoiceUI voiceUI in VoiceUIs)
		{
			if ((Object)(object)voiceUI == (Object)null)
			{
				continue;
			}
			RectTransform val = Refl.Get<RectTransform>(voiceUI, typeof(VoiceUI), "_audioVolRect");
			if (!((Object)(object)val == (Object)null))
			{
				Image[] componentsInChildren = ((Component)val).GetComponentsInChildren<Image>(true);
				for (int num = 0; num < componentsInChildren.Length; num++)
				{
					Tint((Graphic)(object)componentsInChildren[num], S.voiceIndicator);
				}
			}
		}
		foreach (PlayerInventory inventory in Inventories)
		{
			if ((Object)(object)inventory == (Object)null)
			{
				continue;
			}
			List<InventorySlot> list = Refl.Get<List<InventorySlot>>(inventory, typeof(PlayerInventory), "_itemSlots");
			if (list != null)
			{
				foreach (InventorySlot item in list)
				{
					TintSlot(item);
				}
			}
			TintSlot((InventorySlot)(object)Refl.Get<BaitSlot>(inventory, typeof(PlayerInventory), "_baitSlot"));
		}
	}

	private static void TintSlot(InventorySlot slot)
	{
		if ((Object)(object)slot == (Object)null)
		{
			return;
		}
		Tint((Graphic)(object)Refl.Get<Image>(slot, typeof(InventorySlot), "_outline"), S.hotbarOutline);
		TMP_Text[] componentsInChildren = ((Component)slot).GetComponentsInChildren<TMP_Text>(true);
		foreach (TMP_Text val in componentsInChildren)
		{
			if (!UnderModded(val.transform, ((Component)slot).transform))
			{
				Tint((Graphic)(object)val, S.hotbarNumber);
			}
		}
	}

	internal static bool UnderModded(Transform t, Transform stop)
	{
		if (_pluginAsms == null)
		{
			_pluginAsms = new HashSet<Assembly>();
			foreach (PluginInfo value in Chainloader.PluginInfos.Values)
			{
				if ((Object)(object)value.Instance != (Object)null)
				{
					_pluginAsms.Add(((object)value.Instance).GetType().Assembly);
				}
			}
			_pluginAsms.Remove(typeof(Applier).Assembly);
		}
		Transform val = t;
		while ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)stop)
		{
			MonoBehaviour[] components = ((Component)val).GetComponents<MonoBehaviour>();
			foreach (MonoBehaviour val2 in components)
			{
				if ((Object)(object)val2 != (Object)null && _pluginAsms.Contains(((object)val2).GetType().Assembly))
				{
					return true;
				}
			}
			val = val.parent;
		}
		return false;
	}

	private static void Rescan<T>(List<T> list) where T : Component
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		list.Clear();
		T[] array = Resources.FindObjectsOfTypeAll<T>();
		foreach (T val in array)
		{
			if ((Object)(object)val != (Object)null)
			{
				Scene scene = ((Component)val).gameObject.scene;
				if (((Scene)(ref scene)).IsValid())
				{
					list.Add(val);
				}
			}
		}
	}

	private static void RescanVersionTexts()
	{
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		VersionTexts.Clear();
		string version = Application.version;
		foreach (CanvasManager canvase in Canvases)
		{
			if (!((Object)(object)canvase == (Object)null))
			{
				TextMeshProUGUI val = Refl.Get<TextMeshProUGUI>(canvase, typeof(CanvasManager), "_versionText");
				if ((Object)(object)val != (Object)null)
				{
					AddVersionText((TMP_Text)(object)val);
				}
			}
		}
		if (string.IsNullOrEmpty(version))
		{
			return;
		}
		TMP_Text[] array = Resources.FindObjectsOfTypeAll<TMP_Text>();
		foreach (TMP_Text val2 in array)
		{
			if ((Object)(object)val2 == (Object)null)
			{
				continue;
			}
			Scene scene = ((Component)val2).gameObject.scene;
			if (!((Scene)(ref scene)).IsValid())
			{
				continue;
			}
			string text = val2.text;
			if (string.IsNullOrEmpty(text) || text.Length >= 40)
			{
				continue;
			}
			int num = text.IndexOf(version, StringComparison.Ordinal);
			if (num >= 0)
			{
				int num2 = num + version.Length;
				bool num3 = num > 0 && (char.IsDigit(text[num - 1]) || text[num - 1] == '.');
				bool flag = num2 < text.Length && (char.IsDigit(text[num2]) || text[num2] == '.');
				if (!num3 && !flag)
				{
					AddVersionText(val2);
				}
			}
		}
	}

	private static void AddVersionText(TMP_Text t)
	{
		if ((Object)(object)t == (Object)null)
		{
			return;
		}
		if (!VersionTexts.Contains(t))
		{
			VersionTexts.Add(t);
		}
		Transform parent = t.transform.parent;
		if ((Object)(object)parent == (Object)null)
		{
			return;
		}
		TMP_Text[] componentsInChildren = ((Component)parent).GetComponentsInChildren<TMP_Text>(true);
		foreach (TMP_Text val in componentsInChildren)
		{
			if ((Object)(object)val != (Object)null && !VersionTexts.Contains(val))
			{
				VersionTexts.Add(val);
			}
		}
	}

	private static bool IsBlood(string name)
	{
		if (name != null)
		{
			return name.IndexOf("Blood", StringComparison.OrdinalIgnoreCase) >= 0;
		}
		return false;
	}

	private static void ApplyBlood()
	{
		TintBloodParticles();
		TintBloodDecals();
	}

	private static void TintBloodParticles()
	{
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		IDictionary s = Refl.GetS<IDictionary>(typeof(ParticleManager), "_particles");
		if (s == null)
		{
			return;
		}
		foreach (DictionaryEntry item in s)
		{
			if (!IsBlood(item.Key as string) || item.Value == null)
			{
				continue;
			}
			FieldInfo fieldInfo = Refl.F(item.Value.GetType(), "ParticleSystem");
			ParticleSystem val = (ParticleSystem)((fieldInfo != null) ? /*isinst with value type is only supported in some contexts*/: null);
			if ((Object)(object)val == (Object)null)
			{
				continue;
			}
			ParticleSystem[] componentsInChildren = ((Component)val).GetComponentsInChildren<ParticleSystem>(true);
			foreach (ParticleSystem val2 in componentsInChildren)
			{
				if (!((Object)(object)val2 == (Object)null))
				{
					MainModule main = val2.main;
					if (!ParticleOrigs.TryGetValue(val2, out var value))
					{
						value = ((MainModule)(ref main)).startColor;
						ParticleOrigs[val2] = value;
					}
					((MainModule)(ref main)).startColor = (MinMaxGradient)((S.bloodParticles != null && S.bloodParticles.on) ? new MinMaxGradient(S.bloodParticles.c) : value);
					TintRenderer((Renderer)(object)((Component)val2).GetComponent<ParticleSystemRenderer>(), S.bloodParticles);
				}
			}
		}
	}

	private static void TintRenderer(Renderer r, ColorOv ov)
	{
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)r == (Object)null)
		{
			return;
		}
		if (!RendererOrigMats.TryGetValue(r, out var value))
		{
			value = r.sharedMaterial;
			RendererOrigMats[r] = value;
			LogMaterial(value, "blood particle");
		}
		if ((Object)(object)value == (Object)null)
		{
			return;
		}
		if (ov != null && ov.on)
		{
			Material val = TintedCopy(value, ov.c);
			if ((Object)(object)r.sharedMaterial != (Object)(object)val)
			{
				r.sharedMaterial = val;
			}
		}
		else if ((Object)(object)r.sharedMaterial != (Object)(object)value)
		{
			r.sharedMaterial = value;
		}
	}

	private static void LogMaterial(Material m, string what)
	{
		if ((Object)(object)m == (Object)null || !LoggedMats.Add(what + ":" + ((Object)m).name))
		{
			return;
		}
		string text = "";
		string[] colourProps = ColourProps;
		foreach (string text2 in colourProps)
		{
			if (m.HasProperty(text2))
			{
				text = text + text2 + " ";
			}
		}
		MoreColoursPlugin.Log.LogInfo((object)(what + " material '" + ((Object)m).name + "' shader '" + (((Object)(object)m.shader != (Object)null) ? ((Object)m.shader).name : "?") + "' colour props: " + ((text.Length == 0) ? "none" : text)));
	}

	private static void TintBloodDecals()
	{
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		Dictionary<string, List<DecalProjector>> s = Refl.GetS<Dictionary<string, List<DecalProjector>>>(typeof(DecalManager), "_decals");
		if (s == null)
		{
			return;
		}
		bool flag = S.bloodDecals != null && S.bloodDecals.on;
		foreach (KeyValuePair<string, List<DecalProjector>> item in s)
		{
			if (!IsBlood(item.Key) || item.Value == null)
			{
				continue;
			}
			foreach (DecalProjector item2 in item.Value)
			{
				if ((Object)(object)item2 == (Object)null)
				{
					continue;
				}
				if (!DecalOrigMats.TryGetValue(item2, out var value))
				{
					value = item2.material;
					DecalOrigMats[item2] = value;
					LogMaterial(value, "blood decal");
				}
				if ((Object)(object)value == (Object)null)
				{
					continue;
				}
				if (flag)
				{
					Material val = TintedCopy(value, S.bloodDecals.c);
					if ((Object)(object)item2.material != (Object)(object)val)
					{
						item2.material = val;
					}
				}
				else if ((Object)(object)item2.material != (Object)(object)value)
				{
					item2.material = value;
				}
			}
		}
	}

	private static Material TintedCopy(Material orig, Color c)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Expected O, but got Unknown
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		if (!TintedMats.TryGetValue(orig, out var value) || (Object)(object)value == (Object)null)
		{
			value = new Material(orig)
			{
				name = ((Object)orig).name + " (More Colours)"
			};
			TintedMats[orig] = value;
		}
		WriteColour(value, c);
		return value;
	}

	private static Color ReadColour(Material m)
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		string[] colourProps = ColourProps;
		foreach (string text in colourProps)
		{
			if (m.HasProperty(text))
			{
				return m.GetColor(text);
			}
		}
		return Color.white;
	}

	private static void WriteColour(Material m, Color c)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		string[] colourProps = ColourProps;
		foreach (string text in colourProps)
		{
			if (m.HasProperty(text))
			{
				m.SetColor(text, c);
			}
		}
	}

	private static void TintButton(Button b)
	{
		if ((Object)(object)b == (Object)null)
		{
			return;
		}
		if (MenuChrome.IsIconButton(b))
		{
			foreach (Image item in MenuChrome.Icons(b))
			{
				Tint((Graphic)(object)item, S.menuArrows);
			}
			return;
		}
		Tint((Graphic)(object)MenuChrome.ButtonFill(b), S.menuFill);
		foreach (Image item2 in MenuChrome.ButtonOutlines(b))
		{
			Tint((Graphic)(object)item2, S.menuBorders);
		}
	}

	private static void ApplyMenu()
	{
		TMP_Text[] componentsInChildren;
		Button[] componentsInChildren2;
		foreach (CanvasManager canvase in Canvases)
		{
			if ((Object)(object)canvase == (Object)null)
			{
				continue;
			}
			List<GameObject> list = Refl.Get<List<GameObject>>(canvase, typeof(CanvasManager), "_allMainMenuButtons");
			if (list != null)
			{
				foreach (GameObject item in list)
				{
					if ((Object)(object)item == (Object)null)
					{
						continue;
					}
					componentsInChildren = item.GetComponentsInChildren<TMP_Text>(true);
					for (int i = 0; i < componentsInChildren.Length; i++)
					{
						Tint((Graphic)(object)componentsInChildren[i], S.menuButtons);
					}
					componentsInChildren2 = item.GetComponentsInChildren<Button>(true);
					foreach (Button b in componentsInChildren2)
					{
						if (!MenuChrome.IsIconButton(b))
						{
							TintButton(b);
						}
					}
				}
			}
			GameObject val = Refl.Get<GameObject>(canvase, typeof(CanvasManager), "_howToFishTitle");
			if ((Object)(object)val != (Object)null)
			{
				Graphic[] componentsInChildren3 = val.GetComponentsInChildren<Graphic>(true);
				for (int i = 0; i < componentsInChildren3.Length; i++)
				{
					Tint(componentsInChildren3[i], S.menuTitle);
				}
			}
		}
		GameObject screen = OptionsTab.Screen;
		if ((Object)(object)screen == (Object)null)
		{
			return;
		}
		Transform stageTransform = NativePanel.StageTransform;
		componentsInChildren = screen.GetComponentsInChildren<TMP_Text>(true);
		foreach (TMP_Text val2 in componentsInChildren)
		{
			if (!((Object)(object)val2 == (Object)null) && (!((Object)(object)stageTransform != (Object)null) || !val2.transform.IsChildOf(stageTransform)))
			{
				TMP_InputField componentInParent = ((Component)val2).GetComponentInParent<TMP_InputField>();
				if (!((Object)(object)componentInParent != (Object)null) || !((Object)(object)componentInParent.placeholder == (Object)(object)val2))
				{
					Tint((Graphic)(object)val2, S.menuLabels);
				}
			}
		}
		componentsInChildren2 = screen.GetComponentsInChildren<Button>(true);
		foreach (Button val3 in componentsInChildren2)
		{
			if (!((Object)(object)((Component)val3).GetComponent<UIButton>() == (Object)null))
			{
				TintButton(val3);
			}
		}
		Slider[] componentsInChildren4 = screen.GetComponentsInChildren<Slider>(true);
		foreach (Slider s in componentsInChildren4)
		{
			Tint((Graphic)(object)MenuChrome.Track(s), S.menuSliders);
			Tint((Graphic)(object)MenuChrome.Fill(s), S.menuSliders);
			Tint((Graphic)(object)MenuChrome.Handle(s), S.menuHandles);
		}
	}

	private static void ApplyVignette()
	{
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Unknown result type (might be due to invalid IL or missing references)
		//IL_019d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01be: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: 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_0087: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: 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)
		foreach (PlayerEffects effect in Effects)
		{
			if ((Object)(object)effect == (Object)null)
			{
				continue;
			}
			if (!VignetteOrigs.TryGetValue(effect, out var value))
			{
				value = new VignetteOrig
				{
					damage = Refl.Get<Color>(effect, typeof(PlayerEffects), "_vignetteDamageColor"),
					poison = Refl.Get<Color>(effect, typeof(PlayerEffects), "_vignettePoisonColor"),
					fire = Refl.Get<Color>(effect, typeof(PlayerEffects), "_vignetteFireColor"),
					hunger = Refl.Get<Color>(effect, typeof(PlayerEffects), "_vignetteRestoreHungerColor")
				};
				VignetteOrigs[effect] = value;
				if (!S.van.hasVignette)
				{
					S.van.vignetteDamage = value.damage;
					S.van.vignettePoison = value.poison;
					S.van.vignetteFire = value.fire;
					S.van.vignetteHunger = value.hunger;
					S.van.hasVignette = true;
					MoreColoursPlugin.CfgDirty = true;
				}
			}
			Type typeFromHandle = typeof(PlayerEffects);
			Refl.Set(effect, typeFromHandle, "_vignetteDamageColor", Pick(S.vignetteDamage, value.damage));
			Refl.Set(effect, typeFromHandle, "_vignettePoisonColor", Pick(S.vignettePoison, value.poison));
			Refl.Set(effect, typeFromHandle, "_vignetteFireColor", Pick(S.vignetteFire, value.fire));
			Refl.Set(effect, typeFromHandle, "_vignetteRestoreHungerColor", Pick(S.vignetteHunger, value.hunger));
		}
	}

	public static void SuppressVignette(PlayerEffects fx)
	{
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)fx == (Object)null || (Object)(object)Player.LocalPlayer == (Object)null)
		{
			return;
		}
		PlayerVitals vitals = Player.LocalPlayer.Vitals;
		if ((Object)(object)vitals == (Object)null)
		{
			return;
		}
		bool num = vitals.FirePercent > 0.1f;
		bool flag = vitals.PoisonPercent > 0.1f;
		Type typeFromHandle = typeof(PlayerEffects);
		float num2 = Refl.Get<float>(fx, typeFromHandle, "_lastTimeEaten");
		float num3 = Refl.Get<float>(fx, typeFromHandle, "_ticksForEatEffect");
		bool flag2 = Time.time - num2 <= num3;
		bool flag3;
		if (num)
		{
			flag3 = !S.showVignetteFire;
		}
		else if (flag)
		{
			flag3 = !S.showVignettePoison;
		}
		else
		{
			if (!flag2)
			{
				return;
			}
			flag3 = !S.showVignetteHunger;
		}
		if (flag3)
		{
			float num4 = Refl.Get<float>(fx, typeFromHandle, "_deathVignette");
			AnimationCurve val = Refl.Get<AnimationCurve>(fx, typeFromHandle, "_effectsCurve");
			float num5 = ((val != null) ? val.Evaluate(vitals.HealthPercent) : vitals.HealthPercent);
			float num6 = Mathf.Lerp(num4, 0f, num5);
			Refl.Set(fx, typeFromHandle, "_curVignetteIntensity", num6);
			Refl.Set(fx, typeFromHandle, "_curVignetteColor", Color.black);
			ShaderManager.UpdateVignette(num6, Color.black);
		}
	}

	private static void ApplyMoney()
	{
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: 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)
		PlayerUI s = Refl.GetS<PlayerUI>(typeof(PlayerUI), "_instance");
		if ((Object)(object)s == (Object)null)
		{
			return;
		}
		MoneyUI val = Refl.Get<MoneyUI>(s, typeof(PlayerUI), "_moneyUI");
		if ((Object)(object)val == (Object)null)
		{
			return;
		}
		TextMeshProUGUI val2 = Refl.Get<TextMeshProUGUI>(val, typeof(MoneyUI), "_moneyText");
		if ((Object)(object)val2 == (Object)null)
		{
			return;
		}
		if ((Object)(object)val2 != (Object)(object)_moneyText)
		{
			_moneyText = val2;
			_moneyOrig = ((Graphic)val2).color;
			if (!S.van.hasMoney)
			{
				S.van.moneyCounter = _moneyOrig;
				S.van.hasMoney = true;
				MoreColoursPlugin.CfgDirty = true;
			}
		}
		((Graphic)val2).color = Pick(S.moneyCounter, _moneyOrig);
	}
}
internal class BhtfAdapter : ModAdapter
{
	private static readonly Color Cyan = new Color(0.18f, 0.82f, 0.88f);

	private static readonly Color ButtonBg = new Color(0.48f, 0.18f, 0.72f);

	private static readonly Row[] Table = new Row[32]
	{
		new Row("cardBg", "Catch card background", new Color(0.04f, 0.025f, 0.075f, 0.9f)),
		new Row("cardOutline", "Catch card outline", new Color(1f, 1f, 1f, 0.3f)),
		new Row("cardLines", "Catch card stripe and divider", new Color(1f, 1f, 1f, 0.72f)),
		new Row("cardPreview", "Catch card preview box", new Color(0.045f, 0.105f, 0.14f, 0.94f)),
		new Row("cardLabel", "Catch card 'new catch'", new Color(0.82f, 0.82f, 0.86f)),
		new Row("cardSize", "Catch card size number", new Color(0.74f, 0.2f, 1f)),
		new Row("cardCatcher", "Catch card 'caught by'", Color.white),
		new Row("cardSale", "Catch card sale value", new Color(0.96f, 0.76f, 0.28f)),
		new Row("cardRod", "Catch card rod bonuses", new Color(0.76f, 0.76f, 0.8f)),
		new Row("cardButtons", "Catch card buttons", ButtonBg),
		new Row("cardButtonText", "Catch card button text", Color.white),
		new Row("rankBg", "Biggest catches background", new Color(0.018f, 0.048f, 0.075f, 0.94f)),
		new Row("rankOutline", "Biggest catches outline", new Color(0.18f, 0.82f, 0.88f, 0.72f)),
		new Row("rankAccent", "Biggest catches accent", Cyan),
		new Row("rankTitle", "Biggest catches title", Color.white),
		new Row("rankSubtitle", "Biggest catches subtitle", new Color(0.66f, 0.75f, 0.8f)),
		new Row("rankRows", "Biggest catches rows", new Color(0.07f, 0.16f, 0.2f, 0.92f)),
		new Row("rankGold", "First place", new Color(1f, 0.72f, 0.22f)),
		new Row("rankSilver", "Second place", new Color(0.73f, 0.8f, 0.86f)),
		new Row("rankBronze", "Third place", new Color(0.8f, 0.48f, 0.27f)),
		new Row("rankNames", "Biggest catches names", Color.white),
		new Row("rankSizes", "Biggest catches sizes", Cyan),
		new Row("rankButtons", "Biggest catches buttons", new Color(0.07f, 0.2f, 0.25f, 0.96f)),
		new Row("rankButtonText", "Biggest catches button text", Cyan),
		new Row("benchBg", "Workbench prompt background", new Color(0.04f, 0.025f, 0.075f, 0.82f)),
		new Row("benchText", "Workbench prompt text", Color.white),
		new Row("benchButtons", "Workbench buttons", ButtonBg),
		new Row("benchButtonText", "Workbench button text", Color.white),
		new Row("hpShadow", "Health bar shadow", new Color(0f, 0f, 0f, 0.72f)),
		new Row("hpTrack", "Health bar track", new Color(0.035f, 0.055f, 0.065f, 0.96f)),
		new Row("hpNumbers", "Health bar numbers", Color.white),
		new Row("inspectSize", "Inspect size line (custom style only)", new Color(0.38f, 0.94f, 1f))
	};

	private Type _card;

	private Type _rank;

	private Type _bench;

	private Type _hp;

	private static FieldInfo _sig;

	private static string _seenSig;

	private Image _pvCard;

	private Image _pvCardStripe;

	private Image _pvCardBox;

	private Image _pvCardDiv;

	private Image _pvRank;

	private Image _pvRankStripe;

	private Image _pvRankMark;

	private Image _pvHpShadow;

	private Image _pvHpTrack;

	private Outline _pvCardEdge;

	private Outline _pvRankEdge;

	private TMP_Text _pvCardLabel;

	private TMP_Text _pvCardSize;

	private TMP_Text _pvCardCatcher;

	private TMP_Text _pvCardSale;

	private TMP_Text _pvRankTitle;

	private TMP_Text _pvRankSub;

	private TMP_Text _pvHpNums;

	private Image[] _pvRankRows;

	private Image[] _pvRankBadges;

	private TMP_Text[] _pvRankNums;

	private TMP_Text[] _pvRankNames;

	private TMP_Text[] _pvRankSizes;

	public override string Guid => "com.reysher.howtofish.giantfish";

	public override string Name => "Better How To Fish";

	public override string Prefix => "bhtf";

	public override Row[] Rows => Table;

	private ColorOv Ov(string key)
	{
		//IL_003a: 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)
		Row[] table = Table;
		for (int i = 0; i < table.Length; i++)
		{
			Row row = table[i];
			if (row.key == key)
			{
				return Colour(key, row.def);
			}
		}
		return Colour(key, Color.white);
	}

	protected override bool Resolve()
	{
		_card = T("GiantFishMod.CatchNotification");
		_rank = T("GiantFishMod.RankingHud");
		_bench = T("GiantFishMod.RodUpgradeHud");
		_hp = T("GiantFishMod.CreatureHealthBar");
		if (_card == null && _rank == null && _bench == null && _hp == null)
		{
			return false;
		}
		After(_card, "Show", 3);
		After(_rank, "Build", 0);
		After(_bench, "Build", 0);
		After(_hp, "TryCreate", 0);
		_sig = ((_rank == null) ? null : _rank.GetField("_lastSignature", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic));
		if (_sig != null)
		{
			After(_rank, "EnsureVisible", 1, "RankTick");
		}
		return true;
	}

	private static void RankTick()
	{
		string text = _sig.GetValue(null) as string;
		if (!(text == _seenSig))
		{
			_seenSig = text;
			Applier.Dirty = true;
		}
	}

	private static Transform Kid(GameObject root, string path)
	{
		if (!((Object)(object)root == (Object)null))
		{
			return root.transform.Find(path);
		}
		return null;
	}

	private static Image Img(GameObject root, string path)
	{
		Transform val = Kid(root, path);
		if (!((Object)(object)val == (Object)null))
		{
			return ((Component)val).GetComponent<Image>();
		}
		return null;
	}

	private static TMP_Text Txt(GameObject root, string path)
	{
		Transform val = Kid(root, path);
		if (!((Object)(object)val == (Object)null))
		{
			return ((Component)val).GetComponent<TMP_Text>();
		}
		return null;
	}

	protected override void Paint()
	{
		PaintCard();
		PaintRankings();
		PaintBench();
		PaintHealthBars();
	}

	private void PaintCard()
	{
		if (!(_card == null))
		{
			GameObject s = Refl.GetS<GameObject>(_card, "_currentCard");
			if (!((Object)(object)s == (Object)null))
			{
				ModAdapter.Tint((Graphic)(object)s.GetComponent<Image>(), Ov("cardBg"));
				TintOutline(s.GetComponent<Outline>(), Ov("cardOutline"));
				ModAdapter.Tint((Graphic)(object)Img(s, "TopAccent"), Ov("cardLines"));
				ModAdapter.Tint((Graphic)(object)Img(s, "Divider"), Ov("cardLines"));
				ModAdapter.Tint((Graphic)(object)Img(s, "PreviewPanel"), Ov("cardPreview"));
				ModAdapter.Tint((Graphic)(object)Txt(s, "CaptureLabel"), Ov("cardLabel"));
				ModAdapter.Tint((Graphic)(object)Txt(s, "Size"), Ov("cardSize"));
				ModAdapter.Tint((Graphic)(object)Txt(s, "Catcher"), Ov("cardCatcher"));
				ModAdapter.Tint((Graphic)(object)Txt(s, "SaleValue"), Ov("cardSale"));
				ModAdapter.Tint((Graphic)(object)Txt(s, "RodBonuses"), Ov("cardRod"));
				ModAdapter.Tint((Graphic)(object)Img(s, "CatchCardSmaller"), Ov("cardButtons"));
				ModAdapter.Tint((Graphic)(object)Img(s, "CatchCardLarger"), Ov("cardButtons"));
				ModAdapter.Tint((Graphic)(object)Txt(s, "CatchCardSmaller/Label"), Ov("cardButtonText"));
				ModAdapter.Tint((Graphic)(object)Txt(s, "CatchCardLarger/Label"), Ov("cardButtonText"));
				ModAdapter.Tint((Graphic)(object)Txt(s, "ResizeLabel"), Ov("cardButtonText"));
			}
		}
	}

	private void PaintRankings()
	{
		//IL_0187: Unknown result type (might be due to invalid IL or missing references)
		//IL_018c: Unknown result type (might be due to invalid IL or missing references)
		if (_rank == null)
		{
			return;
		}
		GameObject s = Refl.GetS<GameObject>(_rank, "_root");
		if ((Object)(object)s == (Object)null)
		{
			return;
		}
		ModAdapter.Tint((Graphic)(object)s.GetComponent<Image>(), Ov("rankBg"));
		TintOutline(s.GetComponent<Outline>(), Ov("rankOutline"));
		ModAdapter.Tint((Graphic)(object)Img(s, "TopAccent"), Ov("rankAccent"));
		ModAdapter.Tint((Graphic)(object)Img(s, "TitleMarker"), Ov("rankAccent"));
		ModAdapter.Tint((Graphic)(object)Txt(s, "Title"), Ov("rankTitle"));
		ModAdapter.Tint((Graphic)(object)Txt(s, "Subtitle"), Ov("rankSubtitle"));
		string[] array = new string[3] { "rankGold", "rankSilver", "rankBronze" };
		for (int i = 0; i < 3; i++)
		{
			string text = "RankRow" + (i + 1);
			ModAdapter.Tint((Graphic)(object)Img(s, text), Ov("rankRows"));
			ColorOv colorOv = Ov(array[i]);
			ModAdapter.Tint((Graphic)(object)Txt(s, text + "/Rank"), colorOv);
			ModAdapter.Tint((Graphic)(object)Img(s, text + "/RankBadge"), new ColorOv
			{
				on = colorOv.on,
				c = new Color(colorOv.c.r, colorOv.c.g, colorOv.c.b, 0.2f)
			});
			TMP_Text val = Txt(s, text + "/Player");
			TMP_Text val2 = Txt(s, text + "/Size");
			if ((Object)(object)val != (Object)null && val.text != "No catches")
			{
				ModAdapter.Tint((Graphic)(object)val, Ov("rankNames"));
			}
			if ((Object)(object)val2 != (Object)null && val2.text != "—")
			{
				ModAdapter.Tint((Graphic)(object)val2, Ov("rankSizes"));
			}
		}
		string[] array2 = new string[3] { "RankingSmaller", "RankingLarger", "HealthBarsToggle" };
		foreach (string text2 in array2)
		{
			ModAdapter.Tint((Graphic)(object)Img(s, text2), Ov("rankButtons"));
			ModAdapter.Tint((Graphic)(object)Txt(s, text2 + "/Label"), Ov("rankButtonText"));
		}
	}

	private void PaintBench()
	{
		if (_bench == null)
		{
			return;
		}
		GameObject s = Refl.GetS<GameObject>(_bench, "_panel");
		if ((Object)(object)s == (Object)null)
		{
			return;
		}
		ModAdapter.Tint((Graphic)(object)s.GetComponent<Image>(), Ov("benchBg"));
		ModAdapter.Tint((Graphic)(object)Txt(s, "UpgradeMessage"), Ov("benchText"));
		ModAdapter.Tint((Graphic)(object)Txt(s, "ResizeLabel"), Ov("benchButtonText"));
		string[] array = new string[2] { "WorkbenchSmaller", "WorkbenchLarger" };
		foreach (string path in array)
		{
			Transform val = Kid(s, path);
			if (!((Object)(object)val == (Object)null))
			{
				ModAdapter.Tint((Graphic)(object)((Component)val).GetComponent<Image>(), Ov("benchButtons"));
				ModAdapter.Tint((Graphic)(object)((Component)val).GetComponentInChildren<TMP_Text>(true), Ov("benchButtonText"));
			}
		}
	}

	private void PaintHealthBars()
	{
		if (_hp == null)
		{
			return;
		}
		Object[] array = Object.FindObjectsByType(_hp);
		for (int i = 0; i < array.Length; i++)
		{
			GameObject val = Refl.Get<GameObject>(array[i], _hp, "_root");
			if (!((Object)(object)val == (Object)null))
			{
				ModAdapter.Tint((Graphic)(object)Img(val, "Shadow"), Ov("hpShadow"));
				ModAdapter.Tint((Graphic)(object)Img(val, "Track"), Ov("hpTrack"));
				ModAdapter.Tint((Graphic)(object)Txt(val, "HealthNumbers"), Ov("hpNumbers"));
			}
		}
	}

	public override string Inspect(string text)
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		ColorOv colorOv = Ov("inspectSize");
		if (!colorOv.on || text.IndexOf("<color=#61F0FF>", StringComparison.OrdinalIgnoreCase) < 0)
		{
			return text;
		}
		return text.Replace("<color=#61F0FF>", "<color=#" + ColorUtility.ToHtmlStringRGB(colorOv.c) + ">");
	}

	public override void BuildPreview(PreviewStage s)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: 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_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: 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_0076: 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_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0211: Unknown result type (might be due to invalid IL or missing references)
		//IL_0220: Unknown result type (might be due to invalid IL or missing references)
		//IL_022f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0240: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Unknown result type (might be due to invalid IL or missing references)
		//IL_025e: Unknown result type (might be due to invalid IL or missing references)
		//IL_028a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0387: Unknown result type (might be due to invalid IL or missing references)
		//IL_0392: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0436: Unknown result type (might be due to invalid IL or missing references)
		//IL_046d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0494: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0505: Unknown result type (might be due to invalid IL or missing references)
		//IL_0514: Unknown result type (might be due to invalid IL or missing references)
		//IL_0523: Unknown result type (might be due to invalid IL or missing references)
		//IL_054b: Unknown result type (might be due to invalid IL or missing references)
		_pvCard = s.Image(Color.white, new Vector2(0.27f, 0.62f), new Vector2(200f, 130f));
		_pvCardEdge = ((Component)_pvCard).gameObject.AddComponent<Outline>();
		_pvCardStripe = s.Image(Color.white, new Vector2(0.27f, 0.832f), new Vector2(200f, 3f));
		_pvCardBox = s.Image(Color.white, new Vector2(0.131f, 0.66f), new Vector2(56f, 56f));
		_pvCardLabel = s.Label("NEW CATCH", s.Fs * 0.22f, new Vector2(0.209f, 0.8f), (TextAlignmentOptions)4097, 124f, 18f);
		_pvCardSize = s.Label("×2.50", s.Fs * 0.55f, new Vector2(0.209f, 0.72f), (TextAlignmentOptions)4097, 124f, 30f);
		_pvCardSize.fontStyle = (FontStyles)1;
		_pvCardCatcher = s.Label("CAUGHT BY  ·  Sopika", s.Fs * 0.26f, new Vector2(0.209f, 0.62f), (TextAlignmentOptions)4097, 124f, 20f);
		_pvCardDiv = s.Image(Color.white, new Vector2(0.34f, 0.575f), new Vector2(120f, 1f));
		_pvCardSale = s.Label("SALE VALUE  ·  $1,234", s.Fs * 0.26f, new Vector2(0.209f, 0.52f), (TextAlignmentOptions)4097, 124f, 20f);
		_pvRank = s.Image(Color.white, new Vector2(0.73f, 0.62f), new Vector2(200f, 130f));
		_pvRankEdge = ((Component)_pvRank).gameObject.AddComponent<Outline>();
		_pvRankStripe = s.Image(Color.white, new Vector2(0.73f, 0.832f), new Vector2(200f, 3f));
		_pvRankMark = s.Image(Color.white, new Vector2(0.534f, 0.79f), new Vector2(3f, 16f));
		_pvRankTitle = s.Label("BIGGEST CATCHES", s.Fs * 0.34f, new Vector2(0.548f, 0.8f), (TextAlignmentOptions)4097, 150f, 24f);
		_pvRankTitle.fontStyle = (FontStyles)1;
		_pvRankSub = s.Label("SESSION RECORDS", s.Fs * 0.22f, new Vector2(0.548f, 0.745f), (TextAlignmentOptions)4097, 150f, 16f);
		string[] array = new string[3] { "Sopika", "Angler", "Bob" };
		string[] array2 = new string[3] { "×4.20", "×3.15", "×2.50" };
		_pvRankRows = (Image[])(object)new Image[3];
		_pvRankBadges = (Image[])(object)new Image[3];
		_pvRankNums = (TMP_Text[])(object)new TMP_Text[3];
		_pvRankNames = (TMP_Text[])(object)new TMP_Text[3];
		_pvRankSizes = (TMP_Text[])(object)new TMP_Text[3];
		for (int i = 0; i < 3; i++)
		{
			float num = 0.66f - (float)i * 0.095f;
			_pvRankRows[i] = s.Image(Color.white, new Vector2(0.73f, num), new Vector2(184f, 24f));
			_pvRankBadges[i] = s.Image(Color.white, new Vector2(0.556f, num), new Vector2(24f, 24f));
			_pvRankNums[i] = s.Label((i + 1).ToString(), s.Fs * 0.3f, new Vector2(0.556f, num), (TextAlignmentOptions)4098, 30f, 24f);
			_pvRankNames[i] = s.Label(array[i], s.Fs * 0.3f, new Vector2(0.595f, num), (TextAlignmentOptions)4097, 100f, 24f);
			_pvRankSizes[i] = s.Label(array2[i], s.Fs * 0.3f, new Vector2(0.917f, num), (TextAlignmentOptions)4100, 60f, 24f);
		}
		_pvHpShadow = s.Image(Color.white, new Vector2(0.5f, 0.17f), new Vector2(320f, 40f));
		_pvHpTrack = s.Image(Color.white, new Vector2(0.5f, 0.17f), new Vector2(306f, 28f));
		s.Image(new Color(0.22f, 0.86f, 0.42f, 0.96f), new Vector2(0.5f, 0.17f), new Vector2(296f, 18f));
		_pvHpNums = s.Label("20 / 20", s.Fs * 0.38f, new Vector2(0.5f, 0.17f), (TextAlignmentOptions)4098, 100f, 28f);
		_pvHpNums.fontStyle = (FontStyles)1;
		UpdatePreview(s, 0f);
	}

	public override void UpdatePreview(PreviewStage s, float t)
	{
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: 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_007f: 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)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: 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_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: 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_021e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_024a: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: 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_02b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0307: Unknown result type (might be due to invalid IL or missing references)
		//IL_030c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0311: Unknown result type (might be due to invalid IL or missing references)
		//IL_0334: Unknown result type (might be due to invalid IL or missing references)
		//IL_0339: Unknown result type (might be due to invalid IL or missing references)
		//IL_034b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0351: Unknown result type (might be due to invalid IL or missing references)
		//IL_0357: Unknown result type (might be due to invalid IL or missing references)
		//IL_0362: Unknown result type (might be due to invalid IL or missing references)
		//IL_0374: Unknown result type (might be due to invalid IL or missing references)
		//IL_0388: Unknown result type (might be due to invalid IL or missing references)
		//IL_038d: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_03df: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_040e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0413: Unknown result type (might be due to invalid IL or missing references)
		//IL_0429: Unknown result type (might be due to invalid IL or missing references)
		//IL_042e: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)_pvCard == (Object)null) && !((Object)(object)_pvRank == (Object)null) && !((Object)(object)_pvHpNums == (Object)null))
		{
			((Graphic)_pvCard).color = Cur("cardBg", new Color(0.04f, 0.025f, 0.075f, 0.9f));
			((Shadow)_pvCardEdge).effectColor = Cur("cardOutline", new Color(1f, 1f, 1f, 0.3f));
			((Graphic)_pvCardStripe).color = Cur("cardLines", new Color(1f, 1f, 1f, 0.72f));
			((Graphic)_pvCardDiv).color = Cur("cardLines", new Color(1f, 1f, 1f, 0.22f));
			((Graphic)_pvCardBox).color = Cur("cardPreview", new Color(0.045f, 0.105f, 0.14f, 0.94f));
			((Graphic)_pvCardLabel).color = Cur("cardLabel", new Color(0.82f, 0.82f, 0.86f));
			((Graphic)_pvCardSize).color = Cur("cardSize", new Color(0.74f, 0.2f, 1f));
			((Graphic)_pvCardCatcher).color = Cur("cardCatcher", Color.white);
			((Graphic)_pvCardSale).color = Cur("cardSale", new Color(0.96f, 0.76f, 0.28f));
			((Graphic)_pvRank).color = Cur("rankBg", new Color(0.018f, 0.048f, 0.075f, 0.94f));
			((Shadow)_pvRankEdge).effectColor = Cur("rankOutline", new Color(0.18f, 0.82f, 0.88f, 0.72f));
			((Graphic)_pvRankStripe).color = Cur("rankAccent", Cyan);
			((Graphic)_pvRankMark).color = ((Graphic)_pvRankStripe).color;
			((Graphic)_pvRankTitle).color = Cur("rankTitle", Color.white);
			((Graphic)_pvRankSub).color = Cur("rankSubtitle", new Color(0.66f, 0.75f, 0.8f));
			string[] array = new string[3] { "rankGold", "rankSilver", "rankBronze" };
			Color[] array2 = (Color[])(object)new Color[3]
			{
				new Color(1f, 0.72f, 0.22f),
				new Color(0.73f, 0.8f, 0.86f),
				new Color(0.8f, 0.48f, 0.27f)
			};
			for (int i = 0; i < 3; i++)
			{
				Color val = Cur(array[i], array2[i]);
				((Graphic)_pvRankRows[i]).color = Cur("rankRows", new Color(0.07f, 0.16f, 0.2f, 0.92f));
				((Graphic)_pvRankBadges[i]).color = new Color(val.r, val.g, val.b, 0.2f);
				((Graphic)_pvRankNums[i]).color = val;
				((Graphic)_pvRankNames[i]).color = Cur("rankNames", Color.white);
				((Graphic)_pvRankSizes[i]).color = Cur("rankSizes", Cyan);
			}
			((Graphic)_pvHpShadow).color = Cur("hpShadow", new Color(0f, 0f, 0f, 0.72f));
			((Graphic)_pvHpTrack).color = Cur("hpTrack", new Color(0.035f, 0.055f, 0.065f, 0.96f));
			((Graphic)_pvHpNums).color = Cur("hpNumbers", Color.white);
		}
	}
}
internal class NeptuneAdapter : ModAdapter
{
	private static readonly string[,] StyleRows = new string[9, 3]
	{
		{ "logo", "Logo", "Logo" },
		{ "version", "Version line", "LogoSub" },
		{ "tabs", "Tabs", "TabLabel" },
		{ "activeTab", "Active tab", "TabLabelActive" },
		{ "heading", "Page heading", "H1" },
		{ "sections", "Section headers", "SmallDim" },
		{ "values", "Slider values", "Value" },
		{ "status", "Status text", "Small" },
		{ "watermark", "Watermark", "WatermarkText" }
	};

	private static readonly string[,] EspRows = new string[7, 3]
	{
		{ "espFish", "ESP fish", "ColFish" },
		{ "espBoss", "ESP bosses", "ColBoss" },
		{ "espShiny", "ESP shiny", "ColShiny" },
		{ "espBird", "ESP birds", "ColBird" },
		{ "espPlayer", "ESP players", "ColPlayer" },
		{ "espItem", "ESP items", "ColItem" },
		{ "espDead", "ESP dead", "ColDead" }
	};

	private Type _theme;

	private Type _esp;

	private Type _widgets;

	private readonly Dictionary<GUIStyle, int> _baseSize = new Dictionary<GUIStyle, int>();

	private readonly Dictionary<GUIStyle, Color> _baseCol = new Dictionary<GUIStyle, Color>();

	private readonly Dictionary<string, Color> _espBase = new Dictionary<string, Color>();

	private object _seenLogo;

	private TMP_Text _pvLogo;

	private TMP_Text _pvVer;

	private TMP_Text _pvTab;

	private TMP_Text _pvTabOn;

	private TMP_Text _pvHead;

	private TMP_Text _pvSect;

	private TMP_Text _pvItem;

	private TMP_Text _pvVal;

	private TMP_Text _pvStatus;

	private TMP_Text _pvWm;

	private TMP_Text _pvWmSide;

	private TMP_Text _pvFish;

	private TMP_Text _pvBoss;

	private TMP_Text _pvPlayer;

	private Image _pvDot;

	public override string Guid => "com.neptune.howtofish";

	public override string Name => "Neptune";

	public override string Prefix => "neptune";

	public override Row[] Rows
	{
		get
		{
			//IL_0030: 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)
			List<Row> list = new List<Row>();
			for (int i = 0; i < StyleRows.GetLength(0); i++)
			{
				list.Add(new Row(StyleRows[i, 0], StyleRows[i, 1], StyleColour(StyleRows[i, 2])));
			}
			for (int j = 0; j < EspRows.GetLength(0); j++)
			{
				list.Add(new Row(EspRows[j, 0], EspRows[j, 1], EspColour(EspRows[j, 2])));
			}
			return list.ToArray();
		}
	}

	public override SizeRow[] Sizes => new SizeRow[2]
	{
		new SizeRow("menu", "Menu text size", 0.75f, 1.35f),
		new SizeRow("esp", "ESP text size", 0.75f, 1.35f)
	};

	private Color StyleColour(string field)
	{
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: 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)
		GUIStyle val = ((_theme == null) ? null : Refl.GetS<GUIStyle>(_theme, field));
		if (val != null && _baseCol.TryGetValue(val, out var value))
		{
			return value;
		}
		if (val == null)
		{
			return new Color(0.9f, 0.93f, 0.95f);
		}
		return val.normal.textColor;
	}

	private Color EspColour(string field)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		if (!_espBase.TryGetValue(field, out var value))
		{
			return Color.white;
		}
		return value;
	}

	private ColorOv Ov(string key)
	{
		//IL_0027: 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)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < StyleRows.GetLength(0); i++)
		{
			if (StyleRows[i, 0] == key)
			{
				return Colour(key, StyleColour(StyleRows[i, 2]));
			}
		}
		for (int j = 0; j < EspRows.GetLength(0); j++)
		{
			if (EspRows[j, 0] == key)
			{
				return Colour(key, EspColour(EspRows[j, 2]));
			}
		}
		return Colour(key, Color.white);
	}

	private ColorOv RowFor(string themeField)
	{
		for (int i = 0; i < StyleRows.GetLength(0); i++)
		{
			if (StyleRows[i, 2] == themeField)
			{
				return Ov(StyleRows[i, 0]);
			}
		}
		return null;
	}

	protected override bool Resolve()
	{
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		_theme = T("Neptune.UI.Theme");
		_esp = T("Neptune.Esp");
		_widgets = T("Neptune.UI.Widgets");
		if (_theme == null)
		{
			return false;
		}
		if (_esp != null)
		{
			for (int i = 0; i < EspRows.GetLength(0); i++)
			{
				string text = EspRows[i, 2];
				if (Refl.F(_esp, text) != null)
				{
					_espBase[text] = Refl.GetS<Color>(_esp, text);
				}
			}
		}
		return true;
	}

	protected override void Paint()
	{
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		object s = Refl.GetS<object>(_theme, "Logo");
		if (s == null)
		{
			return;
		}
		if (s != _seenLogo)
		{
			_seenLogo = s;
			_baseSize.Clear();
			_baseCol.Clear();
		}
		float mult = Size("menu");
		FieldInfo[] fields = _theme.GetFields(BindingFlags.Static | BindingFlags.Public);
		foreach (FieldInfo fieldInfo in fields)
		{
			if (fieldInfo.FieldType == typeof(GUIStyle))
			{
				object? value = fieldInfo.GetValue(null);
				Poke((GUIStyle)((value is GUIStyle) ? value : null), mult, RowFor(fieldInfo.Name));
			}
		}
		if (_widgets != null)
		{
			Poke(Refl.GetS<GUIStyle>(_widgets, "_tfStyle"), mult, null);
		}
		if (_esp == null)
		{
			return;
		}
		float mult2 = Size("esp");
		Poke(Refl.GetS<GUIStyle>(_esp, "_label"), mult2, null);
		Poke(Refl.GetS<GUIStyle>(_esp, "_labelSmall"), mult2, null);
		for (int j = 0; j < EspRows.GetLength(0); j++)
		{
			string text = EspRows[j, 2];
			if (_espBase.TryGetValue(text, out var value2))
			{
				ColorOv colorOv = Ov(EspRows[j, 0]);
				Refl.SetS(_esp, text, colorOv.on ? colorOv.c : value2);
			}
		}
	}

	private void Poke(GUIStyle s, float mult, ColorOv ov)
	{
		//IL_0035: 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_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: 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_0092: Unknown result type (might be due to invalid IL or missing references)
		if (s != null)
		{
			if (!_baseSize.TryGetValue(s, out var value))
			{
				value = s.fontSize;
				_baseSize[s] = value;
				_baseCol[s] = s.normal.textColor;
			}
			int num = Mathf.Max(1, Mathf.RoundToInt((float)value * mult));
			if (s.fontSize != num)
			{
				s.fontSize = num;
			}
			if (ov != null)
			{
				Color textColor = (ov.on ? ov.c : _baseCol[s]);
				s.normal.textColor = textColor;
				s.hover.textColor = textColor;
			}
		}
	}

	public override void BuildPreview(PreviewStage s)
	{
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: 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_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Unknown result type (might be due to invalid IL or missing references)
		//IL_0192: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_023a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0259: Unknown result type (might be due to invalid IL or missing references)
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_0273: Unknown result type (might be due to invalid IL or missing references)
		//IL_0280: Unknown result type (might be due to invalid IL or missing references)
		//IL_028c: Unknown result type (might be due to invalid IL or missing references)
		//IL_029b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0302: Unknown result type (might be due to invalid IL or missing references)
		//IL_0321: Unknown result type (might be due to invalid IL or missing references)
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_033c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0364: Unknown result type (might be due to invalid IL or missing references)
		//IL_0383: Unknown result type (might be due to invalid IL or missing references)
		//IL_038e: Unknown result type (might be due to invalid IL or missing references)
		//IL_039d: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_040f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0433: Unknown result type (might be due to invalid IL or missing references)
		//IL_0452: Unknown result type (might be due to invalid IL or missing references)
		//IL_045d: Unknown result type (might be due to invalid IL or missing references)
		//IL_046c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0478: Unknown result type (might be due to invalid IL or missing references)
		//IL_0484: Unknown result type (might be due to invalid IL or missing references)
		//IL_0493: Unknown result type (might be due to invalid IL or missing references)
		//IL_049f: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0507: Unknown result type (might be due to invalid IL or missing references)
		//IL_0513: Unknown result type (might be due to invalid IL or missing references)
		//IL_0522: Unknown result type (might be due to invalid IL or missing references)
		//IL_054a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0585: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0608: Unknown result type (might be due to invalid IL or missing references)
		//IL_0643: Unknown result type (might be due to invalid IL or missing references)
		//IL_0681: Unknown result type (might be due to invalid IL or missing references)
		//IL_0688: Unknown result type (might be due to invalid IL or missing references)
		//IL_068a: Unknown result type (might be due to invalid IL or missing references)
		//IL_068b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0692: Unknown result type (might be due to invalid IL or missing references)
		//IL_0694: Unknown result type (might be due to invalid IL or missing references)
		//IL_0695: Unknown result type (might be due to invalid IL or missing references)
		//IL_069c: Unknown result type (might be due to invalid IL or missing references)
		//IL_069e: Unknown result type (might be due to invalid IL or missing references)
		//IL_069f: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_06cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d2: Unknown result type (might be due to invalid IL or missing references)
		Color c = default(Color);
		((Color)(ref c))..ctor(0.055f, 0.07f, 0.095f);
		Color c2 = default(Color);
		((Color)(ref c2))..ctor(0.07f, 0.088f, 0.115f);
		Color c3 = default(Color);
		((Color)(ref c3))..ctor(0.098f, 0.12f, 0.152f);
		Color c4 = default(Color);
		((Color)(ref c4))..ctor(0.15f, 0.18f, 0.225f);
		Color val = default(Color);
		((Color)(ref val))..ctor(0f, 0.898f, 0.627f);
		Color color = default(Color);
		((Color)(ref color))..ctor(0.902f, 0.929f, 0.953f);
		Color color2 = default(Color);
		((Color)(ref color2))..ctor(0.545f, 0.596f, 0.663f);
		for (int i = 0; i < 4; i++)
		{
			s.Image(c, new Vector2(0.22f, 0.215f + (float)i * 0.185f), new Vector2(150f, 60f));
		}
		_pvLogo = s.Label("NEPTUNE", s.Fs * 0.55f, new Vector2(0.22f, 0.815f), (TextAlignmentOptions)4098, 140f, 30f);
		s.Image(val, new Vector2(0.22f, 0.762f), new Vector2(44f, 2f));
		_pvVer = s.Label("v1.1.0  ·  internal", s.Fs * 0.25f, new Vector2(0.22f, 0.73f), (TextAlignmentOptions)4098, 140f, 16f);
		s.Image(new Color(val.r, val.g, val.b, 0.12f), new Vector2(0.22f, 0.62f), new Vector2(126f, 26f));
		s.Image(val, new Vector2(0.085f, 0.62f), new Vector2(3f, 14f));
		_pvTabOn = s.Label("Aim", s.Fs * 0.36f, new Vector2(0.105f, 0.62f), (TextAlignmentOptions)4097, 100f, 24f);
		_pvTab = s.Label("Visuals", s.Fs * 0.36f, new Vector2(0.105f, 0.53f), (TextAlignmentOptions)4097, 100f, 24f);
		s.Image(c2, new Vector2(0.22f, 0.21f), new Vector2(126f, 34f));
		_pvDot = s.Image(val, new Vector2(0.105f, 0.21f), new Vector2(6f, 6f));
		_pvStatus = s.Label("Hosting", s.Fs * 0.3f, new Vector2(0.125f, 0.21f), (TextAlignmentOptions)4097, 100f, 20f);
		_pvHead = s.Label("Aim", s.Fs * 0.52f, new Vector2(0.41f, 0.815f), (TextAlignmentOptions)4097, 140f, 30f);
		s.Image(val, new Vector2(0.415f, 0.685f), new Vector2(3f, 14f));
		_pvSect = s.Label("TARGETING", s.Fs * 0.3f, new Vector2(0.437f, 0.685f), (TextAlignmentOptions)4097, 130f, 20f);
		s.Image(c3, new Vector2(0.565f, 0.648f), new Vector2(144f, 1f));
		s.Image(c3, new Vector2(0.565f, 0.565f), new Vector2(144f, 40f));
		_pvItem = s.Label("Tracking", s.Fs * 0.36f, new Vector2(0.437f, 0.588f), (TextAlignmentOptions)4097, 90f, 20f);
		((Graphic)_pvItem).color = color;
		_pvVal = s.Label("0.50", s.Fs * 0.33f, new Vector2(0.693f, 0.588f), (TextAlignmentOptions)4100, 80f, 20f);
		s.Image(c4, new Vector2(0.565f, 0.53f), new Vector2(116f, 4f));
		s.Image(val, new Vector2(0.502f, 0.53f), new Vector2(58f, 4f));
		s.Image(Color.white, new Vector2(0.565f, 0.53f), new Vector2(10f, 10f));
		s.Image(new Color(0.04f, 0.055f, 0.075f, 0.82f), new Vector2(0.565f, 0.4f), new Vector2(150f, 22f));
		s.Image(val, new Vector2(0.405f, 0.4f), new Vector2(3f, 22f));
		_pvWm = s.Label("NEPTUNE 1.1.0", s.Fs * 0.3f, new Vector2(0.427f, 0.4f), (TextAlignmentOptions)4097, 100f, 20f);
		_pvWmSide = s.Label("HOST", s.Fs * 0.3f, new Vector2(0.705f, 0.4f), (TextAlignmentOptions)4100, 80f, 20f);
		((Graphic)_pvWmSide).color = color2;
		_pvFish = s.Label("Bass  12m", s.Fs * 0.3f, new Vector2(0.865f, 0.74f), (TextAlignmentOptions)4098, 90f, 20f);
		_pvBoss = s.Label("Old Pike", s.Fs * 0.3f, new Vector2(0.865f, 0.6f), (TextAlignmentOptions)4098, 90f, 20f);
		_pvPlayer = s.Label("Player", s.Fs * 0.3f, new Vector2(0.865f, 0.46f), (TextAlignmentOptions)4098, 90f, 20f);
		TMP_Text pvLogo = _pvLogo;
		TMP_Text pvTabOn = _pvTabOn;
		TMP_Text pvHead = _pvHead;
		TMP_Text pvVal = _pvVal;
		TMP_Text pvWm = _pvWm;
		FontStyles val2 = (FontStyles)1;
		pvWm.fontStyle = (FontStyles)1;
		FontStyles val3 = (pvVal.fontStyle = val2);
		FontStyles val5 = (pvHead.fontStyle = val3);
		FontStyles fontStyle = (pvTabOn.fontStyle = val5);
		pvLogo.fontStyle = fontStyle;
		TMP_Text pvFish = _pvFish;
		TMP_Text pvBoss = _pvBoss;
		TMP_Te